%%%%%%%%%%%%%%% -*-LATEX-*- %%%%%%%%%%%%%%%%%%
%% Creation Date : Sun Oct 31 21:59:48 1999
%% Last Modified : Tue Oct 30 18:04:46 2001
%% File : md++manual_01.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[10pt,graphicx]{article} %article report book letter

\setlength{\textwidth}{6.5in}
\setlength{\textheight}{9.in}
\setlength{\oddsidemargin}{0in}
\setlength{\topmargin}{0in}
\setlength{\headsep}{0pt}
\setlength{\headheight}{0pt}
\newcommand{\degrees}{\hbox{$\,^\circ\sf $}}
\font\normal=cmr12
\newcommand{\st}{\sin\theta}
\newcommand{\ct}{\cos\theta}
\newcommand{\bn}{b_{n1}}
\newcommand{\bs}{b_{s1}}
\newcommand{\be}{b_{e1}}
\newcommand{\bx}{b_{x2}}
\newcommand{\by}{b_{y2}}
\newcommand{\bz}{b_{z2}}
\newcommand{\bm}{\boldmath}
\newcommand{\mb}{\mbox}
\def\bib{ \bibitem}
\pagestyle{plain}

\newcommand{\Dt}{\Delta t}
\newcommand{\vr}{\vec{r}}
\newcommand{\vv}{\vec{v}}
\newcommand{\vA}{\vec{A}}
\newcommand{\home}{$\sim$}
\newcommand{\myheading}[1]{\hspace{0in}\\{\bf #1}}
\addtolength{\topmargin}{0.6in}

\newcommand{\attention}{\hspace{0in}\\ {\bf \large (Attention !!)}\\}
\newcommand{\question}{\hspace{0in}\\ {\bf \large (Question ??)}\\}

\usepackage{graphicx}

\author{Wei Cai\\
Lawrence Livermore National Laboratory \\
7000 East Avenue, Livermore, CA 94550,USA \\
caiwei@llnl.gov, (925) 424-5443 }

\title{MD++ User's Manual}
\date{\today}

\begin{document}
\maketitle

%\newpage

\tableofcontents




















\newpage

\section{Overview}

%\myheading{Origin}

MD++ is a Molecular Dynamics (MD) simulation package written in C++.
I started developing it at around 1999 or so, when I was a graduate
student at MIT, Department of Nuclear Engineering.  The computational
part of this package was based on Fortran 77 codes by my mentor and
colleague Vasily Bulatov, then at MIT Department of Mechanical
Engineering.  The Fortran codes were later modified by my colleague
Jinpeng (Elton) Chang, and are included in this package as well.
Several fundamental C++ objects in MD++ were written by or
adapted from the codes of my colleague Dongyi Liao.

%\myheading{Intention}

My intention to develop MD++ was to make atomistic simulations easier
to set up, visualize, and control, which means, more fun.  The
simulations I had in mind were largely for defect in solids. But there
is no reason that we can't use it to study liquids or gas.  MD++ uses
empirical potential models and is best applicable to systems with a
moderate number of atoms, i.e. from a few thousand to a few hundred
thousand atoms.  It was recently parallelized by using shared memory,
but it is not intended to be a massively parallel code.  MD++ is most
useful for setting up moderate size simulations (a few thousand
atoms), and running them interactively on a workstation.  The idea is
to gain as much intuition as possible by running these simulation
interactively and watching the dances of the atoms and defects on the
screen, before we go ahead to huge simulations which require
super-computing.

%\myheading{My clients}

I had my first enthusiastic client when I joined the Lawrence
Livermore National Lab (LLNL) and worked with Vasily (again).
Apparently Vasily was having much fun with MD++, creating dislocation
junctions and driving them around, and probably missed a few meals
when doing that.  Vasily recommend it to my new colleagues so that by
now I already have a handful of clients, which made me confident
enough to start writing up this manual.

%\myheading{What MD++ is good at}

MD++ uses an old (but very robust) relaxation subroutine to do static
calculations, and uses standard integration scheme and
temperature-stress controls for dynamics simulations.  There is not
much to boast about in those regards.  What's special about MD++ lies
in its treatment of the simulations' input and output, i.e. the
interface between a dumb computer and an impatient physicist.

%\myheading{Input and output}
\begin{itemize}

\item With MD++ we can open an {\it X-window} and view the dynamics of
atoms interactively during a simulation.

\item The input files -- the {\it scripts} -- for MD++ are in a free
format.  The script files not only set values for internal variables,
they also tell MD++ what to do.  In fact the only thing that MD++
executables do is to parse the given script file, which will then ask
MD++ to create and manipulate atomistic configurations, relax or run
Molecular Dynamics with them, or simply quit.  What MD++ provides us
is an environment for atomistic simulations, something like Matlab for
general technical computing, although this analogy is rather
disproportionate.

\end{itemize}

%\myheading{Growing MD++}

Since the source codes only tell MD++ {\it how} to do things, but not
{\it what} to do, MD++ is an object that has a natural tendency to
grow, and it does.  Whenever a new capability is developed in MD++,
such as creating a new defect structure, or using a new boundary
condition, we can use it by calling it from the script file, and can
turn it off by simply commenting it out.  Old scripts which does not
involve the new capability still runs the same as before.  Therefore
if you find MD++ is helpful to you, you can also contribute to its
growth, by either suggesting some capabilities that you want MD++ to
have, or help implement them.

%\myheading{3 ways to use MD++}

There are 3 ways to use MD++.
\begin{itemize}
\item The first one is to {\it use it as it is}.  You can compose your
own scripts to manipulate atoms with the functions that MD++
provides.  If you find that MD++ does save you time in helping you
finding the answer you want, or simply gives you some more fun in
atomistic simulations, and that the time you spend in porting and
learning MD++ is worthwhile, please drop me a note --- I would be
happy to hear that.

\item You can also {\it build on top of MD++}.  If you find that MD++
provides a useful environment for you but you also need some more
functions that it doesn't have, you can declare a new object
that {\it inherits} the objects implemented in MD++, such as {\tt
MDFrame}.  In this way, you inherit all the existing functions
and you are free to add whatever new stuff you like without worrying
about disturbing MD++ itself.

\item You are also encouraged to take pieces of MD++, such as the {\it
script parser} and the {\it X-window} display, and apply them to your
own code developments if you see fit, provided that you give
appropriate acknowledgments.  These two functions are written
as C++ objects and should be rather easy to port if you are using C++
or C.

\end{itemize}

This MD++ manual mainly describes how to {\it use it as it is}.  I
will briefly mention the structure of the code (in Section 3), just to
help explain the meaning of the functions and control variables in the
scripts (in Section 4).























%\newpage

\section{How to Use: An Example}

\subsection{To Build}

Let's get started.  Supposed you obtain an MD++ package, say {\tt
md++-10-19-2001.tar.gz}.  Let's take a quick look at how to use it,
through a short example.

First, let's unpack it in the {\tt \home/Codes} directory.  If you don't
have {\tt Codes} directory under your home directory, you can create
one.  This is preferable because some example script files assumes it
is in the {\tt \home/Codes/MD++} directory.  So, let's say that you unpack
it by typing the following.
\begin{verbatim}
 cd
 mkdir Codes
 cd Codes
 gzip -cd ~/md++-10-10-2001.tar.gz | tar xvf -
\end{verbatim}
This will create a sub-directory {\tt MD++} in your {\tt \home/Codes}
directory.  Within {\tt MD++}, there should be the source files such
as {\tt md.h}, {\tt md.cpp} etc, and some sub-directories.  In this
section, we will run MD++ with some example script files from the {\tt
Examples} sub-directory.  Now we need to build the executables from the
source.  Simply type,
\begin{verbatim}
 cd MD++
 gmake
\end{verbatim}
This will use {\tt gcc} to compile the C++ codes and {\tt f77} to
compile the companion Fortran codes in sub-directories such as {\tt
F90FS}, {\tt F90SW}, etc.  The compilation process can be horrifying
if you hate to see tons of warning messages --- but you can simply
ignore them.  If by the end of this we get new files such as {\tt
moscrew\_gcc}, {\tt siscrew\_gcc}, {\tt eam\_gcc}, then we have been
successful so far.  {\tt Gcc} is a very generic compiler and we have
successfully built MD++ on several machine architectures such as Linux
PC, SGI and Dec/Alpha.  Please let me know if you have problem
building MD++ on your machine.

We should also get executables such as {\tt Relax} in Fortran
sub-directories such as {\tt F90FS}.  If your Fortran compiler is not
{\tt f77}, such as in Linux alpha which uses {\tt fort}, you can
simply go into the Fortran sub-directories and modify the {\tt
Makefile} within them.  These executables can be called within MD++ to
provide a faster energy minimization than the build-in relaxation
functions --- Fortran codes are generally faster than C++ codes ---
but they are not essential.



\subsection{To Use}

Let's try to run MD++ from an example script file.  Type
\begin{verbatim}
 ./moscrew_gcc Examples/example01-mo.script
\end{verbatim}
This will run the given script file using the MD++ executable compiled
with Finnis-Sinclair potential for BCC Mo.

\hspace{0in}\\
$[$ Note: MD++ does not run properly on {\bf zamora} (one of our Linux
Alpha machines), due to its inadequate compiler configurations.  We
can still run this example on {\bf zamora} though, by calling the
Fortran code to do relaxation (see below), instead of using the native
relaxation subroutines of MD++.  However, for the Fortran code to
behave properly, we need to use {\tt fort} instead of {\tt f77} to
compile.  This can be done by changing the line {\tt F77 = f77} into
{\tt F77=fort} in {\tt F90FS/Makefile}, {\tt F90SW/Makefile} and {\tt
F90EAM/Makefile}. $]$

After you initiate the command above, a window will pop up, showing a
BCC lattice of Mo atoms, containing a screw dislocation dipole.  The
high energy atoms are highlighted.  MD++ then starts to relax this
configuration, with intermediate energy information dumped on your
terminal.  As the relaxation proceeds, you will notice the pattern of
high energy atoms also changes.  At any point of the simulation, you
can use your mouse to rotate the atomistic configuration in the
X-window using your mouse (see Section~\ref{xwin}).  When the
relaxation completes, the high energy atoms around the two screw
dislocation cores exhibit a 3-fold dissociation pattern.  The total
energy of this configuration can be found on your terminal,
\begin{verbatim}
EPOT=-3.10591268138509e+04
\end{verbatim}
in unit of electron-volts (eV).  Relevant data files for this
simulation is written into a sub-directory {\tt runs/tmp}, as specified
at the beginning of the script file.  Fig.~\ref{fig:ex01} shows two
snapshots of the relaxed configuration from two viewing angles.  (To
take gif and postscript snapshots from X-window display, see
Section~\ref{xwin}.)
\begin{figure}
\begin{center}
  \includegraphics[width=2.5in]{figs/ex01a} \hspace{0.2in}
  \includegraphics[width=2.5in]{figs/ex01b} \\
\hspace{0.2in}(a)\hspace{2.5in}(b)
\label{fig:ex01}  
\caption{Snapshots from two viewing angles of the relaxed
configuration after running {\tt Examples/example01-mo.script}.  }
\end{center}
\end{figure}

\subsection{A Closer Look at the Script File}

The script file that we just run is reproduced below.  In this section
we briefly discuss its meaning and how it does the job that we just
see.  Note that in the script everything between {\tt \#} sign and the
end of the line is comment and has no effect at all.

\hspace{0in}\\
{\tt Examples/example01-mo.script} :

\begin{verbatim}
setnolog
setoverwrite
dirname = runs/tmp
shmsize = 31457280 shmallocate #10MB
#------------------------------------------------------------
#Read in potential file
#
potfile = ~/Codes/MD++/mo_pot readpot
#------------------------------------------------------------
#Create Perfect Lattice Configuration
#
latticestructure = body-centered-cubic latticeconst = 3.1472 #(A) for Mo
makecnspec = [  1   1  -2   8    #for screw [111]
                1  -1   0   19
                0.5   0.5   0.5   5 ]
makecn finalcnfile = perf.cn writecn                
#-------------------------------------------------------------
#Create Dislocation Dipole
#(screw) [111]
mkdipole = [ 3 2 #z(dislocation line), y(dipole direction)
             0 0 0.2 #(burgers vector relative to box)
             0 -0.2632  0.2368 #Y=18 d=0.5  (b)
             0.305 #\nu
             -10 10 -10 10 1  #number of images
             0 0 0 0 ]
makedipole finalcnfile = makedp.cn writecn
#-------------------------------------------------------------
#Plot Configuration
atomradius = 1.0 bondradius = 0.3 bondlength = 0
atomcolor = cyan highlightcolor = purple backgroundcolor = gray
bondcolor = red fixatomcolor = yellow
#hideatomenergy = [ 1 -6.725 -6 ]
highlightenergy = [ 1 -6.72 ]
#energycolorbar = [ 1 -6.8 -6.55 ]  highlightcolor = red
plot_select = 5 plot_highlight = [ 0 0 1 2 3 4 5 6 7 8 9 ]
plotfreq = 10 
rotateangles = [ 0 0 0 1.5 ]
win_width = 600 win_height = 600
openwin alloccolors rotate saverot refreshnnlist eval plot
#sleep quit
#-------------------------------------------------------------
#Conjugate-Gradient relaxation
conj_ftol = 1e-7 conj_fevalmax = 1000
conj_fixbox = 1 
relax finalcnfile = relaxed.cn writecn
sleep quit
#-------------------------------------------------------------
#Fortran Conjugate-Gradient relaxation
#
fortranpath = ~/Codes/MD++/F90FS potfile = Mo.pot fortranexe = Relax
conj_fixbox = 1  #stress is meaningful only if allow box to relax
#stress = [ 0 100 0
#           100 0 0
#           0 0 0 ] #(stress in MPa)
fortranrelax eval plot
sleep quit
\end{verbatim}




The first three lines in the script file are mandatory, they describe
to MD++ whether and where to put the log files that will be generated
by the simulation (see Section~\ref{log} for more details).  The first
two lines can be commented out (by putting a {\tt \#} at the line
beginning), but the line {\tt dirname = ...} cannot.  It specifies the
name of the sub-directory where MD++ will store its log files for this
simulation.  Line {\tt shmsize = ...} has no effect if the code is
compiled in serial mode ({\tt GEN+= -DMPLIB\_SINGLE} is defined in
{\tt Makefile}).  This line initiates the shared memory block if the
code is compile to run in parallel.

As MD++ continues to parse through the script, it sets the variable
{\tt potfile} (a character string) to the supplied file name.  Command
{\tt readpot} then asks MD++ to read the inter-atomic potential from
this file.

The next command that MD++ executes is {\tt makecn}, which will create
a perfect lattice, under the specification that is given by the
variables before it.  Here, we are making a BCC lattice with a lattice
constant $3.1472\AA$.  The three dimensions of the simulation cell are
$X=[11\overline{2}]\times8$, $Y=[1\overline{1}0]\times19$,
$Z=\frac{1}{2}[111]\times5$, respectively.  This configuration is
saved by calling {\tt writecn}, into a file named {\tt perf.cn} (in
sub-directory {\tt runs/tmp}), as specified by the variable {\tt
finalcnfile}.

The script then proceeds to create a screw dislocation dipole in the
cell, by calling {\tt makedipole}.  Here I want to defer the detailed
explanation of the parameter {\tt mkdipole} to Section~\ref{mkdipole},
and simply point out that with the current setting, the two
dislocations will be along $z$ direction, with Burgers vector
$\pm\frac{1}{2}[111]$, and located at (in reduced coordinates)
$(0,-0.2632)$ and $(0,0.2368)$ respectively, as illustrated in
Fig.~\ref{fig:dip01}.
\begin{figure}
\begin{center}
  \includegraphics[width=2in]{figs/dip01}
\label{fig:dip01}  
\caption{The geometry of the dipole created by {\tt
Examples/example01-mo.script}. The coordinates within the simulation
cell goes from $-0.5$ to $+0.5$.}
\end{center}
\end{figure}
The configuration file which contains the newly created dislocation
dipole is then saved into file {\tt makedp.cn}.  


The line {\tt openwin alloccolors ... plot} opens an X-window and plot
the current configurations.  The lines above it specifies the style of
plotting.  More details will be given in Section~\ref{xwin}.  Here I
just want to point out that, with line {\tt highlightenergy = [ 1
-6.72 ]}, atoms with local energy above -6.72eV will be highlighted.
As a reference, the energy per atom in the perfect BCC lattice for
this potential is -6.82eV.  

Line {\tt relax ... writecn} then performs energy minimization on the
structure it just created using a conjugate gradient algorithm.  The
relaxation will end when the residual gradient becomes smaller than
$1e-7$ ({\tt conj\_ftol}) or the maximum number of force evaluations
becomes larger than $1000$ ({\tt conj\_fevalmax}).  The simulation box
is not allowed to respond ({\tt conj\_fixbox = 1}) during the
relaxation.  The plot of atomistic configuration will be refreshed
every $10$ relaxation steps, as specified by {\tt plotfreq = 10}.

After relaxation, the configuration is saved in {\tt relaxed.cn} and
the code sleeps (for 100 seconds) before it quits, so that you can
look at the relaxed structure.  Press {\tt ctrl-c} in the terminal if
you want to quit earlier.

We can modify this script to let it do other things.  For example, we
can comment out the two lines {\tt relax ... writecn} and {\tt sleep
quit}.  Then the code will proceed to line {\tt fortranrelax ... },
which calls the Fortran code to perform the relaxation.  This will be
faster than the C++ relaxation subroutine, but you won't be able to
see the change of atomic configurations during the relaxation.  The
atomic configuration will be loaded when the Fortran relaxation
completes, and {\tt eval plot} will then update the local atomic
energy and refresh the X-window display.



















 






%\newpage

\section{Code Structure}

MD++ code structure is illustrated in Fig.~\ref{fig:codestr}.  The
strings in the boxes represent C++ objects (classes) and the arrows
indicate their inter-dependence.  The basic object {\tt MDFrame}
inherits {\tt SCParser} for parsing script files, and contains a {\tt
YWindow} object as a member to plot atom configurations.  {\tt
MDFrame} contains the essential variables (such as atom positions) and
functions (such as conjugate gradient relaxation) to perform static
and dynamic simulations, but it has an empty inter-atomic potential.
{\tt SIFrame}, {\tt MOFrame}, {\tt EAMFrame} all inherit {\tt MDFrame}
and implement their own potentials --- Stillinger-Weber for Si,
Finnis-Sinclair for Mo, and EAM potential for FCC metals.  {\tt
SIScrewFrame} and {\tt MOScrewFrame} builds on top of {\tt SIFrame}
and {\tt MOFrame} respectively, and add more functions to faciliate
simulation of screw dislocations.
\begin{figure}
\begin{center}
  \includegraphics[width=5in]{figs/codestr}
\label{fig:codestr}  
\caption{MD++ code structure.}
\end{center}
\end{figure}

For each inheritance, the child (e.g. {\tt SIFrame}) executable
recognizes all the variables and functions that the parent {\tt
MDFrame} implemented.  Because most of the functions are implemented in
{\tt MDFrame}, they are available to all of its children executables.













































\newpage

\section{Control Variables and Functions}

%grep bindvar md.cpp | sed -e 's/^[^"]*"\([^"]*\)"[^$]*$/\1 \&p.\\ref\{var:\1\}\\\\/' | sed -e 's/\_/\\\_/' |sort>Doc/allvar.tex
%grep bindcommand md.cpp | sed -e 's/^[^"]*"\([^"]*\)"[^$]*$/\1 \&p.\\ref\{com:\1\}\\\\/' | sed -e 's/\_/\\\_/' |sort>Doc/allcom.tex

\subsection{List of Control Variables and Functions}
\begin{table}[h]
\caption{List of all control variables in {\tt MDFrame}, in
alphabetical order.  For detailed explanations, go to the
corresponding section.}
\label{tab:var}
\begin{center}
\begin{tabular}{|l|l|}\hline
%insert here allvar.tex
%\input{allvar}
allocmultiple &Sec.\ref{var:allocmultiple}\\
applyshear &Sec.\ref{var:applyshear}\\
atomcolor &Sec.\ref{var:atomcolor}\\
atommass &Sec.\ref{var:atommass}\\
atomradius &Sec.\ref{var:atomradius}\\
atomTcpl &Sec.\ref{var:atomTcpl}\\
autowritegiffreq &Sec.\ref{var:autowritegiffreq}\\
backgroundcolor &Sec.\ref{var:backgroundcolor}\\
basisatoms &Sec.\ref{var:basisatoms}\\
bondcolor &Sec.\ref{var:bondcolor}\\
bondlength &Sec.\ref{var:bondlength}\\
bondradius &Sec.\ref{var:bondradius}\\
boxTcpl &Sec.\ref{var:boxTcpl}\\
calphonondispspec &Sec.\ref{var:calphonondispspec}\\
command &Sec.\ref{var:command}\\
conj\_dfpred &Sec.\ref{var:conj_dfpred}\\
conj\_fevalmax &Sec.\ref{var:conj_fevalmax}\\
conj\_fixbox &Sec.\ref{var:conj_fixbox}\\
conj\_fixshape &Sec.\ref{var:conj_fixshape}\\
conj\_ftol &Sec.\ref{var:conj_ftol}\\
conj\_itmax &Sec.\ref{var:conj_itmax}\\
cutpastecnspec &Sec.\ref{var:cutpastecnspec}\\
dirname &Sec.\ref{var:dirname}\\
DOUBLE\_T &Sec.\ref{var:DOUBLE_T}\\
energycolorbar &Sec.\ref{var:energycolorbar}\\
equilsteps &Sec.\ref{var:equilsteps}\\
extendboxspec &Sec.\ref{var:extendboxspec}\\
finalcnfile &Sec.\ref{var:finalcnfile}\\
fixatomcolor &Sec.\ref{var:fixatomcolor}\\
fixedatomenergypartition &Sec.\ref{var:fixedatomenergypartition}\\
\hline\end{tabular}\hspace{0.2in}
\begin{tabular}{|l|l|}\hline
fortranexe &Sec.\ref{var:fortranexe}\\
fortranpath &Sec.\ref{var:fortranpath}\\
hideatomenergy &Sec.\ref{var:hideatomenergy}\\
hidetopology &Sec.\ref{var:hidetopology}\\
highlightcolor &Sec.\ref{var:highlightcolor}\\
highlightenergy &Sec.\ref{var:highlightenergy}\\
hrescale &Sec.\ref{var:hrescale}\\
incnfile &Sec.\ref{var:incnfile}\\
intercnfile &Sec.\ref{var:intercnfile}\\
latticeconst &Sec.\ref{var:latticeconst}\\
latticestructure &Sec.\ref{var:latticestructure}\\
makecnspec &Sec.\ref{var:makecnspec}\\
MDCASKpot &Sec.\ref{var:MDCASKpot}\\
mkcutspec &Sec.\ref{var:mkcutspec}\\
mkdipole &Sec.\ref{var:mkdipole}\\
mkgbspec &Sec.\ref{var:mkgbspec}\\
moveatomspec &Sec.\ref{var:moveatomspec}\\
ncpu &Sec.\ref{var:ncpu}\\
outpropfile &Sec.\ref{var:outpropfile}\\
perfcnfile &Sec.\ref{var:perfcnfile}\\
phonondispfile &Sec.\ref{var:phonondispfile}\\
pickfixedatomspec &Sec.\ref{var:pickfixedatomspec}\\
plotfreq &Sec.\ref{var:plotfreq}\\
plot\_highlight &Sec.\ref{var:plot_highlight}\\
plot\_restrict &Sec.\ref{var:plot_restrict}\\
plot\_select &Sec.\ref{var:plot_select}\\
plot\_xmax &Sec.\ref{var:plot_xmax}\\
plot\_xmin &Sec.\ref{var:plot_xmin}\\
plot\_ymax &Sec.\ref{var:plot_ymax}\\
plot\_ymin &Sec.\ref{var:plot_ymin}\\
\hline\end{tabular}\hspace{0.2in}
\begin{tabular}{|l|l|}\hline
plot\_zmax &Sec.\ref{var:plot_zmax}\\
plot\_zmin &Sec.\ref{var:plot_zmin}\\
potavgfreq &Sec.\ref{var:potavgfreq}\\
potfile &Sec.\ref{var:potfile}\\
removerc &Sec.\ref{var:removerc}\\
rotateangles &Sec.\ref{var:rotateangles}\\
shmsize &Sec.\ref{var:shmsize}\\
savecnfreq &Sec.\ref{var:savecnfreq}\\
savecn &Sec.\ref{var:savecn}\\
savepropfreq &Sec.\ref{var:savepropfreq}\\
saveprop &Sec.\ref{var:saveprop}\\
scalevelocity &Sec.\ref{var:scalevelocity}\\
shearrate &Sec.\ref{var:shearrate}\\
shiftspec &Sec.\ref{var:shiftspec}\\
showavgpot &Sec.\ref{var:showavgpot}\\
shrinkboxspec &Sec.\ref{var:shrinkboxspec}\\
sleepseconds &Sec.\ref{var:sleepseconds}\\
splicecnspec &Sec.\ref{var:splicecnspec}\\
strainspec &Sec.\ref{var:strainspec}\\
stress &Sec.\ref{var:stress}\\
strrotspec &Sec.\ref{var:strrotspec}\\
timestep &Sec.\ref{var:timestep}\\
T\_OBJ &Sec.\ref{var:T_OBJ}\\
totalsteps &Sec.\ref{var:totalsteps}\\
usenosehoover &Sec.\ref{var:usenosehoover}\\
vt2 &Sec.\ref{var:vt2}\\
win\_height &Sec.\ref{var:win_height}\\
win\_width &Sec.\ref{var:win_width}\\
writeall &Sec.\ref{var:writeall}\\
writevelocity &Sec.\ref{var:writevelocity}\\
\hline\end{tabular}
\end{center}
\end{table}




\begin{table}[h]
\caption{List of all functions in {\tt MDFrame}, in
alphabetical order. For detailed explanations, go to the
corresponding section.}
\label{tab:var}
\begin{center}
\begin{tabular}{|l|l|}\hline
alloccolors &Sec.\ref{com:alloccolors}\\
alloccolorsX &Sec.\ref{com:alloccolorsX}\\
applystrain &Sec.\ref{com:applystrain}\\
calphonondisp &Sec.\ref{com:calphonondisp}\\
cutpastecn &Sec.\ref{com:cutpastecn}\\
cutslice &Sec.\ref{com:cutslice}\\
eval &Sec.\ref{com:eval}\\
extendbox &Sec.\ref{com:extendbox}\\
fortranrelax &Sec.\ref{com:fortranrelax}\\
initvelocity &Sec.\ref{com:initvelocity}\\
makecn &Sec.\ref{com:makecn}\\
makecut &Sec.\ref{com:makecut}\\
makedipole &Sec.\ref{com:makedipole}\\
makegb &Sec.\ref{com:makegb}\\
moveatom &Sec.\ref{com:moveatom}\\
multieval &Sec.\ref{com:multieval}\\
openintercnfile &Sec.\ref{com:openintercnfile}\\
openpropfile &Sec.\ref{com:openpropfile}\\
openwin &Sec.\ref{com:openwin}\\
pickfixedatoms &Sec.\ref{com:pickfixedatoms}\\
plot &Sec.\ref{com:plot}\\
quit &Sec.\ref{com:quit}\\
readcn &Sec.\ref{com:readcn}\\
readMDCASK &Sec.\ref{com:readMDCASK}\\
readPOSCAR &Sec.\ref{com:readPOSCAR}\\
redefinepbc &Sec.\ref{com:redefinepbc}\\
\hline\end{tabular}\hspace{1.2in}
\begin{tabular}{|l|l|}\hline
refreshnnlist &Sec.\ref{com:refreshnnlist}\\
relax &Sec.\ref{com:relax}\\
removeextraatoms &Sec.\ref{com:removeextraatoms}\\
removepickedatoms &Sec.\ref{com:removepickedatoms}\\
replacenonfixatom &Sec.\ref{com:replacenonfixatom}\\
restoreH &Sec.\ref{com:restoreH}\\
reversergb &Sec.\ref{com:reversergb}\\
rotate &Sec.\ref{com:rotate}\\
runcommand &Sec.\ref{com:runcommand}\\
run &Sec.\ref{com:run}\\
saverot &Sec.\ref{com:saverot}\\
scaleH &Sec.\ref{com:scaleH}\\
setnolog &Sec.\ref{com:setnolog}\\
setoverwrite &Sec.\ref{com:setoverwrite}\\
shiftbox &Sec.\ref{com:shiftbox}\\
shiftpbc &Sec.\ref{com:shiftpbc}\\
shrinkbox &Sec.\ref{com:shrinkbox}\\
sleep &Sec.\ref{com:sleep}\\
splicecn &Sec.\ref{com:splicecn}\\
step &Sec.\ref{com:step}\\
testcolor &Sec.\ref{com:testcolor}\\
wintogglepause &Sec.\ref{com:wintogglepause}\\
writecn &Sec.\ref{com:writecn}\\
writeintercn &Sec.\ref{com:writeintercn}\\
writeMDCASK &Sec.\ref{com:writeMDCASK}\\
writePOSCAR &Sec.\ref{com:writePOSCAR}\\
\hline\end{tabular}
\end{center}
\end{table}




















\newpage

\subsection{Log File and Control}
\label{log}

%%extra variables
dirname\label{var:dirname} 

sleepseconds\label{var:sleepseconds}

%%extra commands
setoverwrite\label{com:setoverwrite}
setnolog\label{com:setnolog}
quit\label{com:quit}
sleep\label{com:sleep}

\subsection{Make Perfect Lattice}
\label{makecn}

allocmultiple\label{var:allocmultiple}
basisatoms\label{var:basisatoms} 

makecn\label{com:makecn}

\subsection{File I/O}
\label{fileio}

%cat allvar2.tex | sed -e 's/\(^[^ \][a-zA-Z\_0-9]*\)/\1\\label\{var:\1}/'

finalcnfile\label{var:finalcnfile}
incnfile\label{var:incnfile}
intercnfile\label{var:intercnfile}

outpropfile\label{var:outpropfile}
perfcnfile\label{var:perfcnfile}
phonondispfile\label{var:phonondispfile}

savecnfreq\label{var:savecnfreq}
savecn\label{var:savecn}
savepropfreq\label{var:savepropfreq}
saveprop\label{var:saveprop}

potfile\label{var:potfile}

writeall\label{var:writeall}
writevelocity\label{var:writevelocity}

openintercnfile\label{com:openintercnfile}
openpropfile\label{com:openpropfile}
readcn\label{com:readcn}
readMDCASK\label{com:readMDCASK}
readPOSCAR\label{com:readPOSCAR}
redefinepbc\label{com:redefinepbc}
writecn\label{com:writecn}
writeintercn\label{com:writeintercn}
writeMDCASK\label{com:writeMDCASK}
writePOSCAR\label{com:writePOSCAR}

\subsection{X-window Display}
\label{xwin}

atomcolor\label{var:atomcolor}
bondcolor\label{var:bondcolor}
atomradius\label{var:atomradius}

autowritegiffreq\label{var:autowritegiffreq}
backgroundcolor\label{var:backgroundcolor}
bondlength\label{var:bondlength}
bondradius\label{var:bondradius}

energycolorbar\label{var:energycolorbar}

fixatomcolor\label{var:fixatomcolor}
fixedatomenergypartition\label{var:fixedatomenergypartition}

hideatomenergy\label{var:hideatomenergy}
hidetopology\label{var:hidetopology}
highlightcolor\label{var:highlightcolor}
highlightenergy\label{var:highlightenergy}

plotfreq\label{var:plotfreq}
plot\_highlight\label{var:plot_highlight}
plot\_restrict\label{var:plot_restrict}
plot\_select\label{var:plot_select}
plot\_xmax\label{var:plot_xmax}
plot\_xmin\label{var:plot_xmin}
plot\_ymax\label{var:plot_ymax}
plot\_ymin\label{var:plot_ymin}
plot\_zmax\label{var:plot_zmax}
plot\_zmin\label{var:plot_zmin}

potavgfreq\label{var:potavgfreq}
rotateangles\label{var:rotateangles}
showavgpot\label{var:showavgpot}

win\_height\label{var:win_height}
win\_width\label{var:win_width}

alloccolors\label{com:alloccolors}
alloccolorsX\label{com:alloccolorsX}
openwin\label{com:openwin}
plot\label{com:plot}
reversergb\label{com:reversergb}
rotate\label{com:rotate}
saverot\label{com:saverot}
testcolor\label{com:testcolor}
wintogglepause\label{com:wintogglepause}

refreshnnlist\label{com:refreshnnlist}
eval\label{com:eval}

\subsection{Structure Manipulation}

applyshear\label{var:applyshear}
cutpastecnspec\label{var:cutpastecnspec}

hrescale\label{var:hrescale}
latticeconst\label{var:latticeconst}
latticestructure\label{var:latticestructure}
makecnspec\label{var:makecnspec}

mkcutspec\label{var:mkcutspec}
mkdipole\label{var:mkdipole}
mkgbspec\label{var:mkgbspec}
moveatomspec\label{var:moveatomspec}

pickfixedatomspec\label{var:pickfixedatomspec}

removerc\label{var:removerc}
shiftspec\label{var:shiftspec}
shrinkboxspec\label{var:shrinkboxspec}
splicecnspec\label{var:splicecnspec}
strainspec\label{var:strainspec}
extendboxspec\label{var:extendboxspec}

mkdipole\label{var:mkdipole}

applystrain\label{com:applystrain}
cutpastecn\label{com:cutpastecn}
cutslice\label{com:cutslice}
extendbox\label{com:extendbox}
makecut\label{com:makecut}
makedipole\label{com:makedipole}
makegb\label{com:makegb}
moveatom\label{com:moveatom}
pickfixedatoms\label{com:pickfixedatoms}
removeextraatoms\label{com:removeextraatoms}
removepickedatoms\label{com:removepickedatoms}
replacenonfixatom\label{com:replacenonfixatom}
restoreH\label{com:restoreH}
scaleH\label{com:scaleH}
shrinkbox\label{com:shrinkbox}
shiftbox\label{com:shiftbox}
shiftpbc\label{com:shiftpbc}
splicecn\label{com:splicecn}

\subsection{Conjugate Gradient Relaxation}

conj\_dfpred\label{var:conj_dfpred}
conj\_fevalmax\label{var:conj_fevalmax}
conj\_fixbox\label{var:conj_fixbox}
conj\_fixshape\label{var:conj_fixshape}
conj\_ftol\label{var:conj_ftol}
conj\_itmax\label{var:conj_itmax}

stress\label{var:stress}
strrotspec\label{var:strrotspec}

multieval\label{com:multieval}
relax\label{com:relax}

\subsection{External Fortran Calls}

command\label{var:command}
fortranexe\label{var:fortranexe}
fortranpath\label{var:fortranpath}

MDCASKpot\label{var:MDCASKpot}

fortranrelax\label{com:fortranrelax}
runcommand\label{com:runcommand}

\subsection{Molecular Dynamics Simulation}

atommass\label{var:atommass}
atomTcpl\label{var:atomTcpl}
boxTcpl\label{var:boxTcpl}

calphonondispspec\label{var:calphonondispspec}

equilsteps\label{var:equilsteps}

DOUBLE\_T\label{var:DOUBLE_T}

scalevelocity\label{var:scalevelocity}
shearrate\label{var:shearrate}

timestep\label{var:timestep}
T\_OBJ\label{var:T_OBJ}
totalsteps\label{var:totalsteps}
usenosehoover\label{var:usenosehoover}
vt2\label{var:vt2}

calphonondisp\label{com:calphonondisp}
initvelocity\label{com:initvelocity}
run\label{com:run}
step\label{com:step}


\subsection{Parallel Execution}

ncpu\label{var:ncpu}
shmsize\label{var:shmsize}

spawn\label{com:spawn}
collect\label{com:collect}
shmallocate\label{com:shmallocate}



%\newpage

\section{More Examples}




\bibliography{md++manual_01}
\bibliographystyle{unsrt}
\end{document}
