Tools

Contents
Introduction
Program chiral
Manipulation tools
How to use the tools
Custom manipulations
Examples
Installation

Introduction

The tools consist of

  1. Program chiral which can create nanotubes of a given chiral vector. For creation of multi-wall nanotubes, it has the capability of searching for tubes of a desired radius. It can indicate which tubes are length-compatible (which means that they can be put in the same periodic box without straining, assuming the bond length is constant.) It can also merge different coord.d files, or put several copies of a coord.d file into another one.
  2. A set of tools that can do such manipulations as shift and rotate the atom distribution of a coord.d file, change its temperature, time-step, put in Stone-Wales defects, etcetera.
  3. A shell Fortran program custom.f that can be used to perform manipulations not covered by the other tools.

More detailed descriptions and usage instructions are below.

Program chiral

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:

Notes:

Manipulation tools

The following tools manipulate coord.d format files.

chbox
Changes the periodic box size without adding atoms. Usually to do other manipulations without worrying about the box boundaries.
chcg
Centers the center of gravity. Subsequently chshift can be used to move it to another place.
chdelta
Change the time step. Takes care of also correcting the Nordsieck parameters r2, r3, and r4.
chfind
Finds the precise location of atoms, bonds, hexagons, given an approximate location.
chlims
Prints out the atom position limits.
chmult
Increase the period sizes by integer multiples. In other words, compute more periods. This can be used to increase the size of the simulation after killing off transients. In that case, use chtemp to destroy the periodicity in kinetic energy.
chrot
Rotates the atom positions. Often around the z-axis to get a rotated nanotube.
chshift
Shift the atom positions.
chtemp
Sets the temperature to a new value. Resets the now meaningless Nordsieck parameters to 0.
defects
Adds 7557 defects to nanutubes in coord.d files. Currently assumes that the nanotube is centered around the z-axis. Use chshift if necessary to achieve that.
getxyz
Creates an xmol xyz file from a coord.d file.

To merge coord.d files, use program chiral.

How to use the tools

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.)

Custom manipulations

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

Examples

  1. To create bundles of nanotubes:
  2. To put matching Stone-Wales defects in multiwall nanotubes:
  3. To attach functional groups to nanotubes:

Installation

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.


Return