#######################################################################
# #
# Example: Making a Carbon nanotube using the DUP and MOVE commands. #
# #
#######################################################################
# #
# We create a Carbon Nanotube (Buckytube) in two steps. #
# #
# Step 1: Create graphite plane segment (a graphene) using the #
# PARTICLE and DUP commands. #
# #
# 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. #
# #
# Note that there are many possible ways to orient the graphene #
# relative to the cylinder axis. This example shows a specific #
# orientation. #
# #
# You can adjust the size of the carbon nanotype by adjusting #
# the following variables: #
# #
# A0 Carbon-Carbond bond length #
# NX Controls the circumference and radius of the nanotube. #
# NY Controls the length of the nanotube. #
# #
#######################################################################
# Adjustable parameters
# Nanotube bond length (in Angstroms)
calc A0=1.421
# Number of cells in X and Y directions.
calc NX=6
calc NY=4
# Make graphite plane segment (graphene)
particle 4
1 1/4 1/6 0
1 1/4 5/6 0
1 3/4 2/6 0
1 3/4 4/6 0
dup NX-1 1 0 0
dup NY-1 0 1 0
# Roll up the graphene
# L is length of plane segment in X direction
calc L=NX
# 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.
move ang=2*pi*x/L r=L/(2*pi) r*cos(ang)+L/2-x 0 r*sin(ang)+L/2-z
# Scale x,z directions to obtain proper distances with unit bond
# length.
scale sqrt(3) 3.0 sqrt(3)
# Scale by desired bond length.
scale A0
# Write particle and cor file.
write particle
write cor nanotube.cor