####################################################################### # # # Example: Making a Carbon Nanotube using FILL and MOVE commands # # # ####################################################################### # # # We create a carbon nanotube (buckytube) in two steps. # # # # Step 1: Use FILL command to make a graphite plane segment # # (a graphene). # # # Step 2: Use the MOVE command to roll up the graphene. Note # # that we exploit the ability of the MOVE command to # # determine the displacement for an individual atom # # from the initial coordinates on an atom by atom basis. # # # # The result is a carbon nanotube whose axis lies in the Y # # direction. # # # # You can adjust the size of the nanotube and the orientation # # of the graphite lattice relative to the cylinder axis by # # adjusting the following parameters. # # # # A0 Carbon-Carbon bond length. # # NX The number of repeating cells in the X direction # # (before rollup is performed). # # NY The number of repeating cells in the Y direction. # # M,N,HAND Controls the orientation of the graphite plane # # relative to the cylinder axis. For M,N = 1,0 # # the some of the graphite bonds lie parallel to # # the cylinder axis. For M,N = 0,1 some of the # # graphite bonds lie perpendicular to the cylinder # # axis. For other values of M,N the graphite takes # # other orientations. The value of HAND must be set # # to either 1 or 0, it modifies the possible # # orientations obtained from the values of M,N. # # # # # ####################################################################### #----------------------------------------------------------------------- # Adjustable parameters #----------------------------------------------------------------------- # Carbon-Carbon bond length in anstroms calc A0=1.5 # M, N and HAND determine the orientation of the lattice relative # to the cylinder axis calc M=2 calc N=1 # Set HAND to 1 or 0 # This toggles factors (2*HAND+1) and (3-2*HAND) between 1 and 3. calc HAND=0 # This multiplies the lattice size in each direction calc NX=3 calc NY=6 #----------------------------------------------------------------------- # Constants #----------------------------------------------------------------------- # Size of single graphene cell (for 100 010 001 orientation) calc AX=sqrt(3) calc AY=3 calc AZ=1 #----------------------------------------------------------------------- # Graphene constuction #----------------------------------------------------------------------- # Graphene cell coordinates (for 100 010 001 orientation) fill particle 4 1 sqrt(3)/4 1/2 0 2 sqrt(3)/4 5/2 0 1 3*sqrt(3)/4 1 0 2 3*sqrt(3)/4 2 0 # Lattice vectors (for 100 010 001 orientation) fill cell AX 0 0 0 AY 0 0 0 AZ # Lattice orientation: Three mutually orthgonal vectors of any length fill orient M*(2*HAND+1)*AX N*AY 0 N*(3-2*HAND)*AX -M*AY 0 0 0 1 # Size of re-oriented graphene cell calc BX = NX * sqrt( (M*(2*HAND+1)*AX)^2 + (N*AY)^2 ) calc BY = NY * sqrt( (N*(3-2*HAND)*AX)^2 + (M*AY)^2 ) calc BZ = AZ # Lattice container (this depends on the orientation) fill boundary box 0 0 0 BX BY BZ # Make graphite plane segment (graphene) fill go #----------------------------------------------------------------------- # Roll graphene into a cylinder #----------------------------------------------------------------------- # Move particle by difference betwen their final and current # positions. Note that we calculate the angle of the atom # around the cylinder (ang) and the cylinder radius (r) in # the MOVE command before specifying the three displacements. # See the documentation for more on this technique. calc L=BX move ang=2*pi*x/L r=L/(2*pi) r*cos(ang)+L/2-x 0 r*sin(ang)+L/2-z # Scale by desired bond length. scale A0 #----------------------------------------------------------------------- # Write resulting coordinates #----------------------------------------------------------------------- # Write particle and cor file. write particle write cor nanotube.cor