| 1 |
import "graphene.lt" |
| 2 |
|
| 3 |
# The "Graphene" unit cell defined in "graphene.lt" lies in the XY plane. |
| 4 |
# In the next line, we will create a new version of the graphene unit cell |
| 5 |
# which lies in the XZ plane, by rotating Graphene 90 degrees around the X axis: |
| 6 |
|
| 7 |
GrapheneXZ = Graphene.rot(90,1,0,0) |
| 8 |
|
| 9 |
# ------------------ nanotube --------------- |
| 10 |
|
| 11 |
# Now use this to build a simple ("zigzag") nanotube where the long-axis of each |
| 12 |
# hexagon is aligned with the tube axis (along the Z direction). If the |
| 13 |
# cicumference of a "zigzag" nanotube contains N hexagons, then the radius of |
| 14 |
# the tube, R=(W/4)/tan((2*pi)/(4*N)), where W=2*d*sqrt(3)/2, and d = the carbon |
| 15 |
# bond length. If N=14 and d=1.42 Ansgroms then R=5.457193512764 Angstroms |
| 16 |
# In the Joly 2011 paper, the tube radii varied between 5.14 and 18.7 Angstroms. |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
nanotube = new GrapheneXZ.move(0, 5.457193512764, 0) # 5.45 = R |
| 21 |
[14].rot(25.7142857,0,0,1) #25.7=360/14 |
| 22 |
[12].rot(12.8571429,0,0,1).move(0, 0, 2.13) #12.9=180/14 |
| 23 |
#2.13= d*1.5 |
| 24 |
|
| 25 |
|
| 26 |
# Note: The length is 12 hexagons, the circumference is |
| 27 |
# 14 hexagons (~=25.56 and 34.43 Angstroms, respectively). |
| 28 |
|
| 29 |
|
| 30 |
# Move all of the unit-cells in the nanotube between the two graphene sheets. |
| 31 |
|
| 32 |
nanotube[*][*].move(0, 0, 33.42) |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
# ---------- BUILDING CHIRAL NANOTUBES USING EXTERNAL SOFTWARE ------------- |
| 39 |
# |
| 40 |
# The approach shown here works well for "zig-zag" nanotubes. |
| 41 |
# Nanotubes with other chiralities are more difficult to make this way |
| 42 |
# (because the tube axis is no longer perpendicular to graphene basis vectors). |
| 43 |
# For those nanotubes, I recommend using an external program to generate |
| 44 |
# a LAMMPS data file for the nanotube. If you want to combine the tube |
| 45 |
# with other molecules created by moltemplate, you can then import it into |
| 46 |
# moltemplate as a molecule object using the "ltemplify.py" utility. Details: |
| 47 |
# |
| 48 |
# --- VMD plugins (by Axel Kohlmeyer and Robert R. Johnson) --- |
| 49 |
# |
| 50 |
# The nanotube-builder for VMD can generate nanotubes (with smooth tips) |
| 51 |
# for any chirality. These tubes also have explicit bonds between carbons: |
| 52 |
# http://www.ks.uiuc.edu/Research/vmd/plugins/nanotube/ |
| 53 |
# |
| 54 |
# The resulting nanotube can be converted to a data file using topotools: |
| 55 |
# https://sites.google.com/site/akohlmey/software/topotools |
| 56 |
# To do that, select the "Extensions"->"Tk Console" menu and enter |
| 57 |
# |
| 58 |
# topo writelammpsdata nanotube.data full |
| 59 |
# |
| 60 |
# --- ltemplify.py --- |
| 61 |
# |
| 62 |
# That data file can be converted to moltemplate format (an .LT file) |
| 63 |
# using the "ltemplify.py" utility. |
| 64 |
# |
| 65 |
# The first step is to create a short input script containing the atom_style |
| 66 |
# command (ltemplify.py will read this script. Presumably atom_style is "full"). |
| 67 |
# |
| 68 |
# echo "atom_style full" > nanotube.in |
| 69 |
# |
| 70 |
# Then run ltemplify to convert nanotube.data into a moltemplate file: |
| 71 |
# ltemplify.py -name Nanotube nanotube.in nanotube.data > nanotube.lt |
| 72 |
# |
| 73 |
# You will need to edit the "nanotube.lt" file to replace all of the |
| 74 |
# "@atom:type1" atoms types file to match the carbon atom types in the other lt |
| 75 |
# files (ie "@atom:../C"). If you don't plan on defining bonded interactions |
| 76 |
# between carbon atoms, then be sure to remove the write("Data Bonds") section |
| 77 |
# of the "nanotube.lt" file (if it is present). |
| 78 |
# |
| 79 |
# Finally make sure the "system.lt" contains these lines: |
| 80 |
# |
| 81 |
# import "nanotube.lt" |
| 82 |
# nanotube = new Nanotube.move(?,?,?) |
| 83 |
# |
| 84 |
# (Replace ?,?,? with the location where you want the nanotube to go. |
| 85 |
# You can also rotate it using .rot(angle,axisx,axisy,axiz).) |
| 86 |
# |
| 87 |
# ... and then run moltemplate the normal way |
| 88 |
# |
| 89 |
# Let me know if you run into trouble with this approach, |
| 90 |
# and I will make note of that in this file. |
| 91 |
# |
| 92 |
# --- links --- |
| 93 |
# Note: there are numerous programs for specifying the coordinates |
| 94 |
# of the atoms in a nanotube, some of which are below. |
| 95 |
# http://www.nanotube.msu.edu/tubeASP/ |
| 96 |
# http://turin.nss.udel.edu/research/tubegenonline.html |
| 97 |
# http://www.ugr.es/~gmdm/java/contub/contub.html |
| 98 |
# (You can load coordinates into moltemplate using the "-xyz" or "-pdb" |
| 99 |
# arguments. However currently (2013-12-01), the file must contain coordinates |
| 100 |
# for all of the atoms in your sytem, not just the nanotube.) |
| 101 |
# ------------------------------------------------------------------------- |