Contents |
---|
Introduction |
Program chiral |
Manipulation tools |
How to use the tools |
Custom manipulations |
Examples |
Installation |
The tools consist of
More detailed descriptions and usage instructions are below.
In this section we describe how to use program chiral.
Startup:
Chiral first asks for the bond length to use. Just hit Return to use the default value or enter a modified value. Next chiral asks for the temperature in K to give the final coord.d file and the time step to put in the coord.d file.
Next chiral prints out a table for which of the nanotubes are "length compatible", which means that periodic multiwall nanotubes can be constructed of them without straining. Tubes marked with the same symbol are length compatible. Note that this is theoretical compatibility: it assumes the tubes are created by wrapping a graphite sheet with a constant bond length into a cylinder. In real life, there will still be internal stresses in the multiwall tube, especially for small tubes.
The table covers chiral vectors n,m in the range 1 ≤ n ≤ 15, 0 ≤ m ≤ n. Note that the m,n tube is the mirror image of the n,m one, so has the same length.
Adding atoms:
Chiral next displays a small menu, with the choices "vec", "rad", "file", "undo", "done", and "quit". We describe these choices in this order:
On entering a valid vector, chiral prints out a few statistics, in particular the number of atoms in each period of the tube.
Next it asks for length and radial stretching factors. These can be used to correct the dimensions for curvature effects and temperature expansion. Hopefully, some day the default will show the true correction factors for the selected tube and temperature; for now the default is one (no stretching.) Chiral prints out the final period length and radius of the nanotube in Angstrom.
Next it asks for any shift or angular rotation around the z (nanotube) axis you want to apply. This allows you to rotate and shift different tubes in a MWNT relative to each other, or create an array of tubes.
Chiral then asks you the chiral vector of the nanotube you want to add, with as default the tube it thinks is the best match from the list. Enter "cancel" not to add a tube. Otherwise, the further procedure is as for the "vec" menu item.
Chiral allows you to put in stretching factors, displacements, and rotations as if it was a nanotube.
After you select this choice, and you have defined only one nanotube or read only a single file, chiral asks how many axial periods you want, i.e. the number of times the defined set is repeated in the z-direction. It also asks how big you want to make the periodic box size in the z-direction. Then it writes the coord.d file and exits.
If, however, you have defined more than one object (nanotube or file data), chiral first checks whether they are length compatible. (Note that varying the length stretching factors destroys length compatibility.) If they are, it tells you how many atoms are in the smallest common period of the tubes, and asks you how many of those common periods you want. It next asks for the periodic box size you want, prints the total number of atoms, and writes the coord.d file.
If the objects are not length compatible, chiral can still try to find multiples of the defined objects that have the least strain, provided that you tell it how many multiples of the longest (in z-direction) object to use. Chiral then adjusts the multiples of the other objects to match that length with approximately minimum strain. (Assuming that the stiffness of the tubes is proportional to their radius.) You can specify a range of multiples of the longest object to try, in order to find a particularly good match in length. It will keep prompting for such ranges until you specify a range of only one possibility, which it takes as acceptance. It then asks whether it should stretch the objects to exactly the same length, asks for the periodic box size, writes the coord.d file and exits.
Notes:
The following tools manipulate coord.d format files.
To merge coord.d files, use program chiral.
Enabling usage:
Here we describe how to enable chiral and the tools on the COE Unix cluster. If you want to use them elsewhere, see the section on installing the tools.
Edit your ".tcshrc" file in your login directory (this is a hidden file) and cut and paste the following lines into this file:
# A command shell to allow input line editing and input line recall alias con_shell '~dommelen/research/nano/lib/con_shell' # Create nanotubes and/or merge coord.d type files alias chiral 'con_shell ~dommelen/research/nano/chiral/chiral2' # Create 7557 defects in tubes around the z-axis alias defects 'con_shell ~dommelen/research/nano/coordmod/defects2' # Extract a plottable xyz file from a coord.d type file alias getxyz 'con_shell ~dommelen/research/nano/coordmod/getxyz2' # Change the periodic box size without adding atoms alias chbox 'con_shell ~dommelen/research/nano/coordmod/chbox2' # Center the center of gravity alias chcg 'con_shell ~dommelen/research/nano/coordmod/chcg2' # change time step and correct the Norsieck parameters correspondingly alias chdelta 'con_shell ~dommelen/research/nano/coordmod/chdelta2' # find atoms, bond, hexagons alias chfind 'con_shell ~dommelen/research/nano/coordmod/chfind2' # Print out the atom position limits alias chlims 'con_shell ~dommelen/research/nano/coordmod/chlims2' # Increase the period sizes by integer multiples alias chmult 'con_shell ~dommelen/research/nano/coordmod/chmult2' # Rotates the atom positions alias chrot 'con_shell ~dommelen/research/nano/coordmod/chrot2' # Shift the atom positions alias chshift 'con_shell ~dommelen/research/nano/coordmod/chshift2' # Set the temperature to a new value alias chtemp 'con_shell ~dommelen/research/nano/coordmod/chtemp2'Now log out and in again. Commands chiral, defects, ... should work.
Log file:
All programs keep a log file of all screen output. For example, 'chiral' keeps log file 'chiral.log'. If you are wondering if you made a mistake, or forgot to write some result down, look at 'chiral.log'.
Error recovery
If you did make a mistake, and you do not want to retype everything, exit, copy 'chiral.log' into recovery file 'chiral.rcv' and edit that file to correct your mistake. When running 'chiral' again, it will see the recovery file and take its input from there, instead of from the keyboard. Delete the .rcv file afterwards.
Repeated use
If you need to run one of the program repeatedly, and each time provide similar inputs, you could use a procedure similar to the error recovery above: edit the .rcv file to only retype the variables that change.
Batch use
You could, with some care, write your own program to create .rcv files, and thus run the programs noninteractively.
Command line parameters
If you are running the same tool multiple times, I recommend providing the first few inputs on the command line. For example, 'defects coord.d coord2.d y' to run 'defects' and set the input file to coord.d, the output file to coord2.d and confirm overwrite. The next time you run 'defects', retrieve the command line using the up cursor key, and you won't have to retype the file names again. (Note: this may not work for all installations of the tools.)
Line editing
The cursor keys also work inside the programs to correct input errors and recall earlier inputs. Many queries have a default that you can accept by simply hitting Return, or that disappear automatically as soon as you type something. (Note: this may not work the same way for all installations of the tools.)
If the tools do not cover the manipulations you want to do with a coord.d file, you will have to write your own Fortran program. The file custom.f is a good place to start; it is a shell program that is already set up to read in and write out a coord.d file. Just add your custom manipulations to this file and compile it. You can comment away the call to subroutine 'coordg' if no input file is to be read.
The easiest is to use the custom.f file on the COE Unix cluster.
(If you want to use it elsewhere, refer to the section on
installing the tools.) On the COE Unix cluster,
simply copy it over from Leon:
cp ~dommelen/research/nano/coordmod/custom.f .
Edit the file to perform the desired task. Then compile it using the
command:
make -f ~dommelen/research/nano/coordmod/makefile
This will create an executable 'custom' in your own directory.
If you want an executable with line editing, append ' custom2'
to the above line This one must be run through con_shell, as:
con_shell custom2
If you want to use the tools elsewhere than on the COE Unix cluster, you will need to install them. If you do not have a Fortran compiler because you are on M$ Windows, there is a free one at Open Watcom. You also need the ranlib library from netlib.org or provide your own random number generator.
Next you will need to get the Windows source files or unix source files. Unzip them, making sure to preserve the directory structure in the zip file. On Unix, use 'unzip -a'. Subdirectories chiral, coordmod, util, and lib will be created. For various MS Windows compilers, you will have to rename the various .f files into .for files.
In directory lib, you need to compile lib.f, one args... file, and one con... file into object files. Safe choices for the last two are argsgen.f and congen.f, but if you want to enable nice features such as command line variables and line editing, select one targetted to your operating system and compiler. If using Watcom, select argswat.for, conwat.for and conwat2.c. If your compiler does not have a build-in exit subroutine, also compile exitgen.f.
In directory util, compile all .f files into object files.
In directory coordmod look at the Unix makefile to see how to create the individual tools. Tool names that end in a "2" are compiled to allow command line arguments and line editing; the ones without are generic versions suitable for most any compiler. For tools that use the random number generator, replace lib/ranlib.a with the library in which you put the compiled ranlib files, or link in all the individually compiled ranlib files.
Create the chiral tool in directory chiral the same way.
If you compiled for command line editing on Unix, you need to disable the terminal I/O system from messing up your screen. You do that by running the executables through con_shell in the lib directory, eg, 'lib/con_shell chiral/chiral2'.
Verified installation instructions for Sun and Linux are here.