ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 3793
Committed: Mon Aug 20 21:03:35 2012 UTC (12 years ago) by skuang
Content type: application/x-tex
File size: 179916 byte(s)
Log Message:
first complete version of RNEMD docs. additional refs and cartoon with
it. plus some other edits.

File Contents

# User Rev Content
1 gezelter 3607 \documentclass[]{book}
2     \usepackage{amssymb}
3     \usepackage{amsmath}
4     \usepackage{times}
5     \usepackage{listings}
6     \usepackage{graphicx}
7     \usepackage{setspace}
8     \usepackage{tabularx}
9     \usepackage{longtable}
10     \pagestyle{plain}
11     \pagenumbering{arabic}
12     \oddsidemargin 0.0cm
13     \evensidemargin 0.0cm
14     \topmargin -21pt
15     \headsep 10pt
16     \textheight 9.0in
17     \textwidth 6.5in
18     \brokenpenalty=10000
19     \renewcommand{\baselinestretch}{1.2}
20 skuang 3793 \usepackage[square, comma, sort&compress]{natbib}
21     \bibpunct{[}{]}{,}{n}{}{;}
22 gezelter 3607
23 skuang 3793
24 gezelter 3607 %\renewcommand\citemid{\ } % no comma in optional reference note
25     \lstset{language=C,frame=TB,basicstyle=\tiny,basicstyle=\ttfamily, %
26     xleftmargin=0.25in, xrightmargin=0.25in,captionpos=b, %
27     abovecaptionskip=0.5cm, belowcaptionskip=0.5cm, escapeinside={~}{~}}
28     \renewcommand{\lstlistingname}{Scheme}
29    
30     \begin{document}
31    
32     \newcolumntype{A}{p{1.5in}}
33     \newcolumntype{B}{p{0.75in}}
34     \newcolumntype{C}{p{1.5in}}
35     \newcolumntype{D}{p{2in}}
36    
37     \newcolumntype{E}{p{0.5in}}
38     \newcolumntype{F}{p{2.25in}}
39     \newcolumntype{G}{p{3in}}
40    
41     \newcolumntype{H}{p{0.75in}}
42     \newcolumntype{I}{p{5in}}
43    
44 gezelter 3792 \newcolumntype{J}{p{1.5in}}
45     \newcolumntype{K}{p{1.2in}}
46     \newcolumntype{L}{p{1.5in}}
47     \newcolumntype{M}{p{1.55in}}
48 gezelter 3607
49 gezelter 3792
50 skuang 3793 \title{{\sc OpenMD-2}: Molecular Dynamics in the Open}
51 gezelter 3607
52 skuang 3793 \author{Shenyu Kuang, Joseph Michalka, Kelsey Stocker, James Marr, \\
53     Teng Lin, Charles F. Vardeman II, Christopher J. Fennell, Xiuquan Sun, \\
54 gezelter 3709 Chunlei Li, Kyle Daily, Yang Zheng, Matthew A. Meineke, and \\
55     J. Daniel Gezelter \\
56     Department of Chemistry and Biochemistry\\
57     University of Notre Dame\\
58     Notre Dame, Indiana 46556}
59 gezelter 3607
60     \maketitle
61    
62     \section*{Preface}
63     {\sc OpenMD} is an open source molecular dynamics engine which is capable of
64     efficiently simulating liquids, proteins, nanoparticles, interfaces,
65     and other complex systems using atom types with orientational degrees
66     of freedom (e.g. ``sticky'' atoms, point dipoles, and coarse-grained
67     assemblies). Proteins, zeolites, lipids, transition metals (bulk, flat
68     interfaces, and nanoparticles) have all been simulated using force
69     fields included with the code. {\sc OpenMD} works on parallel computers
70     using the Message Passing Interface (MPI), and comes with a number of
71     analysis and utility programs that are easy to use and modify. An
72     OpenMD simulation is specified using a very simple meta-data language
73     that is easy to learn.
74    
75     \tableofcontents
76 kstocke1 3708 \listoffigures
77     \listoftables
78 gezelter 3607
79     \mainmatter
80    
81     \chapter{\label{sec:intro}Introduction}
82    
83     There are a number of excellent molecular dynamics packages available
84     to the chemical physics
85     community.\cite{Brooks83,MacKerell98,pearlman:1995,Gromacs,Gromacs3,DL_POLY,Tinker,Paradyn,namd,macromodel}
86     All of these packages are stable, polished programs which solve many
87     problems of interest. Most are now capable of performing molecular
88     dynamics simulations on parallel computers. Some have source code
89     which is freely available to the entire scientific community. Few,
90     however, are capable of efficiently integrating the equations of
91     motion for atom types with orientational degrees of freedom
92     (e.g. point dipoles, and ``sticky'' atoms). And only one of the
93     programs referenced can handle transition metal force fields like the
94     Embedded Atom Method ({\sc eam}). The direction our research program
95     has taken us now involves the use of atoms with orientational degrees
96     of freedom as well as transition metals. Since these simulation
97     methods may be of some use to other researchers, we have decided to
98     release our program (and all related source code) to the scientific
99     community.
100    
101     This document communicates the algorithmic details of our program,
102     {\sc OpenMD}. We have structured this document to first discuss the
103     underlying concepts in this simulation package (Sec.
104     \ref{section:IOfiles}). The empirical energy functions implemented
105     are discussed in Sec.~\ref{section:empiricalEnergy}.
106     Sec.~\ref{section:mechanics} describes the various Molecular Dynamics
107     algorithms {\sc OpenMD} implements in the integration of Hamilton's
108     equations of motion. Program design considerations for parallel
109     computing are presented in Sec.~\ref{section:parallelization}.
110     Concluding remarks are presented in Sec.~\ref{section:conclusion}.
111    
112     \chapter{\label{section:IOfiles}Concepts \& Files}
113    
114     A simulation in {\sc OpenMD} is built using a few fundamental
115     conceptual building blocks most of which are chemically intuitive.
116     The basic unit of a simulation is an {\tt atom}. The parameters
117     describing an {\tt atom} have been generalized to make it as flexible
118     as possible; this means that in addition to translational degrees of
119     freedom, {\tt Atoms} may also have {\it orientational} degrees of freedom.
120    
121     The fundamental (static) properties of {\tt atoms} are defined by the
122     {\tt forceField} chosen for the simulation. The atomic properties
123     specified by a {\tt forceField} might include (but are not limited to)
124     charge, $\sigma$ and $\epsilon$ values for Lennard-Jones interactions,
125     the strength of the dipole moment ($\mu$), the mass, and the moments
126     of inertia. Other more complicated properties of atoms might also be
127     specified by the {\tt forceField}.
128    
129     {\tt Atoms} can be grouped together in many ways. A {\tt rigidBody}
130     contains atoms that exert no forces on one another and which move as a
131     single rigid unit. A {\tt cutoffGroup} may contain atoms which
132     function together as a (rigid {\it or} non-rigid) unit for potential
133     energy calculations,
134     \begin{equation}
135     V_{ab} = s(r_{ab}) \sum_{i \in a} \sum_{j \in b} V_{ij}(r_{ij})
136     \end{equation}
137     Here, $a$ and $b$ are two {\tt cutoffGroups} containing multiple atoms
138     ($a = \left\{i\right\}$ and $b = \left\{j\right\}$). $s(r_{ab})$ is a
139     generalized switching function which insures that the atoms in the two
140     {\tt cutoffGroups} are treated identically as the two groups enter or
141     leave an interaction region.
142    
143     {\tt Atoms} may also be grouped in more traditional ways into {\tt
144     bonds}, {\tt bends}, and {\tt torsions}. These groupings allow the
145     correct choice of interaction parameters for short-range interactions
146     to be chosen from the definitions in the {\tt forceField}.
147    
148     All of these groups of {\tt atoms} are brought together in the {\tt
149     molecule}, which is the fundamental structure for setting up and {\sc
150     OpenMD} simulation. {\tt Molecules} contain lists of {\tt atoms}
151     followed by listings of the other atomic groupings ({\tt bonds}, {\tt
152     bends}, {\tt torsions}, {\tt rigidBodies}, and {\tt cutoffGroups})
153     which relate the atoms to one another. Since a {\tt rigidBody} is a
154     collection of atoms that are propagated in fixed relationships to one
155     another, {\sc OpenMD} uses an internal structure called a {\tt
156     StuntDouble} to store information about those objects that can change
157     position {\it independently} during a simulation. That is, an atom
158     that is part of a rigid body is not itself a StuntDouble. In this
159     case, the rigid body is the StuntDouble. However, an atom that is
160     free to move independently {\it is} its own StuntDouble.
161    
162     Simulations often involve heterogeneous collections of molecules. To
163     specify a mixture of {\tt molecule} types, {\sc OpenMD} uses {\tt
164     components}. Even simulations containing only one type of molecule
165     must specify a single {\tt component}.
166    
167     Starting a simulation requires two types of information: {\it
168     meta-data}, which describes the types of objects present in the
169     simulation, and {\it configuration} information, which describes the
170     initial state of these objects. An {\sc OpenMD} file is a single
171     combined file format that describes both of these kinds of data. An
172     {\sc OpenMD} file contains one {\tt $<$MetaData$>$} block and {\it at least
173     one} {\tt $<$Snapshot$>$} block.
174    
175     The language for the {\tt $<$MetaData$>$} block is a C-based syntax that
176     is parsed at the beginning of the simulation. Configuration
177     information is specified for all {\tt integrableObjects} in a {\tt
178     $<$Snapshot$>$} block. Both the {\tt $<$MetaData$>$} and {\tt $<$Snapshot$>$}
179     formats are described in the following sections.
180    
181     \begin{lstlisting}[float,caption={[The structure of an {\sc OpenMD} file]
182     The basic structure of an {\sc OpenMD} file contains HTML-like tags to
183     define simulation meta-data and subsequent instantaneous configuration
184     information. A well-formed {\sc OpenMD} file must contain one $<$MetaData$>$
185     block and {\it at least one} $<$Snapshot$>$ block. Each
186     $<$Snapshot$>$ is further divided into $<$FrameData$>$ and
187     $<$StuntDoubles$>$ sections.},
188     label=sch:mdFormat]
189     <OpenMD>
190     <MetaData>
191     // see section ~\ref{sec:miscConcepts}~ for details on the formatting
192     // of information contained inside the <MetaData> tags
193     </MetaData>
194     <Snapshot> // An instantaneous configuration
195     <FrameData>
196     // FrameData contains information on the time
197     // stamp, the size of the simulation box, and
198     // the current state of extended system
199     // ensemble variables.
200     </FrameData>
201     <StuntDoubles>
202     // StuntDouble information comprises the
203     // positions, velocities, orientations, and
204     // angular velocities of anything that is
205     // capable of independent motion during
206     // the simulation.
207     </StuntDoubles>
208     </Snapshot>
209     <Snapshot> // Multiple <Snapshot> sections can be
210     </Snapshot> // present in a well-formed OpenMD file
211     <Snapshot> // Further information on <Snapshot> blocks
212     </Snapshot> // can be found in section ~\ref{section:coordFiles}~.
213     </OpenMD>
214     \end{lstlisting}
215    
216    
217     \section{OpenMD Files and $<$MetaData$>$ blocks}
218    
219     {\sc OpenMD} uses a HTML-like syntax to separate {\tt $<$MetaData$>$} and
220     {\tt $<$Snapshot$>$} blocks. A C-based syntax is used to parse the {\tt
221     $<$MetaData$>$} blocks at run time. These blocks allow the user to
222     completely describe the system they wish to simulate, as well as
223     tailor {\sc OpenMD}'s behavior during the simulation. {\sc OpenMD}
224     files are typically denoted with the extension {\tt .md} (which can
225     stand for Meta-Data or Molecular Dynamics or Molecule Definition
226     depending on the user's mood). An overview of an {\sc OpenMD} file is
227     shown in Scheme~\ref{sch:mdFormat} and example file is shown in
228     Scheme~\ref{sch:mdExample}.
229    
230     \begin{lstlisting}[float,caption={[An example of a complete OpenMD
231     file] An example showing a complete OpenMD file.},
232     label={sch:mdExample}]
233     <OpenMD>
234     <MetaData>
235     molecule{
236     name = "Ar";
237     atom[0]{
238     type="Ar";
239     position( 0.0, 0.0, 0.0 );
240     }
241     }
242    
243     component{
244     type = "Ar";
245     nMol = 3;
246     }
247    
248     forceField = "LJ";
249     ensemble = "NVE"; // specify the simulation ensemble
250     dt = 1.0; // the time step for integration
251     runTime = 1e3; // the total simulation run time
252     sampleTime = 100; // trajectory file frequency
253     statusTime = 50; // statistics file frequency
254     </MetaData>
255     <Snapshot>
256     <FrameData>
257     Time: 0
258     Hmat: {{ 28.569, 0, 0 }, { 0, 28.569, 0 }, { 0, 0, 28.569 }}
259     Thermostat: 0 , 0
260     Barostat: {{ 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}
261     </FrameData>
262     <StuntDoubles>
263     0 pv 17.5 13.3 12.8 1.181e-03 -1.630e-03 -1.369e-03
264     1 pv -12.8 -14.9 -8.4 -4.440e-04 -2.048e-03 1.130e-03
265     2 pv -10.0 -15.2 -6.5 2.239e-03 -6.310e-03 1.810e-03
266     </StuntDoubles>
267     </Snapshot>
268     </OpenMD>
269     \end{lstlisting}
270    
271     Within the {\tt $<$MetaData$>$} block it is necessary to provide a
272     complete description of the molecule before it is actually placed in
273     the simulation. {\sc OpenMD}'s meta-data syntax was originally
274     developed with this goal in mind, and allows for the use of {\it
275     include files} to specify all atoms in a molecular prototype, as well
276     as any bonds, bends, or torsions. Include files allow the user to
277     describe a molecular prototype once, then simply include it into each
278     simulation containing that molecule. Returning to the example in
279     Scheme~\ref{sch:mdExample}, the include file's contents would be
280     Scheme~\ref{sch:mdIncludeExample}, and the new {\sc OpenMD} file would
281     become Scheme~\ref{sch:mdExPrime}.
282    
283     \begin{lstlisting}[float,caption={An example molecule definition in an
284     include file.},label={sch:mdIncludeExample}]
285     molecule{
286     name = "Ar";
287     atom[0]{
288     type="Ar";
289     position( 0.0, 0.0, 0.0 );
290     }
291     }
292     \end{lstlisting}
293    
294     \begin{lstlisting}[float,caption={Revised OpenMD input file
295     example.},label={sch:mdExPrime}]
296     <OpenMD>
297     <MetaData>
298     #include "argon.md"
299    
300     component{
301     type = "Ar";
302     nMol = 3;
303     }
304    
305     forceField = "LJ";
306     ensemble = "NVE";
307     dt = 1.0;
308     runTime = 1e3;
309     sampleTime = 100;
310     statusTime = 50;
311     </MetaData>
312     </MetaData>
313     <Snapshot>
314     <FrameData>
315     Time: 0
316     Hmat: {{ 28.569, 0, 0 }, { 0, 28.569, 0 }, { 0, 0, 28.569 }}
317     Thermostat: 0 , 0
318     Barostat: {{ 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}
319     </FrameData>
320     <StuntDoubles>
321     0 pv 17.5 13.3 12.8 1.181e-03 -1.630e-03 -1.369e-03
322     1 pv -12.8 -14.9 -8.4 -4.440e-04 -2.048e-03 1.130e-03
323     2 pv -10.0 -15.2 -6.5 2.239e-03 -6.310e-03 1.810e-03
324     </StuntDoubles>
325     </Snapshot>
326     </OpenMD>
327     \end{lstlisting}
328    
329     \section{\label{section:atomsMolecules}Atoms, Molecules, and other
330     ways of grouping atoms}
331    
332     As mentioned above, the fundamental unit for an {\sc OpenMD} simulation
333     is the {\tt atom}. Atoms can be collected into secondary structures
334     such as {\tt rigidBodies}, {\tt cutoffGroups}, or {\tt molecules}. The
335     {\tt molecule} is a way for {\sc OpenMD} to keep track of the atoms in
336     a simulation in logical manner. Molecular units store the identities
337     of all the atoms and rigid bodies associated with themselves, and they
338     are responsible for the evaluation of their own internal interactions
339     (\emph{i.e.}~bonds, bends, and torsions). Scheme
340     \ref{sch:mdIncludeExample} shows how one creates a molecule in an
341     included meta-data file. The positions of the atoms given in the
342     declaration are relative to the origin of the molecule, and the origin
343     is used when creating a system containing the molecule.
344    
345     One of the features that sets {\sc OpenMD} apart from most of the
346     current molecular simulation packages is the ability to handle rigid
347     body dynamics. Rigid bodies are non-spherical particles or collections
348     of particles (e.g. $\mbox{C}_{60}$) that have a constant internal
349     potential and move collectively.\cite{Goldstein01} They are not
350     included in most simulation packages because of the algorithmic
351     complexity involved in propagating orientational degrees of freedom.
352     Integrators which propagate orientational motion with an acceptable
353     level of energy conservation for molecular dynamics are relatively
354     new inventions.
355    
356     Moving a rigid body involves determination of both the force and
357     torque applied by the surroundings, which directly affect the
358     translational and rotational motion in turn. In order to accumulate
359     the total force on a rigid body, the external forces and torques must
360     first be calculated for all the internal particles. The total force on
361     the rigid body is simply the sum of these external forces.
362     Accumulation of the total torque on the rigid body is more complex
363     than the force because the torque is applied to the center of mass of
364     the rigid body. The space-fixed torque on rigid body $i$ is
365     \begin{equation}
366     \boldsymbol{\tau}_i=
367     \sum_{a}\biggl[(\mathbf{r}_{ia}-\mathbf{r}_i)\times \mathbf{f}_{ia}
368     + \boldsymbol{\tau}_{ia}\biggr],
369     \label{eq:torqueAccumulate}
370     \end{equation}
371     where $\boldsymbol{\tau}_i$ and $\mathbf{r}_i$ are the torque on and
372     position of the center of mass respectively, while $\mathbf{f}_{ia}$,
373     $\mathbf{r}_{ia}$, and $\boldsymbol{\tau}_{ia}$ are the force on,
374     position of, and torque on the component particles of the rigid body.
375    
376     The summation of the total torque is done in the body fixed axis of
377     each rigid body. In order to move between the space fixed and body
378     fixed coordinate axes, parameters describing the orientation must be
379     maintained for each rigid body. At a minimum, the rotation matrix
380     ($\mathsf{A}$) can be described by the three Euler angles ($\phi,
381     \theta,$ and $\psi$), where the elements of $\mathsf{A}$ are composed of
382     trigonometric operations involving $\phi, \theta,$ and
383     $\psi$.\cite{Goldstein01} In order to avoid numerical instabilities
384     inherent in using the Euler angles, the four parameter ``quaternion''
385     scheme is often used. The elements of $\mathsf{A}$ can be expressed as
386     arithmetic operations involving the four quaternions ($q_w, q_x, q_y,$
387     and $q_z$).\cite{Allen87} Use of quaternions also leads to
388     performance enhancements, particularly for very small
389     systems.\cite{Evans77}
390    
391     Rather than use one of the previously stated methods, {\sc OpenMD}
392     utilizes a relatively new scheme that propagates the entire nine
393     parameter rotation matrix. Further discussion on this choice can be
394     found in Sec.~\ref{section:integrate}. An example definition of a
395     rigid body can be seen in Scheme
396     \ref{sch:rigidBody}.
397    
398     \begin{lstlisting}[float,caption={[Defining rigid bodies]A sample
399     definition of a molecule containing a rigid body and a cutoff
400     group},label={sch:rigidBody}]
401     molecule{
402     name = "TIP3P";
403     atom[0]{
404     type = "O_TIP3P";
405     position( 0.0, 0.0, -0.06556 );
406     }
407     atom[1]{
408     type = "H_TIP3P";
409     position( 0.0, 0.75695, 0.52032 );
410     }
411     atom[2]{
412     type = "H_TIP3P";
413     position( 0.0, -0.75695, 0.52032 );
414     }
415    
416     rigidBody[0]{
417     members(0, 1, 2);
418     }
419    
420     cutoffGroup{
421     members(0, 1, 2);
422     }
423     }
424     \end{lstlisting}
425    
426     \section{\label{sec:miscConcepts}Creating a $<$MetaData$>$ block}
427    
428     The actual creation of a {\tt $<$MetaData$>$} block requires several key
429     components. The first part of the file needs to be the declaration of
430     all of the molecule prototypes used in the simulation. This is
431     typically done through included prototype files. Only the molecules
432     actually present in the simulation need to be declared; however, {\sc
433     OpenMD} allows for the declaration of more molecules than are
434     needed. This gives the user the ability to build up a library of
435     commonly used molecules into a single include file.
436    
437     Once all prototypes are declared, the ordering of the rest of the
438     block is less stringent. The molecular composition of the simulation
439     is specified with {\tt component} statements. Each different type of
440     molecule present in the simulation is considered a separate
441     component (an example is shown in
442     Sch.~\ref{sch:mdExPrime}). The component blocks tell {\sc OpenMD} the
443     number of molecules that will be in the simulation, and the order in
444     which the components blocks are declared sets the ordering of the real
445     atoms in the {\tt $<$Snapshot$>$} block as well as in the output files. The
446     remainder of the script then sets the various simulation parameters
447     for the system of interest.
448    
449     The required set of parameters that must be present in all simulations
450     is given in Table~\ref{table:reqParams}. Since the user can use {\sc
451     OpenMD} to perform energy minimizations as well as molecular dynamics
452     simulations, one of the {\tt minimizer} or {\tt ensemble} keywords
453     must be present. The {\tt ensemble} keyword is responsible for
454     selecting the integration method used for the calculation of the
455     equations of motion. An in depth discussion of the various methods
456     available in {\sc OpenMD} can be found in
457     Sec.~\ref{section:mechanics}. The {\tt minimizer} keyword selects
458     which minimization method to use, and more details on the choices of
459     minimizer parameters can be found in
460     Sec.~\ref{section:minimizer}. The {\tt forceField} statement is
461     important for the selection of which forces will be used in the course
462     of the simulation. {\sc OpenMD} supports several force fields, as
463     outlined in Sec.~\ref{section:empiricalEnergy}. The force fields are
464     interchangeable between simulations, with the only requirement being
465     that all atoms needed by the simulation are defined within the
466     selected force field.
467    
468     For molecular dynamics simulations, the time step between force
469     evaluations is set with the {\tt dt} parameter, and {\tt runTime} will
470     set the time length of the simulation. Note, that {\tt runTime} is an
471     absolute time, meaning if the simulation is started at t = 10.0~ns
472     with a {\tt runTime} of 25.0~ns, the simulation will only run for an
473     additional 15.0~ns.
474    
475     For energy minimizations, it is not necessary to specify {\tt dt} or
476     {\tt runTime}.
477    
478     To set the initial positions and velocities of all the integrable
479     objects in the simulation, {\sc OpenMD} will use the last good {\tt
480     $<$Snapshot$>$} block that was found in the startup file that it was
481     called with. If the {\tt useInitalTime} flag is set to {\tt true},
482     the time stamp from this snapshot will also set the initial time stamp
483     for the simulation. Additional parameters are summarized in
484     Table~\ref{table:genParams}.
485    
486     It is important to note the fundamental units in all files which are
487     read and written by {\sc OpenMD}. Energies are in $\mbox{kcal
488     mol}^{-1}$, distances are in $\mbox{\AA}$, times are in $\mbox{fs}$,
489     translational velocities are in $\mbox{\AA~fs}^{-1}$, and masses are
490     in $\mbox{amu}$. Orientational degrees of freedom are described using
491     quaternions (unitless, but $q_w^2 + q_x^2 + q_y^2 + q_z^2 = 1$),
492     body-fixed angular momenta ($\mbox{amu \AA}^{2} \mbox{radians
493     fs}^{-1}$), and body-fixed moments of inertia ($\mbox{amu \AA}^{2}$).
494    
495     \begin{longtable}[c]{ABCD}
496     \caption{Meta-data Keywords: Required Parameters}
497     \\
498     {\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline
499     \endhead
500     \hline
501     \endfoot
502 skuang 3793 {\tt forceField} & string & Sets the base name for the force field file &
503     OpenMD appends a {\tt .frc} to the end of this to look for a force
504     field file.\\
505 gezelter 3607 {\tt component} & & Defines the molecular components of the system &
506     Every {\tt $<$MetaData$>$} block must have a component statement. \\
507     {\tt minimizer} & string & Chooses a minimizer & Possible minimizers
508     are SD and CG. Either {\tt ensemble} or {\tt minimizer} must be specified. \\
509     {\tt ensemble} & string & Sets the ensemble. & Possible ensembles are
510 gezelter 3709 NVE, NVT, NPTi, NPAT, NPTf, NPTxyz, LD and LangevinHull. Either {\tt ensemble}
511 gezelter 3607 or {\tt minimizer} must be specified. \\
512     {\tt dt} & fs & Sets the time step. & Selection of {\tt dt} should be
513     small enough to sample the fastest motion of the simulation. ({\tt
514     dt} is required for molecular dynamics simulations)\\
515     {\tt runTime} & fs & Sets the time at which the simulation should
516     end. & This is an absolute time, and will end the simulation when the
517     current time meets or exceeds the {\tt runTime}. ({\tt runTime} is
518     required for molecular dynamics simulations)
519     \label{table:reqParams}
520     \end{longtable}
521    
522     \begin{longtable}[c]{ABCD}
523     \caption{Meta-data Keywords: Optional Parameters}
524     \\
525     {\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline
526     \endhead
527     \hline
528     \endfoot
529     {\tt forceFieldVariant} & string & Sets the name of the variant of the
530     force field. & {\sc eam} has three variants: {\tt u3}, {\tt u6}, and
531     {\tt VC}. \\
532     {\tt forceFieldFileName} & string & Overrides the default force field
533     file name & Each force field has a default file name, and this
534     parameter can override the default file name for the chosen force
535     field. \\
536     {\tt usePeriodicBoundaryConditions} & & & \\
537     & logical & Turns periodic boundary conditions on/off. & Default is true. \\
538     {\tt orthoBoxTolerance} & double & & decides how orthogonal the periodic
539     box must be before we can use cheaper box calculations \\
540     {\tt cutoffRadius} & $\mbox{\AA}$ & Manually sets the cutoff radius &
541     the default value is set by the {\tt cutoffPolicy} \\
542     {\tt cutoffPolicy} & string & one of mix, max, or
543     traditional & the traditional cutoff policy is to set the cutoff
544     radius for all atoms in the system to the same value (governed by the
545     largest atom). mix and max are pair-dependent cutoff
546     methods. \\
547     {\tt skinThickness} & \AA & thickness of the skin for the Verlet
548     neighbor lists & defaults to 1 \AA \\
549     {\tt switchingRadius} & $\mbox{\AA}$ & Manually sets the inner radius
550     for the switching function. & Defaults to 85~\% of the {\tt
551     cutoffRadius}. \\
552     {\tt switchingFunctionType} & & & \\
553     & string & cubic or
554     fifth\_order\_polynomial & Default is cubic. \\
555     {\tt useInitialTime} & logical & Sets whether the initial time is
556     taken from the last $<$Snapshot$>$ in the startup file. & Useful when recovering a simulation from a crashed processor. Default is false. \\
557     {\tt useInitialExtendedSystemState} & & & \\
558     & logical & keep the extended
559     system variables? & Should the extended
560     variables (the thermostat and barostat) be kept from the {\tt $<$Snapshot$>$} block? \\
561     {\tt sampleTime} & fs & Sets the frequency at which the {\tt .dump} file is written. & The default is equal to the {\tt runTime}. \\
562     {\tt resetTime} & fs & Sets the frequency at which the extended system
563     variables are reset to zero & The default is to never reset these
564     variables. \\
565     {\tt statusTime} & fs & Sets the frequency at which the {\tt .stat} file is written. & The default is equal to the {\tt sampleTime}. \\
566     {\tt finalConfig} & string & Sets the name of the final output file. & Useful when stringing simulations together. Defaults to the root name of the initial meta-data file but with an {\tt .eor} extension. \\
567     {\tt compressDumpFile} & logical & & should the {\tt .dump} file be
568     compressed on the fly? \\
569     {\tt statFileFormat} & string & columns to print in the {\tt .stat}
570     file where each column is separated by a pipe ($\mid$) symbol. & (The
571     default is the first eight of these columns in order.) \\
572     & & \multicolumn{2}{p{3.5in}}{Allowed
573     column names are: {\sc time, total\_energy, potential\_energy, kinetic\_energy,
574     temperature, pressure, volume, conserved\_quantity,
575     translational\_kinetic, rotational\_kinetic, long\_range\_potential,
576     short\_range\_potential, vanderwaals\_potential,
577     electrostatic\_potential, bond\_potential, bend\_potential,
578     dihedral\_potential, improper\_potential, vraw, vharm,
579     pressure\_tensor\_x, pressure\_tensor\_y, pressure\_tensor\_z}} \\
580     {\tt printPressureTensor} & logical & sets whether {\sc OpenMD} will print
581     out the pressure tensor & can be useful for calculations of the bulk
582     modulus \\
583     {\tt electrostaticSummationMethod} & & & \\
584     & string & shifted\_force,
585     shifted\_potential, shifted\_force, or reaction\_field &
586     default is shifted\_force. \\
587     {\tt electrostaticScreeningMethod} & & & \\
588     & string & undamped or damped & default is damped \\
589     {\tt dielectric} & unitless & Sets the dielectric constant for
590     reaction field. & If {\tt electrostaticSummationMethod} is set to {\tt
591     reaction\_field}, then {\tt dielectric} must be set. \\
592     {\tt dampingAlpha} & $\mbox{\AA}^{-1}$ & governs strength of
593     electrostatic damping & defaults to 0.2 $\mbox{\AA}^{-1}$. \\
594     {\tt tempSet} & logical & resample velocities from a Maxwell-Boltzmann
595     distribution set to {\tt targetTemp} & default is false. \\
596     {\tt thermalTime} & fs & how often to perform a {\tt tempSet} &
597     default is never \\
598     {\tt targetTemp} & K & sets the target temperature & no default value \\
599     {\tt tauThermostat} & fs & time constant for Nos\'{e}-Hoover
600     thermostat & times from 1000-10,000 fs are reasonable \\
601     {\tt targetPressure} & atm & sets the target pressure & no default value\\
602     {\tt surfaceTension} & & sets the target surface tension in the x-y
603     plane & no default value \\
604     {\tt tauBarostat} & fs & time constant for the
605     Nos\'{e}-Hoover-Andersen barostat & times from 10,000 to 100,000 fs
606     are reasonable \\
607     {\tt seed } & integer & Sets the seed value for the random number generator. & The seed needs to be at least 9 digits long. The default is to take the seed from the CPU clock. \\
608     \label{table:genParams}
609     \end{longtable}
610    
611    
612     \section{\label{section:coordFiles}$<$Snapshot$>$ Blocks}
613    
614     The standard format for storage of a system's coordinates is the {\tt
615     $<$Snapshot$>$} block , the exact details of which can be seen in
616     Scheme~\ref{sch:dumpFormat}. As all bonding and molecular information
617     is stored in the {\tt $<$MetaData$>$} blocks, the {\tt $<$Snapshot$>$} blocks
618     contain only the coordinates of the objects which move independently
619     during the simulation. It is important to note that {\it not all
620     atoms} are capable of independent motion. Atoms which are part of
621     rigid bodies are not ``integrable objects'' in the equations of
622     motion; the rigid bodies themselves are the integrable objects.
623     Therefore, the coordinate file contains coordinates of all the {\tt
624     integrableObjects} in the system. For systems without rigid bodies,
625     this is simply the coordinates of all the atoms.
626    
627     It is important to note that although the simulation propagates the
628     complete rotation matrix, directional entities are written out using
629     quaternions to save space in the output files.
630    
631     \begin{lstlisting}[float,caption={[The format of the {\tt $<$Snapshot$>$} block]
632     An example of the format of the {\tt $<$Snapshot$>$} block. There is an
633     initial sub-block called {\tt $<$FrameData$>$} which contains the time
634     stamp, the three column vectors of $\mathsf{H}$, and optional extra
635     information for the extended sytem ensembles. The lines in the {\tt
636     $<$StuntDoubles$>$} sub-block provide information about the instantaneous
637     configuration of each integrable object. For each integrable object,
638     the global index is followed by a short string describing what
639     additional information is present on the line. Atoms with only
640     position and velocity information use the ``pv'' string which must
641     then be followed by the position and velocity vectors for that atom.
642     Directional atoms and Rigid Bodies typically use the ``pvqj'' string
643     which is followed by position, velocity, quaternions, and
644     lastly, body fixed angular momentum for that integrable object.},
645     label=sch:dumpFormat]
646     <Snapshot>
647     <FrameData>
648     Time: 0
649     Hmat: {{ Hxx, Hyx, Hzx }, { Hxy, Hyy, Hzy }, { Hxz, Hyz, Hzz }}
650     Thermostat: 0 , 0
651     Barostat: {{ 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}
652     </FrameData>
653     <StuntDoubles>
654     0 pv x y z vx vy vz
655     1 pv x y z vx vy vz
656     2 pvqj x y z vx vy vz qw qx qy qz jx jy jz
657     3 pvqj x y z vx vy vz qw qx qy qz jx jy jz
658     </StuntDoubles>
659     </Snapshot>
660     \end{lstlisting}
661    
662     There are three {\sc OpenMD} files that are written using the combined
663     format. They are: the initial startup file (\texttt{.md}), the
664     simulation trajectory file (\texttt{.dump}), and the final coordinates
665     or ``end-of-run'' for the simulation (\texttt{.eor}). The initial
666     startup file is necessary for {\sc OpenMD} to start the simulation with
667     the proper coordinates, and this file must be generated by the user
668     before the simulation run. The trajectory (or ``dump'') file is
669     updated during simulation and is used to store snapshots of the
670     coordinates at regular intervals. The first frame is a duplication of
671     the initial configuration (the last good {\tt $<$Snapshot$>$} in the
672     startup file), and each subsequent frame is appended to the dump file
673     at an interval specified in the meta-data file with the
674     \texttt{sampleTime} flag. The final coordinate file is the
675     ``end-of-run'' file. The \texttt{.eor} file stores the final
676     configuration of the system for a given simulation. The file is
677     updated at the same time as the \texttt{.dump} file, but it only
678     contains the most recent frame. In this way, an \texttt{.eor} file may
679     be used to initialize a second simulation should it be necessary to
680     recover from a crash or power outage. The coordinate files generated
681     by {\sc OpenMD} (both \texttt{.dump} and \texttt{.eor}) all contain the
682     same {\tt $<$MetaData$>$} block as the startup file, so they may be
683     used to start up a new simulation if desired.
684    
685     \section{\label{section:initCoords}Generation of Initial Coordinates}
686    
687     As was stated in Sec.~\ref{section:coordFiles}, a meaningful {\tt
688     $<$Snapshot$>$} block is necessary for specifying for the starting
689     coordinates for a simulation. Since each simulation is different,
690     system creation is left to the end user; however, we have included a
691     few sample programs which make some specialized structures. The {\tt
692     $<$Snapshot$>$} block must index the integrable objects in the correct
693     order. The ordering of the integrable objects relies on the ordering
694     of molecules within the {\tt $<$MetaData$>$} block. {\sc OpenMD}
695     expects the order to comply with the following guidelines:
696     \begin{enumerate}
697     \item All of the molecules of the first declared component are given
698     before proceeding to the molecules of the second component, and so on
699     for all subsequently declared components.
700     \item The ordering of the atoms for each molecule follows the order
701     declared in the molecule's declaration within the model file.
702     \item Only atoms which are not members of a {\tt rigidBody} are
703     included.
704     \item Rigid Body coordinates for a molecule are listed immediately
705     after the the other atoms in a molecule. Some molecules may be
706     entirely rigid, in which case, only the rigid body coordinates are
707     given.
708     \end{enumerate}
709     An example is given in the {\sc OpenMD} file in Scheme~\ref{sch:initEx1}.
710    
711     \begin{lstlisting}[float,caption={Example declaration of the
712     $\text{I}_2$ molecule and the HCl molecule in $<$MetaData$>$ and
713     $<$Snapshot$>$ blocks. Note that even though $\text{I}_2$ is
714     declared before HCl, the $<$Snapshot$>$ block follows the order {\it in
715     which the components were included}.}, label=sch:initEx1]
716     <OpenMD>
717     <MetaData>
718     molecule{
719     name = "I2";
720 gezelter 3709 atom[0]{ type = "I"; }
721     atom[1]{ type = "I"; }
722     bond{ members( 0, 1); }
723 gezelter 3607 }
724     molecule{
725     name = "HCl"
726 gezelter 3709 atom[0]{ type = "H";}
727     atom[1]{ type = "Cl";}
728     bond{ members( 0, 1); }
729 gezelter 3607 }
730     component{
731     type = "HCl";
732     nMol = 4;
733     }
734     component{
735     type = "I2";
736     nMol = 1;
737     }
738     </MetaData>
739     <Snapshot>
740     <FrameData>
741     Time: 0
742     Hmat: {{ 10.0, 0.0, 0.0 }, { 0.0, 10.0, 0.0 }, { 0.0, 0.0, 10.0 }}
743     </FrameData>
744     <StuntDoubles>
745     0 pv x y z vx vy vz // H from first HCl molecule
746     1 pv x y z vx vy vz // Cl from first HCl molecule
747     2 pv x y z vx vy vz // H from second HCl molecule
748     3 pv x y z vx vy vz // Cl from second HCl molecule
749     4 pv x y z vx vy vz // H from third HCl molecule
750     5 pv x y z vx vy vz // Cl from third HCl molecule
751     6 pv x y z vx vy vz // H from fourth HCl molecule
752     7 pv x y z vx vy vz // Cl from fourth HCl molecule
753     8 pv x y z vx vy vz // First I from I2 molecule
754     9 pv x y z vx vy vz // Second I from I2 molecule
755     </StuntDoubles>
756     </Snapshot>
757     </OpenMD>
758     \end{lstlisting}
759    
760     \section{The Statistics File}
761    
762     The last output file generated by {\sc OpenMD} is the statistics
763     file. This file records such statistical quantities as the
764     instantaneous temperature (in $K$), volume (in $\mbox{\AA}^{3}$),
765     pressure (in $\mbox{atm}$), etc. It is written out with the frequency
766     specified in the meta-data file with the
767     \texttt{statusTime} keyword. The file allows the user to observe the
768     system variables as a function of simulation time while the simulation
769     is in progress. One useful function the statistics file serves is to
770     monitor the conserved quantity of a given simulation ensemble,
771     allowing the user to gauge the stability of the integrator. The
772     statistics file is denoted with the \texttt{.stat} file extension.
773    
774     \chapter{\label{section:empiricalEnergy}The Empirical Energy
775     Functions}
776    
777     Like many simulation packages, {\sc OpenMD} splits the potential energy
778     into the short-ranged (bonded) portion and a long-range (non-bonded)
779     potential,
780     \begin{equation}
781     V = V_{\mathrm{short-range}} + V_{\mathrm{long-range}}.
782     \end{equation}
783     The short-ranged portion includes the explicit bonds, bends, and
784     torsions which have been defined in the meta-data file for the
785     molecules which are present in the simulation. The functional forms and
786     parameters for these interactions are defined by the force field which
787     is chosen.
788    
789     Calculating the long-range (non-bonded) potential involves a sum over
790     all pairs of atoms (except for those atoms which are involved in a
791     bond, bend, or torsion with each other). If done poorly, calculating
792     the the long-range interactions for $N$ atoms would involve $N(N-1)/2$
793     evaluations of atomic distances. To reduce the number of distance
794     evaluations between pairs of atoms, {\sc OpenMD} uses a switched cutoff
795     with Verlet neighbor lists.\cite{Allen87} It is well known that
796     neutral groups which contain charges will exhibit pathological forces
797     unless the cutoff is applied to the neutral groups evenly instead of
798     to the individual atoms.\cite{leach01:mm} {\sc OpenMD} allows users to
799     specify cutoff groups which may contain an arbitrary number of atoms
800     in the molecule. Atoms in a cutoff group are treated as a single unit
801     for the evaluation of the switching function:
802     \begin{equation}
803     V_{\mathrm{long-range}} = \sum_{a} \sum_{b>a} s(r_{ab}) \sum_{i \in a} \sum_{j \in b} V_{ij}(r_{ij}),
804     \end{equation}
805     where $r_{ab}$ is the distance between the centers of mass of the two
806     cutoff groups ($a$ and $b$).
807    
808     The sums over $a$ and $b$ are over the cutoff groups that are present
809     in the simulation. Atoms which are not explicitly defined as members
810     of a {\tt cutoffGroup} are treated as a group consisting of only one
811     atom. The switching function, $s(r)$ is the standard cubic switching
812     function,
813     \begin{equation}
814     S(r) =
815     \begin{cases}
816     1 & \text{if $r \le r_{\text{sw}}$},\\
817     \frac{(r_{\text{cut}} + 2r - 3r_{\text{sw}})(r_{\text{cut}} - r)^2}
818     {(r_{\text{cut}} - r_{\text{sw}})^3}
819     & \text{if $r_{\text{sw}} < r \le r_{\text{cut}}$}, \\
820     0 & \text{if $r > r_{\text{cut}}$.}
821     \end{cases}
822     \label{eq:dipoleSwitching}
823     \end{equation}
824     Here, $r_{\text{sw}}$ is the {\tt switchingRadius}, or the distance
825     beyond which interactions are reduced, and $r_{\text{cut}}$ is the
826     {\tt cutoffRadius}, or the distance at which interactions are
827     truncated.
828    
829     Users of {\sc OpenMD} do not need to specify the {\tt cutoffRadius} or
830     {\tt switchingRadius}. In simulations containing only Lennard-Jones
831     atoms, the cutoff radius has a default value of $2.5\sigma_{ii}$,
832     where $\sigma_{ii}$ is the largest Lennard-Jones length parameter
833     present in the simulation. In simulations containing charged or
834     dipolar atoms, the default cutoff radius is $15 \mbox{\AA}$.
835    
836     The {\tt switchingRadius} is set to a default value of 95\% of the
837     {\tt cutoffRadius}. In the special case of a simulation containing
838     {\it only} Lennard-Jones atoms, the default switching radius takes the
839     same value as the cutoff radius, and {\sc OpenMD} will use a shifted
840     potential to remove discontinuities in the potential at the cutoff.
841     Both radii may be specified in the meta-data file.
842    
843     Force fields can be added to {\sc OpenMD}, although it comes with a few
844     simple examples (Lennard-Jones, {\sc duff}, {\sc water}, and {\sc
845     eam}) which are explained in the following sections.
846    
847     \section{\label{sec:LJPot}The Lennard Jones Force Field}
848    
849     The most basic force field implemented in {\sc OpenMD} is the
850     Lennard-Jones force field, which mimics the van der Waals interaction
851     at long distances and uses an empirical repulsion at short
852     distances. The Lennard-Jones potential is given by:
853     \begin{equation}
854     V_{\text{LJ}}(r_{ij}) =
855     4\epsilon_{ij} \biggl[
856     \biggl(\frac{\sigma_{ij}}{r_{ij}}\biggr)^{12}
857     - \biggl(\frac{\sigma_{ij}}{r_{ij}}\biggr)^{6}
858     \biggr],
859     \label{eq:lennardJonesPot}
860     \end{equation}
861     where $r_{ij}$ is the distance between particles $i$ and $j$,
862     $\sigma_{ij}$ scales the length of the interaction, and
863     $\epsilon_{ij}$ scales the well depth of the potential. Scheme
864     \ref{sch:LJFF} gives an example meta-data file that
865     sets up a system of 108 Ar particles to be simulated using the
866     Lennard-Jones force field.
867    
868     \begin{lstlisting}[float,caption={[Invocation of the Lennard-Jones
869     force field] A sample startup file for a small Lennard-Jones
870     simulation.},label={sch:LJFF}]
871     <OpenMD>
872     <MetaData>
873     #include "argon.md"
874    
875     component{
876     type = "Ar";
877     nMol = 108;
878     }
879    
880     forceField = "LJ";
881     </MetaData>
882     <Snapshot> // not shown in this scheme
883     </Snapshot>
884     </OpenMD>
885     \end{lstlisting}
886    
887     Interactions between dissimilar particles requires the generation of
888     cross term parameters for $\sigma$ and $\epsilon$. These parameters
889     are determined using the Lorentz-Berthelot mixing
890     rules:\cite{Allen87}
891     \begin{equation}
892     \sigma_{ij} = \frac{1}{2}[\sigma_{ii} + \sigma_{jj}],
893     \label{eq:sigmaMix}
894     \end{equation}
895     and
896     \begin{equation}
897     \epsilon_{ij} = \sqrt{\epsilon_{ii} \epsilon_{jj}}.
898     \label{eq:epsilonMix}
899     \end{equation}
900    
901     \section{\label{section:DUFF}Dipolar Unified-Atom Force Field}
902    
903     The dipolar unified-atom force field ({\sc duff}) was developed to
904     simulate lipid bilayers. These types of simulations require a model
905     capable of forming bilayers, while still being sufficiently
906     computationally efficient to allow large systems ($\sim$100's of
907     phospholipids, $\sim$1000's of waters) to be simulated for long times
908     ($\sim$10's of nanoseconds). With this goal in mind, {\sc duff} has no
909     point charges. Charge-neutral distributions are replaced with dipoles,
910     while most atoms and groups of atoms are reduced to Lennard-Jones
911     interaction sites. This simplification reduces the length scale of
912     long range interactions from $\frac{1}{r}$ to $\frac{1}{r^3}$,
913     removing the need for the computationally expensive Ewald
914     sum. Instead, Verlet neighbor-lists and cutoff radii are used for the
915     dipolar interactions, and, if desired, a reaction field may be added
916     to mimic longer range interactions.
917    
918     As an example, lipid head-groups in {\sc duff} are represented as
919     point dipole interaction sites. Placing a dipole at the head group's
920     center of mass mimics the charge separation found in common
921     phospholipid head groups such as phosphatidylcholine.\cite{Cevc87}
922     Additionally, a large Lennard-Jones site is located at the
923     pseudoatom's center of mass. The model is illustrated by the red atom
924     in Fig.~\ref{fig:lipidModel}. The water model we use to
925     complement the dipoles of the lipids is a
926     reparameterization\cite{fennell04} of the soft sticky dipole (SSD)
927     model of Ichiye
928     \emph{et al.}\cite{liu96:new_model}
929    
930     \begin{figure}
931     \centering
932     \includegraphics[width=\linewidth]{lipidModel.pdf}
933     \caption[A representation of a lipid model in {\sc duff}]{A
934     representation of the lipid model. $\phi$ is the torsion angle,
935     $\theta$ is the bend angle, and $\mu$ is the dipole moment of the head
936     group.}
937     \label{fig:lipidModel}
938     \end{figure}
939    
940     A set of scalable parameters has been used to model the alkyl groups
941     with Lennard-Jones sites. For this, parameters from the TraPPE force
942     field of Siepmann \emph{et al.}\cite{Siepmann1998} have been
943     utilized. TraPPE is a unified-atom representation of n-alkanes which
944     is parametrized against phase equilibria using Gibbs ensemble Monte
945     Carlo simulation techniques.\cite{Siepmann1998} One of the advantages
946     of TraPPE is that it generalizes the types of atoms in an alkyl chain
947     to keep the number of pseudoatoms to a minimum; thus, the parameters
948     for a unified atom such as $\text{CH}_2$ do not change depending on
949     what species are bonded to it.
950    
951     As is required by TraPPE, {\sc duff} also constrains all bonds to be
952     of fixed length. Typically, bond vibrations are the fastest motions in
953     a molecular dynamic simulation. With these vibrations present, small
954     time steps between force evaluations must be used to ensure adequate
955     energy conservation in the bond degrees of freedom. By constraining
956     the bond lengths, larger time steps may be used when integrating the
957     equations of motion. A simulation using {\sc duff} is illustrated in
958     Scheme \ref{sch:DUFF}.
959    
960     \begin{lstlisting}[float,caption={[Invocation of {\sc duff}]A portion
961     of a startup file showing a simulation utilizing {\sc
962     duff}},label={sch:DUFF}]
963     <OpenMD>
964     <MetaData>
965     #include "water.md"
966     #include "lipid.md"
967    
968     component{
969     type = "simpleLipid_16";
970     nMol = 60;
971     }
972    
973     component{
974     type = "SSD_water";
975     nMol = 1936;
976     }
977    
978     forceField = "DUFF";
979     </MetaData>
980     <Snapshot> // not shown in this scheme
981     </Snapshot>
982     </OpenMD>
983     \end{lstlisting}
984    
985     \subsection{\label{section:energyFunctions}{\sc duff} Energy Functions}
986    
987     The total potential energy function in {\sc duff} is
988     \begin{equation}
989     V = \sum^{N}_{I=1} V^{I}_{\text{Internal}}
990     + \sum^{N-1}_{I=1} \sum_{J>I} V^{IJ}_{\text{Cross}},
991     \label{eq:totalPotential}
992     \end{equation}
993     where $V^{I}_{\text{Internal}}$ is the internal potential of molecule $I$:
994     \begin{equation}
995     V^{I}_{\text{Internal}} =
996     \sum_{\theta_{ijk} \in I} V_{\text{bend}}(\theta_{ijk})
997     + \sum_{\phi_{ijkl} \in I} V_{\text{torsion}}(\phi_{ijkl})
998     + \sum_{i \in I} \sum_{(j>i+4) \in I}
999     \biggl[ V_{\text{LJ}}(r_{ij}) + V_{\text{dipole}}
1000     (\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j})
1001     \biggr].
1002     \label{eq:internalPotential}
1003     \end{equation}
1004     Here $V_{\text{bend}}$ is the bend potential for all 1, 3 bonded pairs
1005     within the molecule $I$, and $V_{\text{torsion}}$ is the torsion
1006     potential for all 1, 4 bonded pairs. The pairwise portions of the
1007     non-bonded interactions are excluded for atom pairs that are involved
1008     in the smae bond, bend, or torsion. All other atom pairs within a
1009     molecule are subject to the LJ pair potential.
1010    
1011     The bend potential of a molecule is represented by the following function:
1012     \begin{equation}
1013     V_{\text{bend}}(\theta_{ijk}) = k_{\theta}( \theta_{ijk} - \theta_0
1014     )^2, \label{eq:bendPot}
1015     \end{equation}
1016     where $\theta_{ijk}$ is the angle defined by atoms $i$, $j$, and $k$
1017     (see Fig.~\ref{fig:lipidModel}), $\theta_0$ is the equilibrium
1018     bond angle, and $k_{\theta}$ is the force constant which determines the
1019     strength of the harmonic bend. The parameters for $k_{\theta}$ and
1020     $\theta_0$ are borrowed from those in TraPPE.\cite{Siepmann1998}
1021    
1022     The torsion potential and parameters are also borrowed from TraPPE. It is
1023     of the form:
1024     \begin{equation}
1025     V_{\text{torsion}}(\phi) = c_1[1 + \cos \phi]
1026     + c_2[1 + \cos(2\phi)]
1027     + c_3[1 + \cos(3\phi)],
1028     \label{eq:origTorsionPot}
1029     \end{equation}
1030     where:
1031     \begin{equation}
1032     \cos\phi = (\hat{\mathbf{r}}_{ij} \times \hat{\mathbf{r}}_{jk}) \cdot
1033     (\hat{\mathbf{r}}_{jk} \times \hat{\mathbf{r}}_{kl}).
1034     \label{eq:torsPhi}
1035     \end{equation}
1036     Here, $\hat{\mathbf{r}}_{\alpha\beta}$ are the set of unit bond
1037     vectors between atoms $i$, $j$, $k$, and $l$. For computational
1038     efficiency, the torsion potential has been recast after the method of
1039     {\sc charmm},\cite{Brooks83} in which the angle series is converted to
1040     a power series of the form:
1041     \begin{equation}
1042     V_{\text{torsion}}(\phi) =
1043     k_3 \cos^3 \phi + k_2 \cos^2 \phi + k_1 \cos \phi + k_0,
1044     \label{eq:torsionPot}
1045     \end{equation}
1046     where:
1047     \begin{align*}
1048     k_0 &= c_1 + c_3, \\
1049     k_1 &= c_1 - 3c_3, \\
1050     k_2 &= 2 c_2, \\
1051     k_3 &= 4c_3.
1052     \end{align*}
1053     By recasting the potential as a power series, repeated trigonometric
1054     evaluations are avoided during the calculation of the potential
1055     energy.
1056    
1057    
1058     The cross potential between molecules $I$ and $J$,
1059     $V^{IJ}_{\text{Cross}}$, is as follows:
1060     \begin{equation}
1061     V^{IJ}_{\text{Cross}} =
1062     \sum_{i \in I} \sum_{j \in J}
1063     \biggl[ V_{\text{LJ}}(r_{ij}) + V_{\text{dipole}}
1064     (\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j})
1065     + V_{\text{sticky}}
1066     (\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j})
1067     \biggr],
1068     \label{eq:crossPotentail}
1069     \end{equation}
1070     where $V_{\text{LJ}}$ is the Lennard Jones potential,
1071     $V_{\text{dipole}}$ is the dipole dipole potential, and
1072     $V_{\text{sticky}}$ is the sticky potential defined by the SSD model
1073     (Sec.~\ref{section:SSD}). Note that not all atom types include all
1074     interactions.
1075    
1076     The dipole-dipole potential has the following form:
1077     \begin{equation}
1078     V_{\text{dipole}}(\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},
1079     \boldsymbol{\Omega}_{j}) = \frac{|\mu_i||\mu_j|}{4\pi\epsilon_{0}r_{ij}^{3}} \biggl[
1080     \boldsymbol{\hat{u}}_{i} \cdot \boldsymbol{\hat{u}}_{j}
1081     -
1082     3(\boldsymbol{\hat{u}}_i \cdot \hat{\mathbf{r}}_{ij}) %
1083     (\boldsymbol{\hat{u}}_j \cdot \hat{\mathbf{r}}_{ij}) \biggr].
1084     \label{eq:dipolePot}
1085     \end{equation}
1086     Here $\mathbf{r}_{ij}$ is the vector starting at atom $i$ pointing
1087     towards $j$, and $\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$
1088     are the orientational degrees of freedom for atoms $i$ and $j$
1089     respectively. The magnitude of the dipole moment of atom $i$ is
1090     $|\mu_i|$, $\boldsymbol{\hat{u}}_i$ is the standard unit orientation
1091     vector of $\boldsymbol{\Omega}_i$, and $\boldsymbol{\hat{r}}_{ij}$ is
1092     the unit vector pointing along $\mathbf{r}_{ij}$
1093     ($\boldsymbol{\hat{r}}_{ij}=\mathbf{r}_{ij}/|\mathbf{r}_{ij}|$).
1094    
1095     \subsection{\label{section:SSD}The {\sc duff} Water Models: SSD/E
1096     and SSD/RF}
1097    
1098     In the interest of computational efficiency, the default solvent used
1099     by {\sc OpenMD} is the extended Soft Sticky Dipole (SSD/E) water
1100     model.\cite{fennell04} The original SSD was developed by Ichiye
1101     \emph{et al.}\cite{liu96:new_model} as a modified form of the hard-sphere
1102     water model proposed by Bratko, Blum, and
1103     Luzar.\cite{Bratko85,Bratko95} It consists of a single point dipole
1104     with a Lennard-Jones core and a sticky potential that directs the
1105     particles to assume the proper hydrogen bond orientation in the first
1106     solvation shell. Thus, the interaction between two SSD water molecules
1107     \emph{i} and \emph{j} is given by the potential
1108     \begin{equation}
1109     V_{ij} =
1110     V_{ij}^{LJ} (r_{ij})\ + V_{ij}^{dp}
1111     (\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)\ +
1112     V_{ij}^{sp}
1113     (\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j),
1114     \label{eq:ssdPot}
1115     \end{equation}
1116     where the $\mathbf{r}_{ij}$ is the position vector between molecules
1117     \emph{i} and \emph{j} with magnitude equal to the distance $r_{ij}$, and
1118     $\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$ represent the
1119     orientations of the respective molecules. The Lennard-Jones and dipole
1120     parts of the potential are given by equations \ref{eq:lennardJonesPot}
1121     and \ref{eq:dipolePot} respectively. The sticky part is described by
1122     the following,
1123     \begin{equation}
1124     u_{ij}^{sp}(\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)=
1125     \frac{\nu_0}{2}[s(r_{ij})w(\mathbf{r}_{ij},
1126     \boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j) +
1127     s^\prime(r_{ij})w^\prime(\mathbf{r}_{ij},
1128     \boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)]\ ,
1129     \label{eq:stickyPot}
1130     \end{equation}
1131     where $\nu_0$ is a strength parameter for the sticky potential, and
1132     $s$ and $s^\prime$ are cubic switching functions which turn off the
1133     sticky interaction beyond the first solvation shell. The $w$ function
1134     can be thought of as an attractive potential with tetrahedral
1135     geometry:
1136     \begin{equation}
1137     w({\bf r}_{ij},{\bf \Omega}_i,{\bf \Omega}_j)=
1138     \sin\theta_{ij}\sin2\theta_{ij}\cos2\phi_{ij},
1139     \label{eq:stickyW}
1140     \end{equation}
1141     while the $w^\prime$ function counters the normal aligned and
1142     anti-aligned structures favored by point dipoles:
1143     \begin{equation}
1144     w^\prime({\bf r}_{ij},{\bf \Omega}_i,{\bf \Omega}_j)=
1145     (\cos\theta_{ij}-0.6)^2(\cos\theta_{ij}+0.8)^2-w^0,
1146     \label{eq:stickyWprime}
1147     \end{equation}
1148     It should be noted that $w$ is proportional to the sum of the $Y_3^2$
1149     and $Y_3^{-2}$ spherical harmonics (a linear combination which
1150     enhances the tetrahedral geometry for hydrogen bonded structures),
1151     while $w^\prime$ is a purely empirical function. A more detailed
1152     description of the functional parts and variables in this potential
1153     can be found in the original SSD
1154     articles.\cite{liu96:new_model,liu96:monte_carlo,chandra99:ssd_md,Ichiye03}
1155    
1156     \begin{figure}
1157     \centering
1158     \includegraphics[width=\linewidth]{waterAngle.pdf}
1159     \caption[Coordinate definition for the SSD/E water model]{Coordinates
1160     for the interaction between two SSD/E water molecules. $\theta_{ij}$
1161     is the angle that $r_{ij}$ makes with the $\hat{z}$ vector in the
1162     body-fixed frame for molecule $i$. The $\hat{z}$ vector bisects the
1163     HOH angle in each water molecule. }
1164     \label{fig:ssd}
1165     \end{figure}
1166    
1167    
1168     Since SSD/E is a single-point {\it dipolar} model, the force
1169     calculations are simplified significantly relative to the standard
1170     {\it charged} multi-point models. In the original Monte Carlo
1171     simulations using this model, Ichiye {\it et al.} reported that using
1172     SSD decreased computer time by a factor of 6-7 compared to other
1173     models.\cite{liu96:new_model} What is most impressive is that these
1174     savings did not come at the expense of accurate depiction of the
1175     liquid state properties. Indeed, SSD/E maintains reasonable agreement
1176     with the Head-Gordon diffraction data for the structural features of
1177     liquid water.\cite{hura00,liu96:new_model} Additionally, the dynamical
1178     properties exhibited by SSD/E agree with experiment better than those
1179     of more computationally expensive models (like TIP3P and
1180     SPC/E).\cite{chandra99:ssd_md} The combination of speed and accurate
1181     depiction of solvent properties makes SSD/E a very attractive model
1182     for the simulation of large scale biochemical simulations.
1183    
1184     Recent constant pressure simulations revealed issues in the original
1185     SSD model that led to lower than expected densities at all target
1186     pressures.\cite{Ichiye03,fennell04} The default model in {\sc OpenMD}
1187     is therefore SSD/E, a density corrected derivative of SSD that
1188     exhibits improved liquid structure and transport behavior. If the use
1189     of a reaction field long-range interaction correction is desired, it
1190     is recommended that the parameters be modified to those of the SSD/RF
1191     model (an SSD variant parameterized for reaction field). These solvent
1192     parameters are listed and can be easily modified in the {\sc duff}
1193     force field file ({\tt DUFF.frc}). A table of the parameter values
1194     and the drawbacks and benefits of the different density corrected SSD
1195     models can be found in reference~\cite{fennell04}.
1196    
1197     \section{\label{section:WATER}The {\sc water} Force Field}
1198    
1199     In addition to the {\sc duff} force field's solvent description, a
1200     separate {\sc water} force field has been included for simulating most
1201     of the common rigid-body water models. This force field includes the
1202     simple and point-dipolar models (SSD, SSD1, SSD/E, SSD/RF, and DPD
1203     water), as well as the common charge-based models (SPC, SPC/E, TIP3P,
1204     TIP4P, and
1205     TIP5P).\cite{liu96:new_model,Ichiye03,fennell04,Marrink01,Berendsen81,Berendsen87,Jorgensen83,Mahoney00}
1206     In order to handle these models, charge-charge interactions were
1207     included in the force-loop:
1208     \begin{equation}
1209     V_{\text{charge}}(r_{ij}) = \sum_{ij}\frac{q_iq_je^2}{r_{ij}},
1210     \end{equation}
1211     where $q$ represents the charge on particle $i$ or $j$, and $e$ is the
1212     charge of an electron in Coulombs. The charge-charge interaction
1213     support is rudimentary in the current version of {\sc OpenMD}. As with
1214     the other pair interactions, charges can be simulated with a pure
1215     cutoff or a reaction field. The various methods for performing the
1216     Ewald summation have not yet been included. The {\sc water} force
1217     field can be easily expanded through modification of the {\sc water}
1218     force field file ({\tt WATER.frc}). By adding atom types and inserting
1219     the appropriate parameters, it is possible to extend the force field
1220     to handle rigid molecules other than water.
1221    
1222     \section{\label{section:eam}Embedded Atom Method}
1223    
1224     {\sc OpenMD} implements a potential that describes bonding in
1225     transition metal
1226     systems.~\cite{Finnis84,Ercolessi88,Chen90,Qi99,Ercolessi02} This
1227     potential has an attractive interaction which models ``Embedding'' a
1228     positively charged pseudo-atom core in the electron density due to the
1229     free valance ``sea'' of electrons created by the surrounding atoms in
1230     the system. A pairwise part of the potential (which is primarily
1231     repulsive) describes the interaction of the positively charged metal
1232     core ions with one another. The Embedded Atom Method ({\sc
1233     eam})~\cite{Daw84,FBD86,johnson89,Lu97} has been widely adopted in the
1234     materials science community and has been included in {\sc OpenMD}. A
1235     good review of {\sc eam} and other formulations of metallic potentials
1236     was given by Voter.\cite{Voter:95}
1237    
1238     The {\sc eam} potential has the form:
1239     \begin{equation}
1240     V = \sum_{i} F_{i}\left[\rho_{i}\right] + \sum_{i} \sum_{j \neq i}
1241     \phi_{ij}({\bf r}_{ij})
1242     \end{equation}
1243     where $F_{i} $ is an embedding functional that approximates the energy
1244     required to embed a positively-charged core ion $i$ into a linear
1245     superposition of spherically averaged atomic electron densities given
1246     by $\rho_{i}$,
1247     \begin{equation}
1248     \rho_{i} = \sum_{j \neq i} f_{j}({\bf r}_{ij}),
1249     \end{equation}
1250     Since the density at site $i$ ($\rho_i$) must be computed before the
1251     embedding functional can be evaluated, {\sc eam} and the related
1252     transition metal potentials require two loops through the atom pairs
1253     to compute the inter-atomic forces.
1254    
1255     The pairwise portion of the potential, $\phi_{ij}$, is a primarily
1256     repulsive interaction between atoms $i$ and $j$. In the original
1257     formulation of {\sc eam}\cite{Daw84}, $\phi_{ij}$ was an entirely
1258     repulsive term; however later refinements to {\sc eam} allowed for
1259     more general forms for $\phi$.\cite{Daw89} The effective cutoff
1260     distance, $r_{{\text cut}}$ is the distance at which the values of
1261     $f(r)$ and $\phi(r)$ drop to zero for all atoms present in the
1262     simulation. In practice, this distance is fairly small, limiting the
1263     summations in the {\sc eam} equation to the few dozen atoms
1264     surrounding atom $i$ for both the density $\rho$ and pairwise $\phi$
1265     interactions.
1266    
1267     In computing forces for alloys, mixing rules as outlined by
1268     Johnson~\cite{johnson89} are used to compute the heterogenous pair
1269     potential,
1270     \begin{equation}
1271     \label{eq:johnson}
1272     \phi_{ab}(r)=\frac{1}{2}\left(
1273     \frac{f_{b}(r)}{f_{a}(r)}\phi_{aa}(r)+
1274     \frac{f_{a}(r)}{f_{b}(r)}\phi_{bb}(r)
1275     \right).
1276     \end{equation}
1277     No mixing rule is needed for the densities, since the density at site
1278     $i$ is simply the linear sum of density contributions of all the other
1279     atoms.
1280    
1281     The {\sc eam} force field illustrates an additional feature of {\sc
1282     OpenMD}. Foiles, Baskes and Daw fit {\sc eam} potentials for Cu, Ag,
1283     Au, Ni, Pd, Pt and alloys of these metals.\cite{FBD86} These fits are
1284     included in {\sc OpenMD} as the {\tt u3} variant of the {\sc eam} force
1285     field. Voter and Chen reparamaterized a set of {\sc eam} functions
1286     which do a better job of predicting melting points.\cite{Voter:87}
1287     These functions are included in {\sc OpenMD} as the {\tt VC} variant of
1288     the {\sc eam} force field. An additional set of functions (the
1289     ``Universal 6'' functions) are included in {\sc OpenMD} as the {\tt u6}
1290     variant of {\sc eam}. For example, to specify the Voter-Chen variant
1291     of the {\sc eam} force field, the user would add the {\tt
1292     forceFieldVariant = "VC";} line to the meta-data file.
1293    
1294     The potential files used by the {\sc eam} force field are in the
1295     standard {\tt funcfl} format, which is the format utilized by a number
1296     of other codes (e.g. ParaDyn~\cite{Paradyn}, {\sc dynamo 86}). It
1297     should be noted that the energy units in these files are in eV, not
1298     $\mbox{kcal mol}^{-1}$ as in the rest of the {\sc OpenMD} force field
1299     files.
1300    
1301     \section{\label{section:sc}The Sutton-Chen Force Field}
1302    
1303     The Sutton-Chen ({\sc sc})~\cite{Chen90} potential has been used to
1304     study a wide range of phenomena in metals. Although it is similar in
1305     form to the {\sc eam} potential, the Sutton-Chen model takes on a
1306     simpler form,
1307     \begin{equation}
1308     \label{eq:SCP1}
1309     U_{tot}=\sum _{i}\left[ \frac{1}{2}\sum _{j\neq
1310     i}D_{ij}V^{pair}_{ij}(r_{ij})-c_{i}D_{ii}\sqrt{\rho_{i}}\right] ,
1311     \end{equation}
1312     where $V^{pair}_{ij}$ and $\rho_{i}$ are given by
1313     \begin{equation}
1314     \label{eq:SCP2}
1315     V^{pair}_{ij}(r)=\left(
1316     \frac{\alpha_{ij}}{r_{ij}}\right)^{n_{ij}}, \rho_{i}=\sum_{j\neq i}\left(
1317     \frac{\alpha_{ij}}{r_{ij}}\right) ^{m_{ij}}
1318     \end{equation}
1319    
1320     $V^{pair}_{ij}$ is a repulsive pairwise potential that accounts for
1321     interactions of the pseudo-atom cores. The $\sqrt{\rho_i}$ term in
1322     Eq. (\ref{eq:SCP1}) is an attractive many-body potential that models
1323     the interactions between the valence electrons and the cores of the
1324     pseudo-atoms. $D_{ij}$, $D_{ii}$, $c_i$ and $\alpha_{ij}$ are
1325     parameters used to tune the potential for different transition
1326     metals.
1327    
1328     The {\sc sc} potential form has also been parameterized by Qi {\it et
1329     al.}\cite{Qi99} These parameters were obtained via empirical and {\it
1330     ab initio} calculations to match structural features of the FCC
1331     crystal. To specify the original Sutton-Chen variant of the {\sc sc}
1332     force field, the user would add the {\tt forceFieldVariant = "SC";}
1333     line to the meta-data file, while specification of the Qi {\it et al.}
1334     quantum-adapted variant of the {\sc sc} potential, the user would add
1335     the {\tt forceFieldVariant = "QSC";} line to the meta-data file.
1336    
1337     \section{\label{section:clay}The CLAY force field}
1338    
1339     The {\sc clay} force field is based on an ionic (nonbonded)
1340     description of the metal-oxygen interactions associated with hydrated
1341     phases. All atoms are represented as point charges and are allowed
1342     complete translational freedom. Metal-oxygen interactions are based on
1343     a simple Lennard-Jones potential combined with electrostatics. The
1344     empirical parameters were optimized by Cygan {\it et
1345     al.}\cite{Cygan04} on the basis of known mineral structures, and
1346     partial atomic charges were derived from periodic DFT quantum chemical
1347     calculations of simple oxide, hydroxide, and oxyhydroxide model
1348     compounds with well-defined structures.
1349    
1350    
1351     \section{\label{section:electrostatics}Electrostatics}
1352    
1353     To aid in performing simulations in more traditional force fields, we
1354     have added routines to carry out electrostatic interactions using a
1355     number of different electrostatic summation methods. These methods
1356     are extended from the damped and cutoff-neutralized Coulombic sum
1357     originally proposed by Wolf, {\it et al.}\cite{Wolf99} One of these,
1358     the damped shifted force method, shows a remarkable ability to
1359     reproduce the energetic and dynamic characteristics exhibited by
1360     simulations employing lattice summation techniques. The basic idea is
1361     to construct well-behaved real-space summation methods using two tricks:
1362     \begin{enumerate}
1363     \item shifting through the use of image charges, and
1364     \item damping the electrostatic interaction.
1365     \end{enumerate}
1366     Starting with the original observation that the effective range of the
1367     electrostatic interaction in condensed phases is considerably less
1368     than $r^{-1}$, either the cutoff sphere neutralization or the
1369     distance-dependent damping technique could be used as a foundation for
1370     a new pairwise summation method. Wolf \textit{et al.} made the
1371     observation that charge neutralization within the cutoff sphere plays
1372     a significant role in energy convergence; therefore we will begin our
1373     analysis with the various shifted forms that maintain this charge
1374     neutralization. We can evaluate the methods of Wolf
1375     \textit{et al.} and Zahn \textit{et al.} by considering the standard
1376     shifted potential,
1377     \begin{equation}
1378     V_\textrm{SP}(r) = \begin{cases}
1379     v(r)-v_\textrm{c} &\quad r\leqslant R_\textrm{c} \\ 0 &\quad r >
1380     R_\textrm{c}
1381     \end{cases},
1382     \label{eq:shiftingPotForm}
1383     \end{equation}
1384     and shifted force,
1385     \begin{equation}
1386     V_\textrm{SF}(r) = \begin{cases}
1387     v(r)-v_\textrm{c}-\left(\frac{d v(r)}{d r}\right)_{r=R_\textrm{c}}(r-R_\textrm{c
1388     })
1389     &\quad r\leqslant R_\textrm{c} \\ 0 &\quad r > R_\textrm{c}
1390     \end{cases},
1391     \label{eq:shiftingForm}
1392     \end{equation}
1393     functions where $v(r)$ is the unshifted form of the potential, and
1394     $v_c$ is $v(R_\textrm{c})$. The Shifted Force ({\sc sf}) form ensures
1395     that both the potential and the forces goes to zero at the cutoff
1396     radius, while the Shifted Potential ({\sc sp}) form only ensures the
1397     potential is smooth at the cutoff radius
1398     ($R_\textrm{c}$).\cite{Allen87}
1399    
1400     The forces associated with the shifted potential are simply the forces
1401     of the unshifted potential itself (when inside the cutoff sphere),
1402     \begin{equation}
1403     F_{\textrm{SP}} = -\left( \frac{d v(r)}{dr} \right),
1404     \end{equation}
1405     and are zero outside. Inside the cutoff sphere, the forces associated
1406     with the shifted force form can be written,
1407     \begin{equation}
1408     F_{\textrm{SF}} = -\left( \frac{d v(r)}{dr} \right) + \left(\frac{d
1409     v(r)}{dr} \right)_{r=R_\textrm{c}}.
1410     \end{equation}
1411    
1412     If the potential, $v(r)$, is taken to be the normal Coulomb potential,
1413     \begin{equation}
1414     v(r) = \frac{q_i q_j}{r},
1415     \label{eq:Coulomb}
1416     \end{equation}
1417     then the Shifted Potential ({\sc sp}) forms will give Wolf {\it et
1418     al.}'s undamped prescription:
1419     \begin{equation}
1420     V_\textrm{SP}(r) =
1421     q_iq_j\left(\frac{1}{r}-\frac{1}{R_\textrm{c}}\right) \quad
1422     r\leqslant R_\textrm{c},
1423     \label{eq:SPPot}
1424     \end{equation}
1425     with associated forces,
1426     \begin{equation}
1427     F_\textrm{SP}(r) = q_iq_j\left(\frac{1}{r^2}\right) \quad r\leqslant R_\textrm{c
1428     }.
1429     \label{eq:SPForces}
1430     \end{equation}
1431     These forces are identical to the forces of the standard Coulomb
1432     interaction, and cutting these off at $R_c$ was addressed by Wolf
1433     \textit{et al.} as undesirable. They pointed out that the effect of
1434     the image charges is neglected in the forces when this form is
1435     used,\cite{Wolf99} thereby eliminating any benefit from the method in
1436     molecular dynamics. Additionally, there is a discontinuity in the
1437     forces at the cutoff radius which results in energy drift during MD
1438     simulations.
1439    
1440     The shifted force ({\sc sf}) form using the normal Coulomb potential
1441     will give,
1442     \begin{equation}
1443     V_\textrm{SF}(r) = q_iq_j\left[\frac{1}{r}-\frac{1}{R_\textrm{c}}+\left(\frac{1}
1444     {R_\textrm{c}^2}\right)(r-R_\textrm{c})\right] \quad r\leqslant R_\textrm{c}.
1445     \label{eq:SFPot}
1446     \end{equation}
1447     with associated forces,
1448     \begin{equation}
1449     F_\textrm{SF}(r) = q_iq_j\left(\frac{1}{r^2}-\frac{1}{R_\textrm{c}^2}\right) \quad r\leqslant R_\textrm{c}.
1450     \label{eq:SFForces}
1451     \end{equation}
1452     This formulation has the benefits that there are no discontinuities at
1453     the cutoff radius, while the neutralizing image charges are present in
1454     both the energy and force expressions. It would be simple to add the
1455     self-neutralizing term back when computing the total energy of the
1456     system, thereby maintaining the agreement with the Madelung energies.
1457     A side effect of this treatment is the alteration in the shape of the
1458     potential that comes from the derivative term. Thus, a degree of
1459     clarity about agreement with the empirical potential is lost in order
1460     to gain functionality in dynamics simulations.
1461    
1462     Wolf \textit{et al.} originally discussed the energetics of the
1463     shifted Coulomb potential (Eq. \ref{eq:SPPot}) and found that it was
1464     insufficient for accurate determination of the energy with reasonable
1465     cutoff distances. The calculated Madelung energies fluctuated around
1466     the expected value as the cutoff radius was increased, but the
1467     oscillations converged toward the correct value.\cite{Wolf99} A
1468     damping function was incorporated to accelerate the convergence; and
1469     though alternative forms for the damping function could be
1470     used,\cite{Jones56,Heyes81} the complimentary error function was
1471     chosen to mirror the effective screening used in the Ewald summation.
1472     Incorporating this error function damping into the simple Coulomb
1473     potential,
1474     \begin{equation}
1475     v(r) = \frac{\mathrm{erfc}\left(\alpha r\right)}{r},
1476     \label{eq:dampCoulomb}
1477     \end{equation}
1478     the shifted potential (eq. (\ref{eq:SPPot})) becomes
1479     \begin{equation}
1480     V_{\textrm{DSP}}(r) = q_iq_j\left(\frac{\textrm{erfc}\left(\alpha r\right)}{r}-\
1481     frac{\textrm{erfc}\left(\alpha R_\textrm{c}\right)}{R_\textrm{c}}\right) \quad r
1482     \leqslant R_\textrm{c},
1483     \label{eq:DSPPot}
1484     \end{equation}
1485     with associated forces,
1486     \begin{equation}
1487     F_{\textrm{DSP}}(r) = q_iq_j\left(\frac{\textrm{erfc}\left(\alpha r\right)}{r^2}
1488     +\frac{2\alpha}{\pi^{1/2}}\frac{\exp{\left(-\alpha^2r^2\right)}}{r}\right) \quad
1489     r\leqslant R_\textrm{c}.
1490     \label{eq:DSPForces}
1491     \end{equation}
1492     Again, this damped shifted potential suffers from a
1493     force-discontinuity at the cutoff radius, and the image charges play
1494     no role in the forces. To remedy these concerns, one may derive a
1495     {\sc sf} variant by including the derivative term in
1496     eq. (\ref{eq:shiftingForm}),
1497     \begin{equation}
1498     \begin{split}
1499     V_\mathrm{DSF}(r) = q_iq_j\Biggr{[} & \frac{\mathrm{erfc}\left(\alpha r \right)}{r} -\frac{\mathrm{erfc}\left(\alpha R_\mathrm{c} \right) }{R_\mathrm{c}} \\
1500     & \left. +\left(\frac{\mathrm{erfc}\left(\alpha
1501     R_\mathrm{c}\right)}{R_\mathrm{c}^2}+\frac{2\alpha}{\pi^{1/2}}\frac{\exp\left(-\alpha^2R_\mathrm{c}^2\right)}{R_\mathrm{c}}\right)\left(r-R_\mathrm{c}\right)
1502     \right] \quad r\leqslant R_\textrm{c}
1503     \label{eq:DSFPot}
1504     \end{split}
1505     \end{equation}
1506     The derivative of the above potential will lead to the following forces,
1507     \begin{equation}
1508     \begin{split}
1509     F_\mathrm{DSF}(r) =
1510     q_iq_j\Biggr{[}&\left(\frac{\textrm{erfc}\left(\alpha r\right)}{r^2}+\frac{2\alpha}{\pi^{1/2}}\frac{\exp{\left(-\alpha^2r^2\right)}}{r}\right) \\ &\left.-\left(\frac{\textrm{erfc}\left(\alpha R_{\textrm{c}}\right)}{R_{\textrm{c}}^2}+\frac{2\alpha}{\pi^{1/2}}\frac{\exp{\left(-\alpha^2R_{\textrm{c}}^2
1511     \right)}}{R_{\textrm{c}}}\right)\right] \quad r\leqslant R_\textrm{c}.
1512     \label{eq:DSFForces}
1513     \end{split}
1514     \end{equation}
1515     If the damping parameter $(\alpha)$ is set to zero, the undamped case,
1516     eqs. (\ref{eq:SPPot} through \ref{eq:SFForces}) are correctly
1517     recovered from eqs. (\ref{eq:DSPPot} through \ref{eq:DSFForces}).
1518    
1519     It has been shown that the Damped Shifted Force method obtains nearly
1520     identical behavior to the smooth particle mesh Ewald ({\sc spme})
1521     method on a number of commonly simulated systems.\cite{Fennell06} For
1522     this reason, the default electrostatic summation method utilized by
1523     {\sc OpenMD} is the DSF (Eq. \ref{eq:DSFPot}) with a damping parameter
1524     ($\alpha$) that is set algorithmically from the cutoff radius.
1525    
1526     \section{\label{section:pbc}Periodic Boundary Conditions}
1527    
1528     \newcommand{\roundme}{\operatorname{round}}
1529    
1530     \textit{Periodic boundary conditions} are widely used to simulate bulk
1531     properties with a relatively small number of particles. In this method
1532     the simulation box is replicated throughout space to form an infinite
1533     lattice. During the simulation, when a particle moves in the primary
1534     cell, its image in other cells move in exactly the same direction with
1535     exactly the same orientation. Thus, as a particle leaves the primary
1536     cell, one of its images will enter through the opposite face. If the
1537     simulation box is large enough to avoid ``feeling'' the symmetries of
1538     the periodic lattice, surface effects can be ignored. The available
1539     periodic cells in {\sc OpenMD} are cubic, orthorhombic and
1540     parallelepiped. {\sc OpenMD} use a $3 \times 3$ matrix, $\mathsf{H}$,
1541     to describe the shape and size of the simulation box. $\mathsf{H}$ is
1542     defined:
1543     \begin{equation}
1544     \mathsf{H} = ( \mathbf{h}_x, \mathbf{h}_y, \mathbf{h}_z ),
1545     \end{equation}
1546     where $\mathbf{h}_{\alpha}$ is the column vector of the $\alpha$ axis of the
1547     box. During the course of the simulation both the size and shape of
1548     the box can be changed to allow volume fluctuations when constraining
1549     the pressure.
1550    
1551     A real space vector, $\mathbf{r}$ can be transformed in to a box space
1552     vector, $\mathbf{s}$, and back through the following transformations:
1553     \begin{align}
1554     \mathbf{s} &= \mathsf{H}^{-1} \mathbf{r}, \\
1555     \mathbf{r} &= \mathsf{H} \mathbf{s}.
1556     \end{align}
1557     The vector $\mathbf{s}$ is now a vector expressed as the number of box
1558     lengths in the $\mathbf{h}_x$, $\mathbf{h}_y$, and $\mathbf{h}_z$
1559     directions. To find the minimum image of a vector $\mathbf{r}$, {\sc
1560     OpenMD} first converts it to its corresponding vector in box space, and
1561     then casts each element to lie in the range $[-0.5,0.5]$:
1562     \begin{equation}
1563     s_{i}^{\prime}=s_{i}-\roundme(s_{i}),
1564     \end{equation}
1565     where $s_i$ is the $i$th element of $\mathbf{s}$, and
1566     $\roundme(s_i)$ is given by
1567     \begin{equation}
1568     \roundme(x) =
1569     \begin{cases}
1570     \lfloor x+0.5 \rfloor & \text{if $x \ge 0$,} \\
1571     \lceil x-0.5 \rceil & \text{if $x < 0$.}
1572     \end{cases}
1573     \end{equation}
1574     Here $\lfloor x \rfloor$ is the floor operator, and gives the largest
1575     integer value that is not greater than $x$, and $\lceil x \rceil$ is
1576     the ceiling operator, and gives the smallest integer that is not less
1577     than $x$.
1578    
1579     Finally, the minimum image coordinates $\mathbf{r}^{\prime}$ are
1580     obtained by transforming back to real space,
1581     \begin{equation}
1582     \mathbf{r}^{\prime}=\mathsf{H}^{-1}\mathbf{s}^{\prime}.%
1583     \end{equation}
1584     In this way, particles are allowed to diffuse freely in $\mathbf{r}$,
1585     but their minimum images, or $\mathbf{r}^{\prime}$, are used to compute
1586     the inter-atomic forces.
1587    
1588     \chapter{\label{section:mechanics}Mechanics}
1589    
1590     \section{\label{section:integrate}Integrating the Equations of Motion: the
1591     {\sc dlm} method}
1592    
1593     The default method for integrating the equations of motion in {\sc
1594     OpenMD} is a velocity-Verlet version of the symplectic splitting method
1595     proposed by Dullweber, Leimkuhler and McLachlan
1596     ({\sc dlm}).\cite{Dullweber1997} When there are no directional atoms or
1597     rigid bodies present in the simulation, this integrator becomes the
1598     standard velocity-Verlet integrator which is known to sample the
1599     microcanonical (NVE) ensemble.\cite{Frenkel1996}
1600    
1601     Previous integration methods for orientational motion have problems
1602     that are avoided in the {\sc dlm} method. Direct propagation of the Euler
1603     angles has a known $1/\sin\theta$ divergence in the equations of
1604     motion for $\phi$ and $\psi$,\cite{Allen87} leading to numerical
1605     instabilities any time one of the directional atoms or rigid bodies
1606     has an orientation near $\theta=0$ or $\theta=\pi$. Quaternion-based
1607     integration methods work well for propagating orientational motion;
1608     however, energy conservation concerns arise when using the
1609     microcanonical (NVE) ensemble. An earlier implementation of {\sc
1610     OpenMD} utilized quaternions for propagation of rotational motion;
1611     however, a detailed investigation showed that they resulted in a
1612     steady drift in the total energy, something that has been observed by
1613     Laird {\it et al.}\cite{Laird97}
1614    
1615     The key difference in the integration method proposed by Dullweber
1616     \emph{et al.} is that the entire $3 \times 3$ rotation matrix is
1617     propagated from one time step to the next. In the past, this would not
1618     have been feasible, since the rotation matrix for a single body has
1619     nine elements compared with the more memory-efficient methods (using
1620     three Euler angles or 4 quaternions). Computer memory has become much
1621     less costly in recent years, and this can be translated into
1622     substantial benefits in energy conservation.
1623    
1624     The basic equations of motion being integrated are derived from the
1625     Hamiltonian for conservative systems containing rigid bodies,
1626     \begin{equation}
1627     H = \sum_{i} \left( \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i +
1628     \frac{1}{2} {\bf j}_i^T \cdot \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot
1629     {\bf j}_i \right) +
1630     V\left(\left\{{\bf r}\right\}, \left\{\mathsf{A}\right\}\right),
1631     \end{equation}
1632     where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian position vector
1633     and velocity of the center of mass of particle $i$, and ${\bf j}_i$,
1634     $\overleftrightarrow{\mathsf{I}}_i$ are the body-fixed angular
1635     momentum and moment of inertia tensor respectively, and the
1636     superscript $T$ denotes the transpose of the vector. $\mathsf{A}_i$
1637     is the $3 \times 3$ rotation matrix describing the instantaneous
1638     orientation of the particle. $V$ is the potential energy function
1639     which may depend on both the positions $\left\{{\bf r}\right\}$ and
1640     orientations $\left\{\mathsf{A}\right\}$ of all particles. The
1641     equations of motion for the particle centers of mass are derived from
1642     Hamilton's equations and are quite simple,
1643     \begin{eqnarray}
1644     \dot{{\bf r}} & = & {\bf v}, \\
1645     \dot{{\bf v}} & = & \frac{{\bf f}}{m},
1646     \end{eqnarray}
1647     where ${\bf f}$ is the instantaneous force on the center of mass
1648     of the particle,
1649     \begin{equation}
1650     {\bf f} = - \frac{\partial}{\partial
1651     {\bf r}} V(\left\{{\bf r}(t)\right\}, \left\{\mathsf{A}(t)\right\}).
1652     \end{equation}
1653    
1654     The equations of motion for the orientational degrees of freedom are
1655     \begin{eqnarray}
1656     \dot{\mathsf{A}} & = & \mathsf{A} \cdot
1657     \mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right),\\
1658     \dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1}
1659     \cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
1660     V}{\partial \mathsf{A}} \right).
1661     \end{eqnarray}
1662     In these equations of motion, the $\mbox{skew}$ matrix of a vector
1663     ${\bf v} = \left( v_1, v_2, v_3 \right)$ is defined:
1664     \begin{equation}
1665     \mbox{skew}\left( {\bf v} \right) := \left(
1666     \begin{array}{ccc}
1667     0 & v_3 & - v_2 \\
1668     -v_3 & 0 & v_1 \\
1669     v_2 & -v_1 & 0
1670     \end{array}
1671     \right).
1672     \end{equation}
1673     The $\mbox{rot}$ notation refers to the mapping of the $3 \times 3$
1674     rotation matrix to a vector of orientations by first computing the
1675     skew-symmetric part $\left(\mathsf{A} - \mathsf{A}^{T}\right)$ and
1676     then associating this with a length 3 vector by inverting the
1677     $\mbox{skew}$ function above:
1678     \begin{equation}
1679     \mbox{rot}\left(\mathsf{A}\right) := \mbox{ skew}^{-1}\left(\mathsf{A}
1680     - \mathsf{A}^{T} \right).
1681     \end{equation}
1682     Written this way, the $\mbox{rot}$ operation creates a set of
1683     conjugate angle coordinates to the body-fixed angular momenta
1684     represented by ${\bf j}$. This equation of motion for angular momenta
1685     is equivalent to the more familiar body-fixed forms,
1686     \begin{eqnarray}
1687     \dot{j_{x}} & = & \tau^b_x(t) -
1688     \left(\overleftrightarrow{\mathsf{I}}_{yy}^{-1} - \overleftrightarrow{\mathsf{I}}_{zz}^{-1} \right) j_y j_z, \\
1689     \dot{j_{y}} & = & \tau^b_y(t) -
1690     \left(\overleftrightarrow{\mathsf{I}}_{zz}^{-1} - \overleftrightarrow{\mathsf{I}}_{xx}^{-1} \right) j_z j_x,\\
1691     \dot{j_{z}} & = & \tau^b_z(t) -
1692     \left(\overleftrightarrow{\mathsf{I}}_{xx}^{-1} - \overleftrightarrow{\mathsf{I}}_{yy}^{-1} \right) j_x j_y,
1693     \end{eqnarray}
1694     which utilize the body-fixed torques, ${\bf \tau}^b$. Torques are
1695     most easily derived in the space-fixed frame,
1696     \begin{equation}
1697     {\bf \tau}^b(t) = \mathsf{A}(t) \cdot {\bf \tau}^s(t),
1698     \end{equation}
1699     where the torques are either derived from the forces on the
1700     constituent atoms of the rigid body, or for directional atoms,
1701     directly from derivatives of the potential energy,
1702     \begin{equation}
1703     {\bf \tau}^s(t) = - \hat{\bf u}(t) \times \left( \frac{\partial}
1704     {\partial \hat{\bf u}} V\left(\left\{ {\bf r}(t) \right\}, \left\{
1705     \mathsf{A}(t) \right\}\right) \right).
1706     \end{equation}
1707     Here $\hat{\bf u}$ is a unit vector pointing along the principal axis
1708     of the particle in the space-fixed frame.
1709    
1710     The {\sc dlm} method uses a Trotter factorization of the orientational
1711     propagator. This has three effects:
1712     \begin{enumerate}
1713     \item the integrator is area-preserving in phase space (i.e. it is
1714     {\it symplectic}),
1715     \item the integrator is time-{\it reversible}, making it suitable for Hybrid
1716     Monte Carlo applications, and
1717     \item the error for a single time step is of order $\mathcal{O}\left(h^4\right)$
1718     for timesteps of length $h$.
1719     \end{enumerate}
1720    
1721     The integration of the equations of motion is carried out in a
1722     velocity-Verlet style 2-part algorithm, where $h= \delta t$:
1723    
1724     {\tt moveA:}
1725     \begin{align*}
1726     {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
1727     + \frac{h}{2} \left( {\bf f}(t) / m \right), \\
1728     %
1729     {\bf r}(t + h) &\leftarrow {\bf r}(t)
1730     + h {\bf v}\left(t + h / 2 \right), \\
1731     %
1732     {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
1733     + \frac{h}{2} {\bf \tau}^b(t), \\
1734     %
1735     \mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left( h {\bf j}
1736     (t + h / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} \right).
1737     \end{align*}
1738    
1739     In this context, the $\mathrm{rotate}$ function is the reversible product
1740     of the three body-fixed rotations,
1741     \begin{equation}
1742     \mathrm{rotate}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot
1743     \mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y /
1744     2) \cdot \mathsf{G}_x(a_x /2),
1745     \end{equation}
1746     where each rotational propagator, $\mathsf{G}_\alpha(\theta)$, rotates
1747     both the rotation matrix ($\mathsf{A}$) and the body-fixed angular
1748     momentum (${\bf j}$) by an angle $\theta$ around body-fixed axis
1749     $\alpha$,
1750     \begin{equation}
1751     \mathsf{G}_\alpha( \theta ) = \left\{
1752     \begin{array}{lcl}
1753     \mathsf{A}(t) & \leftarrow & \mathsf{A}(0) \cdot \mathsf{R}_\alpha(\theta)^T, \\
1754     {\bf j}(t) & \leftarrow & \mathsf{R}_\alpha(\theta) \cdot {\bf j}(0).
1755     \end{array}
1756     \right.
1757     \end{equation}
1758     $\mathsf{R}_\alpha$ is a quadratic approximation to
1759     the single-axis rotation matrix. For example, in the small-angle
1760     limit, the rotation matrix around the body-fixed x-axis can be
1761     approximated as
1762     \begin{equation}
1763     \mathsf{R}_x(\theta) \approx \left(
1764     \begin{array}{ccc}
1765     1 & 0 & 0 \\
1766     0 & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} & -\frac{\theta}{1+
1767     \theta^2 / 4} \\
1768     0 & \frac{\theta}{1+
1769     \theta^2 / 4} & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4}
1770     \end{array}
1771     \right).
1772     \end{equation}
1773     All other rotations follow in a straightforward manner.
1774    
1775     After the first part of the propagation, the forces and body-fixed
1776     torques are calculated at the new positions and orientations
1777    
1778     {\tt doForces:}
1779     \begin{align*}
1780     {\bf f}(t + h) &\leftarrow
1781     - \left(\frac{\partial V}{\partial {\bf r}}\right)_{{\bf r}(t + h)}, \\
1782     %
1783     {\bf \tau}^{s}(t + h) &\leftarrow {\bf u}(t + h)
1784     \times \frac{\partial V}{\partial {\bf u}}, \\
1785     %
1786     {\bf \tau}^{b}(t + h) &\leftarrow \mathsf{A}(t + h)
1787     \cdot {\bf \tau}^s(t + h).
1788     \end{align*}
1789    
1790     {\sc OpenMD} automatically updates ${\bf u}$ when the rotation matrix
1791     $\mathsf{A}$ is calculated in {\tt moveA}. Once the forces and
1792     torques have been obtained at the new time step, the velocities can be
1793     advanced to the same time value.
1794    
1795     {\tt moveB:}
1796     \begin{align*}
1797     {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + h / 2 \right)
1798     + \frac{h}{2} \left( {\bf f}(t + h) / m \right), \\
1799     %
1800     {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t + h / 2 \right)
1801     + \frac{h}{2} {\bf \tau}^b(t + h) .
1802     \end{align*}
1803    
1804     The matrix rotations used in the {\sc dlm} method end up being more
1805     costly computationally than the simpler arithmetic quaternion
1806     propagation. With the same time step, a 1024-molecule water simulation
1807     incurs an average 12\% increase in computation time using the {\sc
1808     dlm} method in place of quaternions. This cost is more than justified
1809     when comparing the energy conservation achieved by the two
1810     methods. Figure ~\ref{quatdlm} provides a comparative analysis of the
1811     {\sc dlm} method versus the traditional quaternion scheme.
1812    
1813     \begin{figure}
1814     \centering
1815     \includegraphics[width=\linewidth]{quatvsdlm.pdf}
1816     \caption[Energy conservation analysis of the {\sc dlm} and quaternion
1817     integration methods]{Analysis of the energy conservation of the {\sc
1818     dlm} and quaternion integration methods. $\delta \mathrm{E}_1$ is the
1819     linear drift in energy over time and $\delta \mathrm{E}_0$ is the
1820     standard deviation of energy fluctuations around this drift. All
1821     simulations were of a 1024-molecule simulation of SSD water at 298 K
1822     starting from the same initial configuration. Note that the {\sc dlm}
1823     method provides more than an order of magnitude improvement in both
1824     the energy drift and the size of the energy fluctuations when compared
1825     with the quaternion method at any given time step. At time steps
1826     larger than 4 fs, the quaternion scheme resulted in rapidly rising
1827     energies which eventually lead to simulation failure. Using the {\sc
1828     dlm} method, time steps up to 8 fs can be taken before this behavior
1829     is evident.}
1830     \label{quatdlm}
1831     \end{figure}
1832    
1833     In Fig.~\ref{quatdlm}, $\delta \mbox{E}_1$ is a measure of the linear
1834     energy drift in units of $\mbox{kcal mol}^{-1}$ per particle over a
1835     nanosecond of simulation time, and $\delta \mbox{E}_0$ is the standard
1836     deviation of the energy fluctuations in units of $\mbox{kcal
1837     mol}^{-1}$ per particle. In the top plot, it is apparent that the
1838     energy drift is reduced by a significant amount (2 to 3 orders of
1839     magnitude improvement at all tested time steps) by chosing the {\sc
1840     dlm} method over the simple non-symplectic quaternion integration
1841     method. In addition to this improvement in energy drift, the
1842     fluctuations in the total energy are also dampened by 1 to 2 orders of
1843     magnitude by utilizing the {\sc dlm} method.
1844    
1845     Although the {\sc dlm} method is more computationally expensive than
1846     the traditional quaternion scheme for propagating a single time step,
1847     consideration of the computational cost for a long simulation with a
1848     particular level of energy conservation is in order. A plot of energy
1849     drift versus computational cost was generated
1850     (Fig.~\ref{cpuCost}). This figure provides an estimate of the CPU time
1851     required under the two integration schemes for 1 nanosecond of
1852     simulation time for the model 1024-molecule system. By chosing a
1853     desired energy drift value it is possible to determine the CPU time
1854     required for both methods. If a $\delta \mbox{E}_1$ of $1 \times
1855     10^{-3} \mbox{kcal mol}^{-1}$ per particle is desired, a nanosecond of
1856     simulation time will require ~19 hours of CPU time with the {\sc dlm}
1857     integrator, while the quaternion scheme will require ~154 hours of CPU
1858     time. This demonstrates the computational advantage of the integration
1859     scheme utilized in {\sc OpenMD}.
1860    
1861     \begin{figure}
1862     \centering
1863     \includegraphics[width=\linewidth]{compCost.pdf}
1864     \caption[Energy drift as a function of required simulation run
1865     time]{Energy drift as a function of required simulation run time.
1866     $\delta \mathrm{E}_1$ is the linear drift in energy over time.
1867     Simulations were performed on a single 2.5 GHz Pentium 4
1868     processor. Simulation time comparisons can be made by tracing
1869     horizontally from one curve to the other. For example, a simulation
1870     that takes ~24 hours using the {\sc dlm} method will take roughly 210
1871     hours using the simple quaternion method if the same degree of energy
1872     conservation is desired.}
1873     \label{cpuCost}
1874     \end{figure}
1875    
1876     There is only one specific keyword relevant to the default integrator,
1877     and that is the time step for integrating the equations of motion.
1878    
1879     \begin{center}
1880     \begin{tabular}{llll}
1881     {\bf variable} & {\bf Meta-data keyword} & {\bf units} & {\bf
1882     default value} \\
1883     $h$ & {\tt dt = 2.0;} & fs & none
1884     \end{tabular}
1885     \end{center}
1886    
1887     \section{\label{sec:extended}Extended Systems for other Ensembles}
1888    
1889     {\sc OpenMD} implements a number of extended system integrators for
1890     sampling from other ensembles relevant to chemical physics. The
1891     integrator can be selected with the {\tt ensemble} keyword in the
1892     meta-data file:
1893    
1894     \begin{center}
1895     \begin{tabular}{lll}
1896     {\bf Integrator} & {\bf Ensemble} & {\bf Meta-data instruction} \\
1897     NVE & microcanonical & {\tt ensemble = NVE; } \\
1898     NVT & canonical & {\tt ensemble = NVT; } \\
1899     NPTi & isobaric-isothermal & {\tt ensemble = NPTi;} \\
1900     & (with isotropic volume changes) & \\
1901     NPTf & isobaric-isothermal & {\tt ensemble = NPTf;} \\
1902     & (with changes to box shape) & \\
1903     NPTxyz & approximate isobaric-isothermal & {\tt ensemble = NPTxyz;} \\
1904     & (with separate barostats on each box dimension) & \\
1905     LD & Langevin Dynamics & {\tt ensemble = LD;} \\
1906     & (approximates the effects of an implicit solvent) & \\
1907 gezelter 3709 LangevinHull & Non-periodic Langevin Dynamics & {\tt ensemble = LangevinHull;} \\
1908 kstocke1 3708 & (Langevin Dynamics for molecules on convex hull;\\
1909     & Newtonian for interior molecules) & \\
1910 gezelter 3607 \end{tabular}
1911     \end{center}
1912    
1913     The relatively well-known Nos\'e-Hoover thermostat\cite{Hoover85} is
1914     implemented in {\sc OpenMD}'s NVT integrator. This method couples an
1915     extra degree of freedom (the thermostat) to the kinetic energy of the
1916     system and it has been shown to sample the canonical distribution in
1917     the system degrees of freedom while conserving a quantity that is, to
1918     within a constant, the Helmholtz free energy.\cite{melchionna93}
1919    
1920     NPT algorithms attempt to maintain constant pressure in the system by
1921     coupling the volume of the system to a barostat. {\sc OpenMD} contains
1922     three different constant pressure algorithms. The first two, NPTi and
1923     NPTf have been shown to conserve a quantity that is, to within a
1924     constant, the Gibbs free energy.\cite{melchionna93} The Melchionna
1925     modification to the Hoover barostat is implemented in both NPTi and
1926     NPTf. NPTi allows only isotropic changes in the simulation box, while
1927     box {\it shape} variations are allowed in NPTf. The NPTxyz integrator
1928     has {\it not} been shown to sample from the isobaric-isothermal
1929     ensemble. It is useful, however, in that it maintains orthogonality
1930     for the axes of the simulation box while attempting to equalize
1931     pressure along the three perpendicular directions in the box.
1932    
1933     Each of the extended system integrators requires additional keywords
1934     to set target values for the thermodynamic state variables that are
1935     being held constant. Keywords are also required to set the
1936     characteristic decay times for the dynamics of the extended
1937     variables.
1938    
1939     \begin{center}
1940     \begin{tabular}{llll}
1941     {\bf variable} & {\bf Meta-data instruction} & {\bf units} & {\bf
1942     default value} \\
1943     $T_{\mathrm{target}}$ & {\tt targetTemperature = 300;} & K & none \\
1944     $P_{\mathrm{target}}$ & {\tt targetPressure = 1;} & atm & none \\
1945     $\tau_T$ & {\tt tauThermostat = 1e3;} & fs & none \\
1946     $\tau_B$ & {\tt tauBarostat = 5e3;} & fs & none \\
1947     & {\tt resetTime = 200;} & fs & none \\
1948     & {\tt useInitialExtendedSystemState = true;} & logical &
1949     true
1950     \end{tabular}
1951     \end{center}
1952    
1953     Two additional keywords can be used to either clear the extended
1954     system variables periodically ({\tt resetTime}), or to maintain the
1955     state of the extended system variables between simulations ({\tt
1956     useInitialExtendedSystemState}). More details on these variables
1957     and their use in the integrators follows below.
1958    
1959     \section{\label{section:noseHooverThermo}Nos\'{e}-Hoover Thermostatting}
1960    
1961     The Nos\'e-Hoover equations of motion are given by\cite{Hoover85}
1962     \begin{eqnarray}
1963     \dot{{\bf r}} & = & {\bf v}, \\
1964     \dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v} ,\\
1965     \dot{\mathsf{A}} & = & \mathsf{A} \cdot
1966     \mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right), \\
1967     \dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1}
1968     \cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
1969     V}{\partial \mathsf{A}} \right) - \chi {\bf j}.
1970     \label{eq:nosehoovereom}
1971     \end{eqnarray}
1972    
1973     $\chi$ is an ``extra'' variable included in the extended system, and
1974     it is propagated using the first order equation of motion
1975     \begin{equation}
1976     \dot{\chi} = \frac{1}{\tau_{T}^2} \left( \frac{T}{T_{\mathrm{target}}} - 1 \right).
1977     \label{eq:nosehooverext}
1978     \end{equation}
1979    
1980     The instantaneous temperature $T$ is proportional to the total kinetic
1981     energy (both translational and orientational) and is given by
1982     \begin{equation}
1983     T = \frac{2 K}{f k_B}
1984     \end{equation}
1985     Here, $f$ is the total number of degrees of freedom in the system,
1986     \begin{equation}
1987     f = 3 N + 2 N_{\mathrm{linear}} + 3 N_{\mathrm{non-linear}} - N_{\mathrm{constraints}},
1988     \end{equation}
1989     and $K$ is the total kinetic energy,
1990     \begin{equation}
1991     K = \sum_{i=1}^{N} \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i +
1992     \sum_{i=1}^{N_{\mathrm{linear}}+N_{\mathrm{non-linear}}} \frac{1}{2} {\bf j}_i^T \cdot
1993     \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot {\bf j}_i.
1994     \end{equation}
1995     $N_{\mathrm{linear}}$ is the number of linear rotors (i.e. with two
1996     non-zero moments of inertia), and $N_{\mathrm{non-linear}}$ is the
1997     number of non-linear rotors (i.e. with three non-zero moments of
1998     inertia).
1999    
2000     In eq.(\ref{eq:nosehooverext}), $\tau_T$ is the time constant for
2001     relaxation of the temperature to the target value. To set values for
2002     $\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one would use the
2003     {\tt tauThermostat} and {\tt targetTemperature} keywords in the
2004     meta-data file. The units for {\tt tauThermostat} are fs, and the
2005     units for the {\tt targetTemperature} are degrees K. The integration
2006     of the equations of motion is carried out in a velocity-Verlet style 2
2007     part algorithm:
2008    
2009     {\tt moveA:}
2010     \begin{align*}
2011     T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\
2012     %
2013     {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
2014     + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t)
2015     \chi(t)\right), \\
2016     %
2017     {\bf r}(t + h) &\leftarrow {\bf r}(t)
2018     + h {\bf v}\left(t + h / 2 \right) ,\\
2019     %
2020     {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
2021     + \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
2022     \chi(t) \right) ,\\
2023     %
2024     \mathsf{A}(t + h) &\leftarrow \mathrm{rotate}
2025     \left(h * {\bf j}(t + h / 2)
2026     \overleftrightarrow{\mathsf{I}}^{-1} \right) ,\\
2027     %
2028     \chi\left(t + h / 2 \right) &\leftarrow \chi(t)
2029     + \frac{h}{2 \tau_T^2} \left( \frac{T(t)}
2030     {T_{\mathrm{target}}} - 1 \right) .
2031     \end{align*}
2032    
2033     Here $\mathrm{rotate}(h * {\bf j}
2034     \overleftrightarrow{\mathsf{I}}^{-1})$ is the same symplectic Trotter
2035     factorization of the three rotation operations that was discussed in
2036     the section on the {\sc dlm} integrator. Note that this operation modifies
2037     both the rotation matrix $\mathsf{A}$ and the angular momentum ${\bf
2038     j}$. {\tt moveA} propagates velocities by a half time step, and
2039     positional degrees of freedom by a full time step. The new positions
2040     (and orientations) are then used to calculate a new set of forces and
2041     torques in exactly the same way they are calculated in the {\tt
2042     doForces} portion of the {\sc dlm} integrator.
2043    
2044     Once the forces and torques have been obtained at the new time step,
2045     the temperature, velocities, and the extended system variable can be
2046     advanced to the same time value.
2047    
2048     {\tt moveB:}
2049     \begin{align*}
2050     T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\},
2051     \left\{{\bf j}(t + h)\right\}, \\
2052     %
2053     \chi\left(t + h \right) &\leftarrow \chi\left(t + h /
2054     2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+h)}
2055     {T_{\mathrm{target}}} - 1 \right), \\
2056     %
2057     {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t
2058     + h / 2 \right) + \frac{h}{2} \left(
2059     \frac{{\bf f}(t + h)}{m} - {\bf v}(t + h)
2060     \chi(t h)\right) ,\\
2061     %
2062     {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t
2063     + h / 2 \right) + \frac{h}{2}
2064     \left( {\bf \tau}^b(t + h) - {\bf j}(t + h)
2065     \chi(t + h) \right) .
2066     \end{align*}
2067    
2068     Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required to calculate
2069     $T(t + h)$ as well as $\chi(t + h)$, they indirectly depend on their
2070     own values at time $t + h$. {\tt moveB} is therefore done in an
2071     iterative fashion until $\chi(t + h)$ becomes self-consistent. The
2072     relative tolerance for the self-consistency check defaults to a value
2073     of $\mbox{10}^{-6}$, but {\sc OpenMD} will terminate the iteration
2074     after 4 loops even if the consistency check has not been satisfied.
2075    
2076     The Nos\'e-Hoover algorithm is known to conserve a Hamiltonian for the
2077     extended system that is, to within a constant, identical to the
2078     Helmholtz free energy,\cite{melchionna93}
2079     \begin{equation}
2080     H_{\mathrm{NVT}} = V + K + f k_B T_{\mathrm{target}} \left(
2081     \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime
2082     \right).
2083     \end{equation}
2084     Poor choices of $h$ or $\tau_T$ can result in non-conservation
2085     of $H_{\mathrm{NVT}}$, so the conserved quantity is maintained in the
2086     last column of the {\tt .stat} file to allow checks on the quality of
2087     the integration.
2088    
2089     Bond constraints are applied at the end of both the {\tt moveA} and
2090     {\tt moveB} portions of the algorithm. Details on the constraint
2091     algorithms are given in section \ref{section:rattle}.
2092    
2093     \section{\label{sec:NPTi}Constant-pressure integration with
2094     isotropic box deformations (NPTi)}
2095    
2096     To carry out isobaric-isothermal ensemble calculations, {\sc OpenMD}
2097     implements the Melchionna modifications to the Nos\'e-Hoover-Andersen
2098     equations of motion.\cite{melchionna93} The equations of motion are
2099     the same as NVT with the following exceptions:
2100    
2101     \begin{eqnarray}
2102     \dot{{\bf r}} & = & {\bf v} + \eta \left( {\bf r} - {\bf R}_0 \right), \\
2103     \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\eta + \chi) {\bf v}, \\
2104     \dot{\eta} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V \left( P -
2105     P_{\mathrm{target}} \right), \\
2106     \dot{\mathcal{V}} & = & 3 \mathcal{V} \eta .
2107     \label{eq:melchionna1}
2108     \end{eqnarray}
2109    
2110     $\chi$ and $\eta$ are the ``extra'' degrees of freedom in the extended
2111     system. $\chi$ is a thermostat, and it has the same function as it
2112     does in the Nos\'e-Hoover NVT integrator. $\eta$ is a barostat which
2113     controls changes to the volume of the simulation box. ${\bf R}_0$ is
2114     the location of the center of mass for the entire system, and
2115     $\mathcal{V}$ is the volume of the simulation box. At any time, the
2116     volume can be calculated from the determinant of the matrix which
2117     describes the box shape:
2118     \begin{equation}
2119     \mathcal{V} = \det(\mathsf{H}).
2120     \end{equation}
2121    
2122     The NPTi integrator requires an instantaneous pressure. This quantity
2123     is calculated via the pressure tensor,
2124     \begin{equation}
2125     \overleftrightarrow{\mathsf{P}}(t) = \frac{1}{\mathcal{V}(t)} \left(
2126     \sum_{i=1}^{N} m_i {\bf v}_i(t) \otimes {\bf v}_i(t) \right) +
2127     \overleftrightarrow{\mathsf{W}}(t).
2128     \end{equation}
2129     The kinetic contribution to the pressure tensor utilizes the {\it
2130     outer} product of the velocities, denoted by the $\otimes$ symbol. The
2131     stress tensor is calculated from another outer product of the
2132     inter-atomic separation vectors (${\bf r}_{ij} = {\bf r}_j - {\bf
2133     r}_i$) with the forces between the same two atoms,
2134     \begin{equation}
2135     \overleftrightarrow{\mathsf{W}}(t) = \sum_{i} \sum_{j>i} {\bf r}_{ij}(t)
2136     \otimes {\bf f}_{ij}(t).
2137     \end{equation}
2138     In systems containing cutoff groups, the stress tensor is computed
2139     between the centers-of-mass of the cutoff groups:
2140     \begin{equation}
2141     \overleftrightarrow{\mathsf{W}}(t) = \sum_{a} \sum_{b} {\bf r}_{ab}(t)
2142     \otimes {\bf f}_{ab}(t).
2143     \end{equation}
2144     where ${\bf r}_{ab}$ is the distance between the centers of mass, and
2145     \begin{equation}
2146     {\bf f}_{ab} = s(r_{ab}) \sum_{i \in a} \sum_{j \in b} {\bf f}_{ij} +
2147     s^{\prime}(r_{ab}) \frac{{\bf r}_{ab}}{|r_{ab}|} \sum_{i \in a} \sum_{j
2148     \in b} V_{ij}({\bf r}_{ij}).
2149     \end{equation}
2150    
2151     The instantaneous pressure is then simply obtained from the trace of
2152     the pressure tensor,
2153     \begin{equation}
2154     P(t) = \frac{1}{3} \mathrm{Tr} \left( \overleftrightarrow{\mathsf{P}}(t)
2155     \right).
2156     \end{equation}
2157    
2158     In eq.(\ref{eq:melchionna1}), $\tau_B$ is the time constant for
2159     relaxation of the pressure to the target value. To set values for
2160     $\tau_B$ or $P_{\mathrm{target}}$ in a simulation, one would use the
2161     {\tt tauBarostat} and {\tt targetPressure} keywords in the meta-data
2162     file. The units for {\tt tauBarostat} are fs, and the units for the
2163     {\tt targetPressure} are atmospheres. Like in the NVT integrator, the
2164     integration of the equations of motion is carried out in a
2165     velocity-Verlet style two part algorithm with only the following
2166     differences:
2167    
2168     {\tt moveA:}
2169     \begin{align*}
2170     P(t) &\leftarrow \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\} ,\\
2171     %
2172     {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
2173     + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t)
2174     \left(\chi(t) + \eta(t) \right) \right), \\
2175     %
2176     \eta(t + h / 2) &\leftarrow \eta(t) + \frac{h
2177     \mathcal{V}(t)}{2 N k_B T(t) \tau_B^2} \left( P(t)
2178     - P_{\mathrm{target}} \right), \\
2179     %
2180     {\bf r}(t + h) &\leftarrow {\bf r}(t) + h
2181     \left\{ {\bf v}\left(t + h / 2 \right)
2182     + \eta(t + h / 2)\left[ {\bf r}(t + h)
2183     - {\bf R}_0 \right] \right\} ,\\
2184     %
2185     \mathsf{H}(t + h) &\leftarrow e^{-h \eta(t + h / 2)}
2186     \mathsf{H}(t).
2187     \end{align*}
2188    
2189     The propagation of positions to time $t + h$
2190     depends on the positions at the same time. {\sc OpenMD} carries out
2191     this step iteratively (with a limit of 5 passes through the iterative
2192     loop). Also, the simulation box $\mathsf{H}$ is scaled uniformly for
2193     one full time step by an exponential factor that depends on the value
2194     of $\eta$ at time $t +
2195     h / 2$. Reshaping the box uniformly also scales the volume of
2196     the box by
2197     \begin{equation}
2198     \mathcal{V}(t + h) \leftarrow e^{ - 3 h \eta(t + h /2)} \times
2199     \mathcal{V}(t).
2200     \end{equation}
2201    
2202     The {\tt doForces} step for the NPTi integrator is exactly the same as
2203     in both the {\sc dlm} and NVT integrators. Once the forces and torques have
2204     been obtained at the new time step, the velocities can be advanced to
2205     the same time value.
2206    
2207     {\tt moveB:}
2208     \begin{align*}
2209     P(t + h) &\leftarrow \left\{{\bf r}(t + h)\right\},
2210     \left\{{\bf v}(t + h)\right\}, \\
2211     %
2212     \eta(t + h) &\leftarrow \eta(t + h / 2) +
2213     \frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h)
2214     \tau_B^2} \left( P(t + h) - P_{\mathrm{target}} \right), \\
2215     %
2216     {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t
2217     + h / 2 \right) + \frac{h}{2} \left(
2218     \frac{{\bf f}(t + h)}{m} - {\bf v}(t + h)
2219     (\chi(t + h) + \eta(t + h)) \right) ,\\
2220     %
2221     {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t
2222     + h / 2 \right) + \frac{h}{2} \left( {\bf
2223     \tau}^b(t + h) - {\bf j}(t + h)
2224     \chi(t + h) \right) .
2225     \end{align*}
2226    
2227     Once again, since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required
2228     to calculate $T(t + h)$, $P(t + h)$, $\chi(t + h)$, and $\eta(t +
2229     h)$, they indirectly depend on their own values at time $t + h$. {\tt
2230     moveB} is therefore done in an iterative fashion until $\chi(t + h)$
2231     and $\eta(t + h)$ become self-consistent. The relative tolerance for
2232     the self-consistency check defaults to a value of $\mbox{10}^{-6}$,
2233     but {\sc OpenMD} will terminate the iteration after 4 loops even if the
2234     consistency check has not been satisfied.
2235    
2236     The Melchionna modification of the Nos\'e-Hoover-Andersen algorithm is
2237     known to conserve a Hamiltonian for the extended system that is, to
2238     within a constant, identical to the Gibbs free energy,
2239     \begin{equation}
2240     H_{\mathrm{NPTi}} = V + K + f k_B T_{\mathrm{target}} \left(
2241     \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime
2242     \right) + P_{\mathrm{target}} \mathcal{V}(t).
2243     \end{equation}
2244     Poor choices of $\delta t$, $\tau_T$, or $\tau_B$ can result in
2245     non-conservation of $H_{\mathrm{NPTi}}$, so the conserved quantity is
2246     maintained in the last column of the {\tt .stat} file to allow checks
2247     on the quality of the integration. It is also known that this
2248     algorithm samples the equilibrium distribution for the enthalpy
2249     (including contributions for the thermostat and barostat),
2250     \begin{equation}
2251     H_{\mathrm{NPTi}} = V + K + \frac{f k_B T_{\mathrm{target}}}{2} \left(
2252     \chi^2 \tau_T^2 + \eta^2 \tau_B^2 \right) + P_{\mathrm{target}}
2253     \mathcal{V}(t).
2254     \end{equation}
2255    
2256     Bond constraints are applied at the end of both the {\tt moveA} and
2257     {\tt moveB} portions of the algorithm. Details on the constraint
2258     algorithms are given in section \ref{section:rattle}.
2259    
2260     \section{\label{sec:NPTf}Constant-pressure integration with a
2261     flexible box (NPTf)}
2262    
2263     There is a relatively simple generalization of the
2264     Nos\'e-Hoover-Andersen method to include changes in the simulation box
2265     {\it shape} as well as in the volume of the box. This method utilizes
2266     the full $3 \times 3$ pressure tensor and introduces a tensor of
2267     extended variables ($\overleftrightarrow{\eta}$) to control changes to
2268     the box shape. The equations of motion for this method differ from
2269     those of NPTi as follows:
2270     \begin{eqnarray}
2271     \dot{{\bf r}} & = & {\bf v} + \overleftrightarrow{\eta} \cdot \left( {\bf r} - {\bf R}_0 \right), \\
2272     \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\overleftrightarrow{\eta} +
2273     \chi \cdot \mathsf{1}) {\bf v}, \\
2274     \dot{\overleftrightarrow{\eta}} & = & \frac{1}{\tau_{B}^2 f k_B
2275     T_{\mathrm{target}}} V \left( \overleftrightarrow{\mathsf{P}} - P_{\mathrm{target}}\mathsf{1} \right) ,\\
2276     \dot{\mathsf{H}} & = & \overleftrightarrow{\eta} \cdot \mathsf{H} .
2277     \label{eq:melchionna2}
2278     \end{eqnarray}
2279    
2280     Here, $\mathsf{1}$ is the unit matrix and $\overleftrightarrow{\mathsf{P}}$
2281     is the pressure tensor. Again, the volume, $\mathcal{V} = \det
2282     \mathsf{H}$.
2283    
2284     The propagation of the equations of motion is nearly identical to the
2285     NPTi integration:
2286    
2287     {\tt moveA:}
2288     \begin{align*}
2289     \overleftrightarrow{\mathsf{P}}(t) &\leftarrow \left\{{\bf r}(t)\right\},
2290     \left\{{\bf v}(t)\right\} ,\\
2291     %
2292     {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
2293     + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} -
2294     \left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot
2295     {\bf v}(t) \right), \\
2296     %
2297     \overleftrightarrow{\eta}(t + h / 2) &\leftarrow
2298     \overleftrightarrow{\eta}(t) + \frac{h \mathcal{V}(t)}{2 N k_B
2299     T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t)
2300     - P_{\mathrm{target}}\mathsf{1} \right), \\
2301     %
2302     {\bf r}(t + h) &\leftarrow {\bf r}(t) + h \left\{ {\bf v}
2303     \left(t + h / 2 \right) + \overleftrightarrow{\eta}(t +
2304     h / 2) \cdot \left[ {\bf r}(t + h)
2305     - {\bf R}_0 \right] \right\}, \\
2306     %
2307     \mathsf{H}(t + h) &\leftarrow \mathsf{H}(t) \cdot e^{-h
2308     \overleftrightarrow{\eta}(t + h / 2)} .
2309     \end{align*}
2310     {\sc OpenMD} uses a power series expansion truncated at second order
2311     for the exponential operation which scales the simulation box.
2312    
2313     The {\tt moveB} portion of the algorithm is largely unchanged from the
2314     NPTi integrator:
2315    
2316     {\tt moveB:}
2317     \begin{align*}
2318     \overleftrightarrow{\mathsf{P}}(t + h) &\leftarrow \left\{{\bf r}
2319     (t + h)\right\}, \left\{{\bf v}(t
2320     + h)\right\}, \left\{{\bf f}(t + h)\right\} ,\\
2321     %
2322     \overleftrightarrow{\eta}(t + h) &\leftarrow
2323     \overleftrightarrow{\eta}(t + h / 2) +
2324     \frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h)
2325     \tau_B^2} \left( \overleftrightarrow{P}(t + h)
2326     - P_{\mathrm{target}}\mathsf{1} \right) ,\\
2327     %
2328     {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t
2329     + h / 2 \right) + \frac{h}{2} \left(
2330     \frac{{\bf f}(t + h)}{m} -
2331     (\chi(t + h)\mathsf{1} + \overleftrightarrow{\eta}(t
2332     + h)) \right) \cdot {\bf v}(t + h), \\
2333     \end{align*}
2334    
2335     The iterative schemes for both {\tt moveA} and {\tt moveB} are
2336     identical to those described for the NPTi integrator.
2337    
2338     The NPTf integrator is known to conserve the following Hamiltonian:
2339     \begin{equation}
2340     H_{\mathrm{NPTf}} = V + K + f k_B T_{\mathrm{target}} \left(
2341     \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime
2342     \right) + P_{\mathrm{target}} \mathcal{V}(t) + \frac{f k_B
2343     T_{\mathrm{target}}}{2}
2344     \mathrm{Tr}\left[\overleftrightarrow{\eta}(t)\right]^2 \tau_B^2.
2345     \end{equation}
2346    
2347     This integrator must be used with care, particularly in liquid
2348     simulations. Liquids have very small restoring forces in the
2349     off-diagonal directions, and the simulation box can very quickly form
2350     elongated and sheared geometries which become smaller than the cutoff
2351     radius. The NPTf integrator finds most use in simulating crystals or
2352     liquid crystals which assume non-orthorhombic geometries.
2353    
2354     \section{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)}
2355    
2356     There is one additional extended system integrator which is somewhat
2357     simpler than the NPTf method described above. In this case, the three
2358     axes have independent barostats which each attempt to preserve the
2359     target pressure along the box walls perpendicular to that particular
2360     axis. The lengths of the box axes are allowed to fluctuate
2361     independently, but the angle between the box axes does not change.
2362     The equations of motion are identical to those described above, but
2363     only the {\it diagonal} elements of $\overleftrightarrow{\eta}$ are
2364     computed. The off-diagonal elements are set to zero (even when the
2365     pressure tensor has non-zero off-diagonal elements).
2366    
2367     It should be noted that the NPTxyz integrator is {\it not} known to
2368     preserve any Hamiltonian of interest to the chemical physics
2369     community. The integrator is extremely useful, however, in generating
2370     initial conditions for other integration methods. It {\it is} suitable
2371     for use with liquid simulations, or in cases where there is
2372     orientational anisotropy in the system (i.e. in lipid bilayer
2373     simulations).
2374    
2375     \section{Langevin Dynamics (LD)\label{LDRB}}
2376    
2377     {\sc OpenMD} implements a Langevin integrator in order to perform
2378     molecular dynamics simulations in implicit solvent environments. This
2379     can result in substantial performance gains when the detailed dynamics
2380     of the solvent is not important. Since {\sc OpenMD} also handles rigid
2381     bodies of arbitrary composition and shape, the Langevin integrator is
2382     by necessity somewhat more complex than in other simulation packages.
2383    
2384     Consider the Langevin equations of motion in generalized coordinates
2385     \begin{equation}
2386     {\bf M} \dot{{\bf V}}(t) = {\bf F}_{s}(t) +
2387     {\bf F}_{f}(t) + {\bf F}_{r}(t)
2388     \label{LDGeneralizedForm}
2389     \end{equation}
2390     where ${\bf M}$ is a $6 \times 6$ diagonal mass matrix (which
2391     includes the mass of the rigid body as well as the moments of inertia
2392     in the body-fixed frame) and ${\bf V}$ is a generalized velocity,
2393     ${\bf V} =
2394     \left\{{\bf v},{\bf \omega}\right\}$. The right side of
2395 kstocke1 3708 Eq. \ref{LDGeneralizedForm} consists of three generalized forces: a
2396 gezelter 3607 system force (${\bf F}_{s}$), a frictional or dissipative force (${\bf
2397     F}_{f}$) and a stochastic force (${\bf F}_{r}$). While the evolution
2398     of the system in Newtonian mechanics is typically done in the lab
2399     frame, it is convenient to handle the dynamics of rigid bodies in
2400     body-fixed frames. Thus the friction and random forces on each
2401     substructure are calculated in a body-fixed frame and may converted
2402     back to the lab frame using that substructure's rotation matrix (${\bf
2403     Q}$):
2404     \begin{equation}
2405     {\bf F}_{f,r} =
2406     \left( \begin{array}{c}
2407     {\bf f}_{f,r} \\
2408     {\bf \tau}_{f,r}
2409     \end{array} \right)
2410     =
2411     \left( \begin{array}{c}
2412     {\bf Q}^{T} {\bf f}^{~b}_{f,r} \\
2413     {\bf Q}^{T} {\bf \tau}^{~b}_{f,r}
2414     \end{array} \right)
2415     \end{equation}
2416     The body-fixed friction force, ${\bf F}_{f}^{~b}$, is proportional to
2417     the (body-fixed) velocity at the center of resistance
2418     ${\bf v}_{R}^{~b}$ and the angular velocity ${\bf \omega}$
2419     \begin{equation}
2420     {\bf F}_{f}^{~b}(t) = \left( \begin{array}{l}
2421     {\bf f}_{f}^{~b}(t) \\
2422     {\bf \tau}_{f}^{~b}(t) \\
2423     \end{array} \right) = - \left( \begin{array}{*{20}c}
2424     \Xi_{R}^{tt} & \Xi_{R}^{rt} \\
2425     \Xi_{R}^{tr} & \Xi_{R}^{rr} \\
2426     \end{array} \right)\left( \begin{array}{l}
2427     {\bf v}_{R}^{~b}(t) \\
2428     {\bf \omega}(t) \\
2429     \end{array} \right),
2430     \end{equation}
2431     while the random force, ${\bf F}_{r}$, is a Gaussian stochastic
2432     variable with zero mean and variance,
2433     \begin{equation}
2434     \left\langle {{\bf F}_{r}(t) ({\bf F}_{r}(t'))^T } \right\rangle =
2435     \left\langle {{\bf F}_{r}^{~b} (t) ({\bf F}_{r}^{~b} (t'))^T } \right\rangle =
2436     2 k_B T \Xi_R \delta(t - t'). \label{eq:randomForce}
2437     \end{equation}
2438     $\Xi_R$ is the $6\times6$ resistance tensor at the center of
2439     resistance.
2440    
2441     For atoms and ellipsoids, there are good approximations for this
2442     tensor that are based on Stokes' law. For arbitrary rigid bodies, the
2443     resistance tensor must be pre-computed before Langevin dynamics can be
2444     used. The {\sc OpenMD} distribution contains a utitilty program called
2445     Hydro that performs this computation.
2446    
2447     Once this tensor is known for a given {\tt integrableObject},
2448     obtaining a stochastic vector that has the properties in
2449     Eq. (\ref{eq:randomForce}) can be done efficiently by carrying out a
2450     one-time Cholesky decomposition to obtain the square root matrix of
2451     the resistance tensor,
2452     \begin{equation}
2453     \Xi_R = {\bf S} {\bf S}^{T},
2454     \label{eq:Cholesky}
2455     \end{equation}
2456     where ${\bf S}$ is a lower triangular matrix.\cite{Schlick2002} A
2457     vector with the statistics required for the random force can then be
2458     obtained by multiplying ${\bf S}$ onto a random 6-vector ${\bf Z}$ which
2459     has elements chosen from a Gaussian distribution, such that:
2460     \begin{equation}
2461     \langle {\bf Z}_i \rangle = 0, \hspace{1in} \langle {\bf Z}_i \cdot
2462     {\bf Z}_j \rangle = \frac{2 k_B T}{\delta t} \delta_{ij},
2463     \end{equation}
2464     where $\delta t$ is the timestep in use during the simulation. The
2465     random force, ${\bf F}_{r}^{~b} = {\bf S} {\bf Z}$, can be shown to have the
2466     correct properties required by Eq. (\ref{eq:randomForce}).
2467    
2468     The equation of motion for the translational velocity of the center of
2469     mass (${\bf v}$) can be written as
2470     \begin{equation}
2471     m \dot{{\bf v}} (t) = {\bf f}_{s}(t) + {\bf f}_{f}(t) +
2472     {\bf f}_{r}(t)
2473     \end{equation}
2474     Since the frictional and random forces are applied at the center of
2475     resistance, which generally does not coincide with the center of mass,
2476     extra torques are exerted at the center of mass. Thus, the net
2477     body-fixed torque at the center of mass, $\tau^{~b}(t)$,
2478     is given by
2479     \begin{equation}
2480     \tau^{~b} \leftarrow \tau_{s}^{~b} + \tau_{f}^{~b} + \tau_{r}^{~b} + {\bf r}_{MR} \times \left( {\bf f}_{f}^{~b} + {\bf f}_{r}^{~b} \right)
2481     \end{equation}
2482     where ${\bf r}_{MR}$ is the vector from the center of mass to the center of
2483     resistance. Instead of integrating the angular velocity in lab-fixed
2484     frame, we consider the equation of motion for the angular momentum
2485     (${\bf j}$) in the body-fixed frame
2486     \begin{equation}
2487     \frac{\partial}{\partial t}{\bf j}(t) = \tau^{~b}(t)
2488     \end{equation}
2489     By embedding the friction and random forces into the the total force
2490     and torque, {\sc OpenMD} integrates the Langevin equations of motion
2491     for a rigid body of arbitrary shape in a velocity-Verlet style 2-part
2492     algorithm, where $h = \delta t$:
2493    
2494     {\tt move A:}
2495     \begin{align*}
2496     {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
2497     + \frac{h}{2} \left( {\bf f}(t) / m \right), \\
2498     %
2499     {\bf r}(t + h) &\leftarrow {\bf r}(t)
2500     + h {\bf v}\left(t + h / 2 \right), \\
2501     %
2502     {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
2503     + \frac{h}{2} {\bf \tau}^{~b}(t), \\
2504     %
2505     {\bf Q}(t + h) &\leftarrow \mathrm{rotate}\left( h {\bf j}
2506     (t + h / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} \right).
2507     \end{align*}
2508     In this context, $\overleftrightarrow{\mathsf{I}}$ is the diagonal
2509     moment of inertia tensor, and the $\mathrm{rotate}$ function is the
2510     reversible product of the three body-fixed rotations,
2511     \begin{equation}
2512     \mathrm{rotate}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot
2513     \mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y
2514     / 2) \cdot \mathsf{G}_x(a_x /2),
2515     \end{equation}
2516     where each rotational propagator, $\mathsf{G}_\alpha(\theta)$,
2517     rotates both the rotation matrix ($\mathbf{Q}$) and the body-fixed
2518     angular momentum (${\bf j}$) by an angle $\theta$ around body-fixed
2519     axis $\alpha$,
2520     \begin{equation}
2521     \mathsf{G}_\alpha( \theta ) = \left\{
2522     \begin{array}{lcl}
2523     \mathbf{Q}(t) & \leftarrow & \mathbf{Q}(0) \cdot \mathsf{R}_\alpha(\theta)^T, \\
2524     {\bf j}(t) & \leftarrow & \mathsf{R}_\alpha(\theta) \cdot {\bf
2525     j}(0).
2526     \end{array}
2527     \right.
2528     \end{equation}
2529     $\mathsf{R}_\alpha$ is a quadratic approximation to the single-axis
2530     rotation matrix. For example, in the small-angle limit, the
2531     rotation matrix around the body-fixed x-axis can be approximated as
2532     \begin{equation}
2533     \mathsf{R}_x(\theta) \approx \left(
2534     \begin{array}{ccc}
2535     1 & 0 & 0 \\
2536     0 & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} & -\frac{\theta}{1+
2537     \theta^2 / 4} \\
2538     0 & \frac{\theta}{1+ \theta^2 / 4} & \frac{1-\theta^2 / 4}{1 +
2539     \theta^2 / 4}
2540     \end{array}
2541     \right).
2542     \end{equation}
2543     All other rotations follow in a straightforward manner. After the
2544     first part of the propagation, the forces and body-fixed torques are
2545     calculated at the new positions and orientations. The system forces
2546     and torques are derivatives of the total potential energy function
2547     ($U$) with respect to the rigid body positions (${\bf r}$) and the
2548     columns of the transposed rotation matrix ${\bf Q}^T = \left({\bf
2549     u}_x, {\bf u}_y, {\bf u}_z \right)$:
2550    
2551     {\tt Forces:}
2552     \begin{align*}
2553     {\bf f}_{s}(t + h) & \leftarrow
2554     - \left(\frac{\partial U}{\partial {\bf r}}\right)_{{\bf r}(t + h)} \\
2555     %
2556     {\bf \tau}_{s}(t + h) &\leftarrow {\bf u}(t + h)
2557     \times \frac{\partial U}{\partial {\bf u}} \\
2558     %
2559     {\bf v}^{b}_{R}(t+h) & \leftarrow \mathbf{Q}(t+h) \cdot \left({\bf v}(t+h) + {\bf \omega}(t+h) \times {\bf r}_{MR} \right) \\
2560     %
2561     {\bf f}_{R,f}^{b}(t+h) & \leftarrow - \Xi_{R}^{tt} \cdot
2562     {\bf v}^{b}_{R}(t+h) - \Xi_{R}^{rt} \cdot {\bf \omega}(t+h) \\
2563     %
2564     {\bf \tau}_{R,f}^{b}(t+h) & \leftarrow - \Xi_{R}^{tr} \cdot
2565     {\bf v}^{b}_{R}(t+h) - \Xi_{R}^{rr} \cdot {\bf \omega}(t+h) \\
2566     %
2567     Z & \leftarrow {\tt GaussianNormal}(2 k_B T / h, 6) \\
2568     {\bf F}_{R,r}^{b}(t+h) & \leftarrow {\bf S} \cdot Z \\
2569     %
2570     {\bf f}(t+h) & \leftarrow {\bf f}_{s}(t+h) + \mathbf{Q}^{T}(t+h)
2571     \cdot \left({\bf f}_{R,f}^{~b} + {\bf f}_{R,r}^{~b} \right) \\
2572     %
2573     \tau(t+h) & \leftarrow \tau_{s}(t+h) + \mathbf{Q}^{T}(t+h) \cdot \left(\tau_{R,f}^{~b} + \tau_{R,r}^{~b} \right) + {\bf r}_{MR} \times \left({\bf f}_{f}(t+h) + {\bf f}_{r}(t+h) \right) \\
2574     \tau^{~b}(t+h) & \leftarrow \mathbf{Q}(t+h) \cdot \tau(t+h) \\
2575     \end{align*}
2576     Frictional (and random) forces and torques must be computed at the
2577     center of resistance, so there are additional steps required to find
2578     the body-fixed velocity (${\bf v}_{R}^{~b}$) at this location. Mapping
2579     the frictional and random forces at the center of resistance back to
2580     the center of mass also introduces an additional term in the torque
2581     one obtains at the center of mass.
2582    
2583     Once the forces and torques have been obtained at the new time step,
2584     the velocities can be advanced to the same time value.
2585    
2586     {\tt move B:}
2587     \begin{align*}
2588     {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + h / 2
2589     \right)
2590     + \frac{h}{2} \left( {\bf f}(t + h) / m \right), \\
2591     %
2592     {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t + h / 2
2593     \right)
2594     + \frac{h}{2} {\bf \tau}^{~b}(t + h) .
2595     \end{align*}
2596    
2597     The viscosity of the implicit solvent must be specified using the {\tt
2598     viscosity} keyword in the meta-data file if the Langevin integrator is
2599     selected. For simple particles (spheres and ellipsoids), no further
2600     parameters are necessary. Since there are no analytic solutions for
2601     the resistance tensors for composite rigid bodies, the approximate
2602     tensors for these objects must also be specified in order to use
2603     Langevin dynamics. The meta-data file must therefore point to another
2604     file which contains the information about the hydrodynamic properties
2605     of all complex rigid bodies being used during the simulation. The
2606     {\tt HydroPropFile} keyword is used to specify the name of this
2607     file. A {\tt HydroPropFile} should be precalculated using the Hydro
2608     program that is included in the {\sc OpenMD} distribution.
2609    
2610     \begin{longtable}[c]{ABG}
2611     \caption{Meta-data Keywords: Required parameters for the Langevin integrator}
2612     \\
2613     {\bf keyword} & {\bf units} & {\bf use} \\ \hline
2614     \endhead
2615     \hline
2616     \endfoot
2617 kstocke1 3708 {\tt viscosity} & poise & Sets the value of viscosity of the implicit
2618 gezelter 3607 solvent \\
2619     {\tt targetTemp} & K & Sets the target temperature of the system.
2620     This parameter must be specified to use Langevin dynamics. \\
2621     {\tt HydroPropFile} & string & Specifies the name of the resistance
2622     tensor (usually a {\tt .diff} file) which is precalculated by {\tt
2623 kstocke1 3708 Hydro}. This keyword is not necessary if the simulation contains only
2624 gezelter 3607 simple bodies (spheres and ellipsoids). \\
2625     {\tt beadSize} & $\mbox{\AA}$ & Sets the diameter of the beads to use
2626     when the {\tt RoughShell} model is used to approximate the resistance
2627     tensor.
2628     \label{table:ldParameters}
2629     \end{longtable}
2630    
2631 gezelter 3709 \section{Constant Pressure without periodic boundary conditions (The LangevinHull)}
2632 kstocke1 3708
2633 kstocke1 3726 The Langevin Hull\cite{Vardeman2011} uses an external bath at a fixed constant pressure
2634 kstocke1 3708 ($P$) and temperature ($T$) with an effective solvent viscosity
2635     ($\eta$). This bath interacts only with the objects on the exterior
2636     hull of the system. Defining the hull of the atoms in a simulation is
2637     done in a manner similar to the approach of Kohanoff, Caro and
2638     Finnis.\cite{Kohanoff:2005qm} That is, any instantaneous configuration
2639     of the atoms in the system is considered as a point cloud in three
2640     dimensional space. Delaunay triangulation is used to find all facets
2641     between coplanar
2642     neighbors.\cite{delaunay,springerlink:10.1007/BF00977785} In highly
2643     symmetric point clouds, facets can contain many atoms, but in all but
2644     the most symmetric of cases, the facets are simple triangles in
2645     3-space which contain exactly three atoms.
2646    
2647     The convex hull is the set of facets that have {\it no concave
2648     corners} at an atomic site.\cite{Barber96,EDELSBRUNNER:1994oq} This
2649     eliminates all facets on the interior of the point cloud, leaving only
2650     those exposed to the bath. Sites on the convex hull are dynamic; as
2651     molecules re-enter the cluster, all interactions between atoms on that
2652     molecule and the external bath are removed. Since the edge is
2653     determined dynamically as the simulation progresses, no {\it a priori}
2654     geometry is defined. The pressure and temperature bath interacts only
2655     with the atoms on the edge and not with atoms interior to the
2656     simulation.
2657    
2658     Atomic sites in the interior of the simulation move under standard
2659     Newtonian dynamics,
2660     \begin{equation}
2661     m_i \dot{\mathbf v}_i(t)=-{\mathbf \nabla}_i U,
2662     \label{eq:Newton}
2663     \end{equation}
2664     where $m_i$ is the mass of site $i$, ${\mathbf v}_i(t)$ is the
2665     instantaneous velocity of site $i$ at time $t$, and $U$ is the total
2666     potential energy. For atoms on the exterior of the cluster
2667     (i.e. those that occupy one of the vertices of the convex hull), the
2668     equation of motion is modified with an external force, ${\mathbf
2669     F}_i^{\mathrm ext}$:
2670     \begin{equation}
2671     m_i \dot{\mathbf v}_i(t)=-{\mathbf \nabla}_i U + {\mathbf F}_i^{\mathrm ext}.
2672     \end{equation}
2673    
2674     The external bath interacts indirectly with the atomic sites through
2675     the intermediary of the hull facets. Since each vertex (or atom)
2676     provides one corner of a triangular facet, the force on the facets are
2677     divided equally to each vertex. However, each vertex can participate
2678     in multiple facets, so the resultant force is a sum over all facets
2679     $f$ containing vertex $i$:
2680     \begin{equation}
2681     {\mathbf F}_{i}^{\mathrm ext} = \sum_{\begin{array}{c}\mathrm{facets\
2682     } f \\ \mathrm{containing\ } i\end{array}} \frac{1}{3}\ {\mathbf
2683     F}_f^{\mathrm ext}
2684     \end{equation}
2685    
2686     The external pressure bath applies a force to the facets of the convex
2687     hull in direct proportion to the area of the facet, while the thermal
2688     coupling depends on the solvent temperature, viscosity and the size
2689     and shape of each facet. The thermal interactions are expressed as a
2690     standard Langevin description of the forces,
2691     \begin{equation}
2692     \begin{array}{rclclcl}
2693     {\mathbf F}_f^{\text{ext}} & = & \text{external pressure} & + & \text{drag force} & + & \text{random force} \\
2694     & = & -\hat{n}_f P A_f & - & \Xi_f(t) {\mathbf v}_f(t) & + & {\mathbf R}_f(t)
2695     \end{array}
2696     \end{equation}
2697     Here, $A_f$ and $\hat{n}_f$ are the area and (outward-facing) normal
2698     vectors for facet $f$, respectively. ${\mathbf v}_f(t)$ is the
2699     velocity of the facet centroid,
2700     \begin{equation}
2701     {\mathbf v}_f(t) = \frac{1}{3} \sum_{i=1}^{3} {\mathbf v}_i,
2702     \end{equation}
2703     and $\Xi_f(t)$ is an approximate ($3 \times 3$) resistance tensor that
2704     depends on the geometry and surface area of facet $f$ and the
2705     viscosity of the bath. The resistance tensor is related to the
2706     fluctuations of the random force, $\mathbf{R}(t)$, by the
2707 gezelter 3709 fluctuation-dissipation theorem (see Eq. \ref{eq:randomForce}).
2708 kstocke1 3708
2709     Once the resistance tensor is known for a given facet, a stochastic
2710     vector that has the properties in Eq. (\ref{eq:randomForce}) can be
2711     calculated efficiently by carrying out a Cholesky decomposition to
2712 gezelter 3709 obtain the square root matrix of the resistance tensor (see
2713     Eq. \ref{eq:Cholesky}).
2714 kstocke1 3708
2715 gezelter 3709 Our treatment of the resistance tensor for the Langevin Hull facets is
2716     approximate. $\Xi_f$ for a rigid triangular plate would normally be
2717     treated as a $6 \times 6$ tensor that includes translational and
2718     rotational drag as well as translational-rotational coupling. The
2719     computation of resistance tensors for rigid bodies has been detailed
2720 kstocke1 3708 elsewhere,\cite{JoseGarciadelaTorre02012000,Garcia-de-la-Torre:2001wd,GarciadelaTorreJ2002,Sun:2008fk}
2721     but the standard approach involving bead approximations would be
2722     prohibitively expensive if it were recomputed at each step in a
2723     molecular dynamics simulation.
2724    
2725     Instead, we are utilizing an approximate resistance tensor obtained by
2726     first constructing the Oseen tensor for the interaction of the
2727     centroid of the facet ($f$) with each of the subfacets $\ell=1,2,3$,
2728     \begin{equation}
2729     T_{\ell f}=\frac{A_\ell}{8\pi\eta R_{\ell f}}\left(I +
2730     \frac{\mathbf{R}_{\ell f}\mathbf{R}_{\ell f}^T}{R_{\ell f}^2}\right)
2731     \end{equation}
2732     Here, $A_\ell$ is the area of subfacet $\ell$ which is a triangle
2733     containing two of the vertices of the facet along with the centroid.
2734     $\mathbf{R}_{\ell f}$ is the vector between the centroid of facet $f$
2735     and the centroid of sub-facet $\ell$, and $I$ is the ($3 \times 3$)
2736     identity matrix. $\eta$ is the viscosity of the external bath.
2737    
2738     The tensors for each of the sub-facets are added together, and the
2739     resulting matrix is inverted to give a $3 \times 3$ resistance tensor
2740     for translations of the triangular facet,
2741     \begin{equation}
2742     \Xi_f(t) =\left[\sum_{i=1}^3 T_{if}\right]^{-1}.
2743     \end{equation}
2744     Note that this treatment ignores rotations (and
2745     translational-rotational coupling) of the facet. In compact systems,
2746     the facets stay relatively fixed in orientation between
2747     configurations, so this appears to be a reasonably good approximation.
2748    
2749     At each
2750     molecular dynamics time step, the following process is carried out:
2751     \begin{enumerate}
2752     \item The standard inter-atomic forces ($\nabla_iU$) are computed.
2753     \item Delaunay triangulation is carried out using the current atomic
2754     configuration.
2755     \item The convex hull is computed and facets are identified.
2756     \item For each facet:
2757     \begin{itemize}
2758     \item[a.] The force from the pressure bath ($-\hat{n}_fPA_f$) is
2759     computed.
2760     \item[b.] The resistance tensor ($\Xi_f(t)$) is computed using the
2761     viscosity ($\eta$) of the bath.
2762     \item[c.] Facet drag ($-\Xi_f(t) \mathbf{v}_f(t)$) forces are
2763     computed.
2764     \item[d.] Random forces ($\mathbf{R}_f(t)$) are computed using the
2765     resistance tensor and the temperature ($T$) of the bath.
2766     \end{itemize}
2767     \item The facet forces are divided equally among the vertex atoms.
2768     \item Atomic positions and velocities are propagated.
2769     \end{enumerate}
2770     The Delaunay triangulation and computation of the convex hull are done
2771 gezelter 3709 using calls to the qhull library,\cite{Qhull} and for this reason, if
2772     qhull is not detected during the build, the Langevin Hull integrator
2773     will not be available. There is a minimal penalty for computing the
2774     convex hull and resistance tensors at each step in the molecular
2775     dynamics simulation (roughly 0.02 $\times$ cost of a single force
2776     evaluation).
2777 kstocke1 3708
2778     \begin{longtable}[c]{GBF}
2779     \caption{Meta-data Keywords: Required parameters for the Langevin Hull integrator}
2780     \\
2781     {\bf keyword} & {\bf units} & {\bf use} \\ \hline
2782     \endhead
2783     \hline
2784     \endfoot
2785     {\tt viscosity} & poise & Sets the value of viscosity of the implicit
2786     solven . \\
2787     {\tt targetTemp} & K & Sets the target temperature of the system.
2788     This parameter must be specified to use Langevin Hull dynamics. \\
2789     {\tt targetPressure} & atm & Sets the target pressure of the system.
2790     This parameter must be specified to use Langevin Hull dynamics. \\
2791 gezelter 3709 {\tt usePeriodicBoundaryConditions} & logical & Turns off periodic boundary conditions.
2792 kstocke1 3708 This parameter must be set to \tt false \\
2793     \label{table:lhullParameters}
2794     \end{longtable}
2795    
2796    
2797 gezelter 3607 \section{\label{sec:constraints}Constraint Methods}
2798    
2799     \subsection{\label{section:rattle}The {\sc rattle} Method for Bond
2800     Constraints}
2801    
2802     In order to satisfy the constraints of fixed bond lengths within {\sc
2803     OpenMD}, we have implemented the {\sc rattle} algorithm of
2804     Andersen.\cite{andersen83} {\sc rattle} is a velocity-Verlet
2805     formulation of the {\sc shake} method\cite{ryckaert77} for iteratively
2806     solving the Lagrange multipliers which maintain the holonomic
2807     constraints. Both methods are covered in depth in the
2808     literature,\cite{leach01:mm,Allen87} and a detailed description of
2809     this method would be redundant.
2810    
2811     \subsection{\label{section:zcons}The Z-Constraint Method}
2812    
2813     A force auto-correlation method based on the fluctuation-dissipation
2814     theorem was developed by Roux and Karplus to investigate the dynamics
2815     of ions inside ion channels.\cite{Roux91} The time-dependent friction
2816     coefficient can be calculated from the deviation of the instantaneous
2817     force from its mean value:
2818     \begin{equation}
2819     \xi(z,t)=\langle\delta F(z,t)\delta F(z,0)\rangle/k_{B}T,
2820     \end{equation}
2821     where%
2822     \begin{equation}
2823     \delta F(z,t)=F(z,t)-\langle F(z,t)\rangle.
2824     \end{equation}
2825    
2826     If the time-dependent friction decays rapidly, the static friction
2827     coefficient can be approximated by
2828     \begin{equation}
2829     \xi_{\text{static}}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt.
2830     \end{equation}
2831    
2832     This allows the diffusion constant to then be calculated through the
2833     Einstein relation:\cite{Marrink94}
2834     \begin{equation}
2835     D(z)=\frac{k_{B}T}{\xi_{\text{static}}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty
2836     }\langle\delta F(z,t)\delta F(z,0)\rangle dt}.%
2837     \end{equation}
2838    
2839     The Z-Constraint method, which fixes the $z$ coordinates of a few
2840     ``tagged'' molecules with respect to the center of the mass of the
2841     system is a technique that was proposed to obtain the forces required
2842     for the force auto-correlation calculation.\cite{Marrink94} However,
2843     simply resetting the coordinate will move the center of the mass of
2844     the whole system. To avoid this problem, we have developed a new
2845     method that is utilized in {\sc OpenMD}. Instead of resetting the
2846     coordinates, we reset the forces of $z$-constrained molecules and
2847     subtract the total constraint forces from the rest of the system after
2848     the force calculation at each time step.
2849    
2850     After the force calculation, the total force on molecule $\alpha$ is:
2851     \begin{equation}
2852     G_{\alpha} = \sum_i F_{\alpha i},
2853     \label{eq:zc1}
2854     \end{equation}
2855     where $F_{\alpha i}$ is the force in the $z$ direction on atom $i$ in
2856     $z$-constrained molecule $\alpha$. The forces on the atoms in the
2857     $z$-constrained molecule are then adjusted to remove the total force
2858     on molecule $\alpha$:
2859     \begin{equation}
2860     F_{\alpha i} = F_{\alpha i} -
2861     \frac{m_{\alpha i} G_{\alpha}}{\sum_i m_{\alpha i}}.
2862     \end{equation}
2863     Here, $m_{\alpha i}$ is the mass of atom $i$ in the $z$-constrained
2864     molecule. After the forces have been adjusted, the velocities must
2865     also be modified to subtract out molecule $\alpha$'s center-of-mass
2866     velocity in the $z$ direction.
2867     \begin{equation}
2868     v_{\alpha i} = v_{\alpha i} -
2869     \frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}},
2870     \end{equation}
2871     where $v_{\alpha i}$ is the velocity of atom $i$ in the $z$ direction.
2872     Lastly, all of the accumulated constraint forces must be subtracted
2873     from the rest of the unconstrained system to keep the system center of
2874     mass of the entire system from drifting.
2875     \begin{equation}
2876     F_{\beta i} = F_{\beta i} - \frac{m_{\beta i} \sum_{\alpha} G_{\alpha}}
2877     {\sum_{\beta}\sum_i m_{\beta i}},
2878     \end{equation}
2879     where $\beta$ denotes all {\it unconstrained} molecules in the
2880     system. Similarly, the velocities of the unconstrained molecules must
2881     also be scaled:
2882     \begin{equation}
2883     v_{\beta i} = v_{\beta i} + \sum_{\alpha} \frac{\sum_i m_{\alpha i}
2884     v_{\alpha i}}{\sum_i m_{\alpha i}}.
2885     \end{equation}
2886    
2887     This method will pin down the centers-of-mass of all of the
2888     $z$-constrained molecules, and will also keep the entire system fixed
2889     at the original system center-of-mass location.
2890    
2891     At the very beginning of the simulation, the molecules may not be at
2892     their desired positions. To steer a $z$-constrained molecule to its
2893     specified position, a simple harmonic potential is used:
2894     \begin{equation}
2895     U(t)=\frac{1}{2}k_{\text{Harmonic}}(z(t)-z_{\text{cons}})^{2},%
2896     \end{equation}
2897     where $k_{\text{Harmonic}}$ is an harmonic force constant, $z(t)$ is
2898     the current $z$ coordinate of the center of mass of the constrained
2899     molecule, and $z_{\text{cons}}$ is the desired constraint
2900     position. The harmonic force operating on the $z$-constrained molecule
2901     at time $t$ can be calculated by
2902     \begin{equation}
2903     F_{z_{\text{Harmonic}}}(t)=-\frac{\partial U(t)}{\partial z(t)}=
2904     -k_{\text{Harmonic}}(z(t)-z_{\text{cons}}).
2905     \end{equation}
2906    
2907     The user may also specify the use of a constant velocity method
2908     (steered molecular dynamics) to move the molecules to their desired
2909     initial positions. Based on concepts from atomic force microscopy,
2910     {\sc smd} has been used to study many processes which occur via rare
2911     events on the time scale of a few hundreds of picoseconds. For
2912     example,{\sc smd} has been used to observe the dissociation of
2913     Streptavidin-biotin Complex.\cite{smd}
2914    
2915     To use of the $z$-constraint method in an {\sc OpenMD} simulation, the
2916     molecules must be specified using the {\tt nZconstraints} keyword in
2917     the meta-data file. The other parameters for modifying the behavior
2918     of the $z$-constraint method are listed in table~\ref{table:zconParams}.
2919    
2920     \begin{longtable}[c]{ABCD}
2921     \caption{Meta-data Keywords: Z-Constraint Parameters}
2922     \\
2923     {\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline
2924     \endhead
2925     \hline
2926     \endfoot
2927     {\tt zconsTime} & fs & Sets the frequency at which the {\tt .fz} file
2928     is written & \\
2929     {\tt zconsForcePolicy} & string & The strategy for subtracting
2930     the $z$-constraint force from the {\it unconstrained} molecules & Possible
2931     strategies are {\tt BYMASS} and {\tt BYNUMBER}. The default
2932     strategy is {\tt BYMASS}\\
2933     {\tt zconsGap} & $\mbox{\AA}$ & Sets the distance between two adjacent
2934     constraint positions&Used mainly to move molecules through a
2935     simulation to estimate potentials of mean force. \\
2936     {\tt zconsFixtime} & fs & Sets the length of time the $z$-constraint
2937     molecule is held fixed & {\tt zconsFixtime} must be set if {\tt
2938     zconsGap} is set\\
2939     {\tt zconsUsingSMD} & logical & Flag for using Steered Molecular
2940     Dynamics to move the molecules to the correct constrained positions &
2941     Harmonic Forces are used by default
2942     \label{table:zconParams}
2943     \end{longtable}
2944    
2945 gezelter 3792 % \chapter{\label{section:restraints}Restraints}
2946 skuang 3793 % Restraints are external potentials that are added to a system to
2947     % keep particular molecules or collections of particles close to some
2948 gezelter 3792 % reference structure. A restraint can be a collective
2949 gezelter 3607
2950     \chapter{\label{section:thermInt}Thermodynamic Integration}
2951    
2952     Thermodynamic integration is an established technique that has been
2953     used extensively in the calculation of free energies for condensed
2954     phases of
2955     materials.\cite{Frenkel84,Hermens88,Meijer90,Baez95a,Vlot99}. This
2956     method uses a sequence of simulations during which the system of
2957     interest is converted into a reference system for which the free
2958     energy is known analytically ($A_0$). The difference in potential
2959     energy between the reference system and the system of interest
2960     ($\Delta V$) is then integrated in order to determine the free energy
2961     difference between the two states:
2962     \begin{equation}
2963     A = A_0 + \int_0^1 \left\langle \Delta V \right\rangle_\lambda
2964     d\lambda.
2965     \label{eq:thermInt}
2966     \end{equation}
2967     Here, $\lambda$ is the parameter that governs the transformation
2968     between the reference system and the system of interest. For
2969     crystalline phases, an harmonically-restrained (Einstein) crystal is
2970     chosen as the reference state, while for liquid phases, the ideal gas
2971     is taken as the reference state.
2972    
2973     In an Einstein crystal, the molecules are restrained at their ideal
2974     lattice locations and orientations. Using harmonic restraints, as
2975     applied by B\`{a}ez and Clancy, the total potential for this reference
2976     crystal ($V_\mathrm{EC}$) is the sum of all the harmonic restraints,
2977     \begin{equation}
2978     V_\mathrm{EC} = \sum_{i} \left[ \frac{K_\mathrm{v}}{2} (r_i - r_i^\circ)^2 +
2979     \frac{K_\theta}{2} (\theta_i - \theta_i^\circ)^2 +
2980     \frac{K_\omega}{2}(\omega_i - \omega_i^\circ)^2 \right],
2981     \end{equation}
2982     where $K_\mathrm{v}$, $K_\mathrm{\theta}$, and $K_\mathrm{\omega}$ are
2983     the spring constants restraining translational motion and deflection
2984     of and rotation around the principle axis of the molecule
2985     respectively. The values of $\theta$ range from $0$ to $\pi$, while
2986     $\omega$ ranges from $-\pi$ to $\pi$.
2987    
2988     The partition function for a molecular crystal restrained in this
2989     fashion can be evaluated analytically, and the Helmholtz Free Energy
2990     ({\it A}) is given by
2991     \begin{eqnarray}
2992     \frac{A}{N} = \frac{E_m}{N}\ -\ kT\ln \left (\frac{kT}{h\nu}\right )^3&-&kT\ln \left
2993     [\pi^\frac{1}{2}\left (\frac{8\pi^2I_\mathrm{A}kT}{h^2}\right
2994     )^\frac{1}{2}\left (\frac{8\pi^2I_\mathrm{B}kT}{h^2}\right
2995     )^\frac{1}{2}\left (\frac{8\pi^2I_\mathrm{C}kT}{h^2}\right
2996     )^\frac{1}{2}\right ] \nonumber \\ &-& kT\ln \left [\frac{kT}{2(\pi
2997     K_\omega K_\theta)^{\frac{1}{2}}}\exp\left
2998     (-\frac{kT}{2K_\theta}\right)\int_0^{\left (\frac{kT}{2K_\theta}\right
2999     )^\frac{1}{2}}\exp(t^2)\mathrm{d}t\right ],
3000     \label{ecFreeEnergy}
3001     \end{eqnarray}
3002     where $2\pi\nu = (K_\mathrm{v}/m)^{1/2}$, and $E_m$ is the minimum
3003     potential energy of the ideal crystal.\cite{Baez95a}
3004    
3005     {\sc OpenMD} can perform the simulations that aid the user in
3006     constructing the thermodynamic path from the molecular system to one
3007     of the reference systems. To do this, the user sets the value of
3008     $\lambda$ (between 0 \& 1) in the meta-data file. If the system of
3009     interest is crystalline, {\sc OpenMD} must be able to find the {\it
3010     reference} configuration of the system in a file called {\tt
3011     idealCrystal.in} in the directory from which the simulation was run.
3012     This file is a standard {\tt .dump} file, but all information about
3013     velocities and angular momenta are discarded when the file is read.
3014    
3015     The configuration found in the {\tt idealCrystal.in} file is used for
3016     the reference positions and molecular orientations of the Einstein
3017     crystal. To complete the specification of the Einstein crystal, a set
3018     of force constants must also be specified; one for displacments of the
3019     molecular centers of mass, and two for displacements from the ideal
3020     orientations of the molecules.
3021    
3022     To construct a thermodynamic integration path, the user would run a
3023     sequence of $N$ simulations, each with a different value of lambda
3024     between $0$ and $1$. When {\tt useSolidThermInt} is set to {\tt true}
3025     in the meta-data file, two additional energy columns are reported in
3026     the {\tt .stat} file for the simulation. The first, {\tt vRaw}, is
3027     the unperturbed energy for the configuration, and the second, {\tt
3028     vHarm}, is the energy of the harmonic (Einstein) system in an
3029     identical configuration. The total potential energy of the
3030     configuration is a linear combination of {\tt vRaw} and {\tt vHarm}
3031     weighted by the value of $\lambda$.
3032    
3033     From a running average of the difference between {\tt vRaw} and {\tt
3034     vHarm}, the user can obtain the integrand in Eq. (\ref{eq:thermInt})
3035     for fixed value of $\lambda$.
3036    
3037     There are two additional files with the suffixes {\tt .zang0} and {\tt
3038     .zang} generated by {\sc OpenMD} during the first run of a solid
3039     thermodynamic integration. These files contain the initial ({\tt
3040     .zang0}) and final ({\tt .zang}) values of the angular displacement
3041     coordinates for each of the molecules. These are particularly useful
3042     when chaining a number of simulations (with successive values of
3043     $\lambda$) together.
3044    
3045     For {\it liquid} thermodynamic integrations, the reference system is
3046     the ideal gas (with a potential exactly equal to 0), so the {\tt
3047     .stat} file contains only the standard columns. The potential energy
3048     column contains the potential of the {\it unperturbed} system (and not
3049     the $\lambda$-weighted potential. This allows the user to use the
3050     potential energy directly as the $\Delta V$ in the integrand of
3051     Eq. (\ref{eq:thermInt}).
3052    
3053     Meta-data parameters concerning thermodynamic integrations are given in
3054     Table~\ref{table:thermIntParams}
3055    
3056     \begin{longtable}[c]{ABCD}
3057     \caption{Meta-data Keywords: Thermodynamic Integration Parameters}
3058     \\
3059     {\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline
3060     \endhead
3061     \hline
3062     \endfoot
3063     {\tt useSolidThermInt} & logical & perform thermodynamic integration
3064     to an Einstein crystal? & default is ``false'' \\
3065     {\tt useLiquidThermInt} & logical & perform thermodynamic integration
3066     to an ideal gas? & default is ``false'' \\
3067     {\tt thermodynamicIntegrationLambda} & & & \\
3068     & double & transformation
3069     parameter & Sets how far along the thermodynamic integration path the
3070     simulation will be. \\
3071     {\tt thermodynamicIntegrationK} & & & \\
3072     & double & & power of $\lambda$
3073     governing shape of integration pathway \\
3074     {\tt thermIntDistSpringConst} & & & \\
3075     & $\mbox{kcal~mol}^{-1} \mbox{\AA}^{-2}$
3076     & & spring constant for translations in Einstein crystal \\
3077     {\tt thermIntThetaSpringConst} & & & \\
3078     & $\mbox{kcal~mol}^{-1}
3079     \mbox{rad}^{-2}$ & & spring constant for deflection away from z-axis
3080     in Einstein crystal \\
3081     {\tt thermIntOmegaSpringConst} & & & \\
3082     & $\mbox{kcal~mol}^{-1}
3083     \mbox{rad}^{-2}$ & & spring constant for rotation around z-axis in
3084     Einstein crystal
3085     \label{table:thermIntParams}
3086     \end{longtable}
3087    
3088 gezelter 3792 \chapter{\label{section:rnemd}RNEMD}
3089 gezelter 3607
3090 gezelter 3792 There are many ways to compute transport properties from molecular
3091 skuang 3793 dynamics simulations. Equilibrium Molecular Dynamics (EMD)
3092     simulations can be used by computing relevant time correlation
3093     functions and assuming linear response theory holds. These approaches
3094     are generally subject to noise and poor convergence of the relevant
3095     correlation functions. Traditional Non-equilibrium Molecular Dynamics
3096     (NEMD) methods impose a gradient (e.g. thermal or momentum) on a
3097     simulation. However, the resulting flux is often difficult to
3098 gezelter 3792 measure. Furthermore, problems arise for NEMD simulations of
3099     heterogeneous systems, such as phase-phase boundaries or interfaces,
3100     where the type of gradient to enforce at the boundary between
3101     materials is unclear.
3102    
3103 skuang 3793 {\it Reverse} Non-Equilibrium Molecular Dynamics (RNEMD) methods adopt
3104     a different approach in that an unphysical {\it flux} is imposed
3105     between different regions or ``slabs'' of the simulation box. The
3106     response of the system is to develop a temperature or momentum {\it
3107     gradient} between the two regions. Since the amount of the applied
3108     flux is known exactly, and the measurement of gradient is generally
3109     less complicated, imposed-flux methods typically take shorter
3110     simulation times to obtain converged results for transport properties.
3111 gezelter 3792
3112 skuang 3793 \begin{figure}
3113     \includegraphics[width=\linewidth]{rnemdDemo}
3114     \caption{The (VSS) RNEMD approach imposes unphysical transfer of both
3115     linear momentum and kinetic energy between a ``hot'' slab and a
3116     ``cold'' slab in the simulation box. The system responds to this
3117     imposed flux by generating both momentum and temperature gradients.
3118     The slope of the gradients can then be used to compute transport
3119     properties (e.g. shear viscosity and thermal conductivity).}
3120     \label{rnemdDemo}
3121     \end{figure}
3122 gezelter 3792
3123 skuang 3793 The original ``swapping'' approaches by M\"{u}ller-Plathe {\it et
3124     al.}\cite{ISI:000080382700030,MullerPlathe:1997xw} can be understood
3125     as a sequence of imaginary elastic collisions between particles in
3126     opposite slabs. In each collision, the entire momentum vectors of
3127     both particles may be exchanged to generate a thermal
3128     flux. Alternatively, a single component of the momentum vectors may be
3129     exchanged to generate a shear flux. This algorithm turns out to be
3130     quite useful in many simulations. However, the M\"{u}ller-Plathe
3131     swapping approach perturbs the system away from ideal
3132     Maxwell-Boltzmann distributions, and this may leads to undesirable
3133     side-effects when the applied flux becomes large.\cite{Maginn:2010}
3134     This limits the application of the swapping algorithm, so in OpenMD,
3135     we implement two additional algorithms for RNEMD in addition to the
3136     original swapping approach.
3137 gezelter 3792
3138 skuang 3793 {\bf Non-Isotropic Velocity Scaling (NIVS):}\cite{kuang:164101}
3139     Instead of having momentum exchange between {\it individual particles}
3140     in each slab, the NIVS algorithm applies velocity scaling to all of
3141     the selected particles in both slabs. A combination of linear
3142     momentum, kinetic energy, and flux constraint equations governs the
3143     amount of velocity scaling performed at each step. Interested readers
3144     should consult ref. \citealp{kuang:164101} for further details on the
3145     methodology.
3146 gezelter 3792
3147 skuang 3793 NIVS has been shown to be very effective at producing thermal
3148     gradients and for computing thermal conductivities, particularly for
3149     heterogeneous interfaces. Although the NIVS algorithm can also be
3150     applied to impose a directional momentum flux, thermal anisotropy was
3151     observed in relatively high flux simulations, and the method is not
3152     suitable for imposing a shear flux.
3153 gezelter 3792
3154 skuang 3793 {\bf Velocity Shearing and Scaling (VSS)}:\cite{2012MolPh.110..691K}
3155     The third RNEMD algorithm implemented in OpenMD utilizes a series of
3156     simultaneous velocity shearing and scaling exchanges between the two
3157     slabs. This method results in a set of simpler equations to satisfy
3158     the conservation constraints while creating a desired flux between the
3159     two slabs.
3160 gezelter 3792
3161 skuang 3793 The VSS approach is versatile in that it may be used to implement both
3162     thermal and shear transport either separately or simultaneously.
3163     Perturbations of velocities away from the ideal Maxwell-Boltzmann
3164     distributions are minimal, and thermal anisotropy is kept to a
3165     minimum. This ability to generate simultaneous thermal and shear
3166     fluxes has been utilized to map out the shear viscosity of SPC/E water
3167     in a wide range of temperature (90~K) just with a single simulation.
3168     VSS-RNEMD also allows the directional momentum flux to have quite
3169     arbitary directions, which could aid in the study of anisotropic solid
3170     surfaces in contact with liquid environments.
3171 gezelter 3792
3172 skuang 3793 {\bf What the user needs to specify:} To carry out a RNEMD simulation,
3173     a user must specify a number of parameters in the MetaData (.md) file.
3174     Because the RNEMD methods have a large number of parameters, these
3175     must be enclosed in a {\tt RNEMD\{...\}} block. The most important
3176     parameters to specify are the {\tt useRNEMD}, {\tt fluxType} and flux
3177     parameters. Most other parameters (summarized in table
3178     \ref{table:rnemd}) have reasonable default values. {\tt fluxType}
3179     sets up the kind of exchange that will be carried out between the two
3180     slabs (either Kinetic Energy ({\tt KE}) or momentum ({\tt Px, Py, Pz,
3181     Pvector}), or some combination of these). The flux is specified
3182     with the use of three possible parameters: {\tt kineticFlux} for
3183     kinetic energy exchange, as well as {\tt momentumFlux} or {\tt
3184     momentumFluxVector} for simulations with directional exchange.
3185 gezelter 3792
3186 skuang 3793 {\bf How to process the results:} OpenMD will generate a {\tt .rnemd}
3187     file with the same prefix as the original {\tt .md} file. This file
3188     contains a running average of properties of interest computed within a
3189     set of bins that divide the simulation cell along the $z$-axis. The
3190     first column of the {\tt .rnemd} file is the $z$ coordinate of the
3191     center of each bin, while following columns may contain the average
3192     temperature, velocity, or density within each bin. The output format
3193     in the {\tt .rnemd} file can be altered with the {\tt outputFields},
3194     {\tt outputBins}, and {\tt outputFileName} parameters. A report at
3195     the top of the {\tt .rnemd} file contains the current exchange totals
3196     as well as the average flux applied during the simulation. Using the
3197     slope of the temperature or velocity gradient obtaine from the {\tt
3198     .rnemd} file along with the applied flux, the user can very simply
3199     arrive at estimates of thermal conductivities ($\lambda$),
3200     \begin{equation}
3201     J_z = -\lambda \frac{\partial T}{\partial z},
3202     \end{equation}
3203     and shear viscosities ($\eta$),
3204     \begin{equation}
3205     j_z(p_x) = -\eta \frac{\partial \langle v_x \rangle}{\partial z}.
3206     \end{equation}
3207     Here, the quantities on the left hand side are the actual flux values
3208     (in the header of the {\tt .rnemd} file), while the slopes are
3209     obtained from linear fits to the gradients observed in the {\tt
3210     .rnemd} file.
3211 gezelter 3792
3212 skuang 3793 More complicated simulations (including interfaces) require a bit more
3213     care. Here the second derivative may be required to compute the
3214     interfacial thermal conductance,
3215     \begin{align}
3216     G^\prime &= \left(\nabla\lambda \cdot \mathbf{\hat{n}}\right)_{z_0} \\
3217     &= \frac{\partial}{\partial z}\left(-\frac{J_z}{
3218     \left(\frac{\partial T}{\partial z}\right)}\right)_{z_0} \\
3219     &= J_z\left(\frac{\partial^2 T}{\partial z^2}\right)_{z_0} \Big/
3220     \left(\frac{\partial T}{\partial z}\right)_{z_0}^2.
3221     \label{derivativeG}
3222     \end{align}
3223     where $z_0$ is the location of the interface between two materials and
3224     $\mathbf{\hat{n}}$ is a unit vector normal to the interface. We
3225     suggest that users interested in interfacial conductance consult
3226     reference \citealp{kuang:AuThl} for other approaches to computing $G$.
3227     Users interested in {\it friction coefficients} at heterogeneous
3228     interfaces may also find reference \citealp{2012MolPh.110..691K}
3229     useful.
3230 gezelter 3792
3231 skuang 3793 \newpage
3232 gezelter 3792
3233     \begin{longtable}[c]{JKLM}
3234     \caption{The following keywords must be enclosed inside a {\tt RNEMD\{\}} block}
3235     \\
3236     {\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline
3237     \endhead
3238     \hline
3239     \endfoot
3240     {\tt useRNEMD} & logical & perform RNEMD? & default is ``false'' \\
3241     {\tt objectSelection} & string & see section \ref{section:syntax}
3242     for selection syntax & default is ``select all'' \\
3243     {\tt method} & string & exchange method & one of the following:
3244     {\tt Swap, NIVS,} or {\tt VSS} (default is {\tt VSS}) \\
3245     {\tt fluxType} & string & what is being exchanged between slabs? & one
3246     of the following: {\tt KE, Px, Py, Pz, Pvector, KE+Px, KE+Py, KE+Pvector} \\
3247     {\tt kineticFlux} & kcal mol$^{-1}$ \AA$^{-2}$ fs$^{-1}$ & specify the kinetic energy flux & \\
3248     {\tt momentumFlux} & amu \AA$^{-1}$ fs$^{-2}$ & specify the momentum flux & \\
3249     {\tt momentumFluxVector} & amu \AA$^{-1}$ fs$^{-2}$ & specify the momentum flux when
3250     {\tt Pvector} is part of the exchange & Vector3d input\\
3251     {\tt exchangeTime} & fs & how often to perform the exchange & default is 100 fs\\
3252    
3253     {\tt slabWidth} & $\mbox{\AA}$ & width of the two exchange slabs & default is $\mathsf{H}_{zz} / 10.0$ \\
3254     {\tt slabAcenter} & $\mbox{\AA}$ & center of the end slab & default is 0 \\
3255     {\tt slabBcenter} & $\mbox{\AA}$ & center of the middle slab & default is $\mathsf{H}_{zz} / 2$ \\
3256     {\tt outputFileName} & string & file name for output histograms & default is the same prefix as the
3257     .md file, but with the {\tt .rnemd} extension \\
3258     {\tt outputBins} & int & number of $z$-bins in the output histogram &
3259     default is 20 \\
3260     {\tt outputFields} & string & columns to print in the {\tt .rnemd}
3261 skuang 3793 file where each column is separated by a pipe ($\mid$) symbol. & Allowed column names are: {\sc z, temperature, velocity, density} \\
3262 gezelter 3792 \label{table:rnemd}
3263     \end{longtable}
3264    
3265    
3266 gezelter 3607 \chapter{\label{section:minimizer}Energy Minimization}
3267    
3268     As one of the basic procedures of molecular modeling, energy
3269     minimization is used to identify local configurations that are stable
3270     points on the potential energy surface. There is a vast literature on
3271     energy minimization algorithms have been developed to search for the
3272     global energy minimum as well as to find local structures which are
3273     stable fixed points on the surface. We have included two simple
3274     minimization algorithms: steepest descent, ({\sc sd}) and conjugate
3275     gradient ({\sc cg}) to help users find reasonable local minima from
3276     their initial configurations. Since {\sc OpenMD} handles atoms and
3277     rigid bodies which have orientational coordinates as well as
3278     translational coordinates, there is some subtlety to the choice of
3279     parameters for minimization algorithms.
3280    
3281     Given a coordinate set $x_{k}$ and a search direction $d_{k}$, a line
3282     search algorithm is performed along $d_{k}$ to produce
3283     $x_{k+1}=x_{k}+$ $\lambda _{k}d_{k}$. In the steepest descent ({\sc
3284     sd}) algorithm,%
3285     \begin{equation}
3286     d_{k}=-\nabla V(x_{k}).
3287     \end{equation}
3288     The gradient and the direction of next step are always orthogonal.
3289     This may cause oscillatory behavior in narrow valleys. To overcome
3290     this problem, the Fletcher-Reeves variant~\cite{FletcherReeves} of the
3291     conjugate gradient ({\sc cg}) algorithm is used to generate $d_{k+1}$
3292     via simple recursion:
3293     \begin{equation}
3294     d_{k+1} =-\nabla V(x_{k+1})+\gamma_{k}d_{k}
3295     \end{equation}
3296     where
3297     \begin{equation}
3298     \gamma_{k} =\frac{\nabla V(x_{k+1})^{T}\nabla V(x_{k+1})}{\nabla
3299     V(x_{k})^{T}\nabla V(x_{k})}.
3300     \end{equation}
3301    
3302     The Polak-Ribiere variant~\cite{PolakRibiere} of the conjugate
3303     gradient ($\gamma_{k}$) is defined as%
3304     \begin{equation}
3305     \gamma_{k}=\frac{[\nabla V(x_{k+1})-\nabla V(x)]^{T}\nabla V(x_{k+1})}{\nabla
3306     V(x_{k})^{T}\nabla V(x_{k})}%
3307     \end{equation}
3308     It is widely agreed that the Polak-Ribiere variant gives better
3309     convergence than the Fletcher-Reeves variant, so the conjugate
3310     gradient approach implemented in {\sc OpenMD} is the Polak-Ribiere
3311     variant.
3312    
3313     The conjugate gradient method assumes that the conformation is close
3314     enough to a local minimum that the potential energy surface is very
3315     nearly quadratic. When the initial structure is far from the minimum,
3316     the steepest descent method can be superior to the conjugate gradient
3317     method. Hence, the steepest descent method is often used for the first
3318     10-100 steps of minimization. Another useful feature of minimization
3319     methods in {\sc OpenMD} is that a modified {\sc shake} algorithm can be
3320     applied during the minimization to constraint the bond lengths if this
3321     is required by the force field. Meta-data parameters concerning the
3322     minimizer are given in Table~\ref{table:minimizeParams}
3323    
3324     \begin{longtable}[c]{ABCD}
3325     \caption{Meta-data Keywords: Energy Minimizer Parameters}
3326     \\
3327     {\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline
3328     \endhead
3329     \hline
3330     \endfoot
3331     {\tt minimizer} & string & selects the minimization method to be used
3332     & either {\tt CG} (conjugate gradient) or {\tt SD} (steepest
3333     descent) \\
3334     {\tt minimizerMaxIter} & steps & Sets the maximum number of iterations
3335     for the energy minimization & The default value is 200\\
3336     {\tt minimizerWriteFreq} & steps & Sets the frequency with which the {\tt .dump} and {\tt .stat} files are writtern during energy minimization & \\
3337     {\tt minimizerStepSize} & $\mbox{\AA}$ & Sets the step size for the
3338     line search & The default value is 0.01\\
3339     {\tt minimizerFTol} & $\mbox{kcal mol}^{-1}$ & Sets the energy tolerance
3340     for stopping the minimziation. & The default value is $10^{-8}$\\
3341     {\tt minimizerGTol} & $\mbox{kcal mol}^{-1}\mbox{\AA}^{-1}$ & Sets the
3342     gradient tolerance for stopping the minimization. & The default value
3343     is $10^{-8}$\\
3344     {\tt minimizerLSTol} & $\mbox{kcal mol}^{-1}$ & Sets line search
3345     tolerance for terminating each step of the minimization. & The default
3346     value is $10^{-8}$\\
3347     {\tt minimizerLSMaxIter} & steps & Sets the maximum number of
3348     iterations for each line search & The default value is 50\\
3349     \label{table:minimizeParams}
3350     \end{longtable}
3351    
3352     \chapter{\label{section:anal}Analysis of Physical Properties}
3353    
3354     {\sc OpenMD} includes a few utility programs which compute properties
3355     from the dump files that are generated during a molecular dynamics
3356     simulation. These programs are:
3357    
3358     \begin{description}
3359     \item[{\bf Dump2XYZ}] Converts an {\sc OpenMD} dump file into a file
3360     suitable for viewing in a molecular dynamics viewer like Jmol
3361     \item[{\bf StaticProps}] Computes static properties like the pair
3362     distribution function, $g(r)$.
3363     \item[{\bf DynamicProps}] Computes time correlation functions like the
3364     velocity autocorrelation function, $\langle v(t) \cdot v(0)\rangle$,
3365     or the mean square displacement $\langle |r(t) - r(0)|^{2} \rangle$.
3366     \end{description}
3367    
3368     These programs often need to operate on a subset of the data contained
3369     within a dump file. For example, if you want only the {\it oxygen-oxygen}
3370     pair distribution from a water simulation, or if you want to make a
3371     movie including only the water molecules within a 6 angstrom radius of
3372     lipid head groups, you need a way to specify your selection to these
3373     utility programs. {\sc OpenMD} has a selection syntax which allows you to
3374     specify the selection in a compact form in order to generate only the
3375     data you want. For example a common use of the StaticProps command
3376     would be:
3377    
3378     {\tt StaticProps -i tp4.dump -{}-gofr -{}-sele1="select O*" -{}-sele2="select O*"}
3379    
3380     This command computes the oxygen-oxygen pair distribution function,
3381     $g_{OO}(r)$, from a file named {\tt tp4.dump}. In order to understand
3382     this selection syntax and to make full use of the selection
3383     capabilities of the analysis programs, it is necessary to understand a
3384     few of the core concepts that are used to perform simulations.
3385    
3386     \section{\label{section:concepts}Concepts}
3387    
3388     {\sc OpenMD} manipulates both traditional atoms as well as some objects that
3389     {\it behave like atoms}. These objects can be rigid collections of
3390     atoms or atoms which have orientational degrees of freedom. Here is a
3391     diagram of the class heirarchy:
3392    
3393     \begin{figure}
3394     \centering
3395     \includegraphics[width=3in]{heirarchy.pdf}
3396     \caption[Class heirarchy for StuntDoubles in {\sc OpenMD}-4]{ \\ The
3397     class heirarchy of StuntDoubles in {\sc OpenMD}-4. The selection
3398     syntax allows the user to select any of the objects that are descended
3399     from a StuntDouble.}
3400     \label{fig:heirarchy}
3401     \end{figure}
3402    
3403     \begin{itemize}
3404     \item A {\bf StuntDouble} is {\it any} object that can be manipulated by the
3405     integrators and minimizers.
3406     \item An {\bf Atom} is a fundamental point-particle that can be moved around during a simulation.
3407     \item A {\bf DirectionalAtom} is an atom which has {\it orientational} as well as translational degrees of freedom.
3408     \item A {\bf RigidBody} is a collection of {\bf Atom}s or {\bf
3409     DirectionalAtom}s which behaves as a single unit.
3410     \end{itemize}
3411    
3412     Every Molecule, Atom and DirectionalAtom in {\sc OpenMD} have their own names
3413     which are specified in the {\tt .md} file. In contrast, RigidBodies are
3414     denoted by their membership and index inside a particular molecule:
3415     [MoleculeName]\_RB\_[index] (the contents inside the brackets
3416     depend on the specifics of the simulation). The names of rigid bodies are
3417     generated automatically. For example, the name of the first rigid body
3418     in a DMPC molecule is DMPC\_RB\_0.
3419    
3420     \section{\label{section:syntax}Syntax of the Select Command}
3421    
3422     The most general form of the select command is: {\tt select {\it expression}}
3423    
3424     This expression represents an arbitrary set of StuntDoubles (Atoms or
3425     RigidBodies) in {\sc OpenMD}. Expressions are composed of either name
3426     expressions, index expressions, predefined sets, user-defined
3427     expressions, comparison operators, within expressions, or logical
3428     combinations of the above expression types. Expressions can be
3429     combined using parentheses and the Boolean operators.
3430    
3431     \subsection{\label{section:logical}Logical expressions}
3432    
3433     The logical operators allow complex queries to be constructed out of
3434     simpler ones using the standard boolean connectives {\bf and}, {\bf
3435     or}, {\bf not}. Parentheses can be used to alter the precedence of the
3436     operators.
3437    
3438     \begin{center}
3439     \begin{tabular}{|ll|}
3440     \hline
3441     {\bf logical operator} & {\bf equivalent operator} \\
3442     \hline
3443     and & ``\&'', ``\&\&'' \\
3444     or & ``$|$'', ``$||$'', ``,'' \\
3445     not & ``!'' \\
3446     \hline
3447     \end{tabular}
3448     \end{center}
3449    
3450     \subsection{\label{section:name}Name expressions}
3451    
3452     \begin{center}
3453     \begin{tabular}{|llp{3in}|}
3454     \hline
3455     {\bf type of expression} & {\bf examples} & {\bf translation of
3456     examples} \\
3457     \hline
3458     expression without ``.'' & select DMPC & select all StuntDoubles
3459     belonging to all DMPC molecules \\
3460     & select C* & select all atoms which have atom types beginning with C
3461     \\
3462     & select DMPC\_RB\_* & select all RigidBodies in DMPC molecules (but
3463     only select the rigid bodies, and not the atoms belonging to them). \\
3464     \hline
3465     expression has one ``.'' & select TIP3P.O\_TIP3P & select the O\_TIP3P
3466     atoms belonging to TIP3P molecules \\
3467     & select DMPC\_RB\_O.PO4 & select the PO4 atoms belonging to
3468     the first
3469     RigidBody in each DMPC molecule \\
3470     & select DMPC.20 & select the twentieth StuntDouble in each DMPC
3471     molecule \\
3472     \hline
3473     expression has two ``.''s & select DMPC.DMPC\_RB\_?.* &
3474     select all atoms
3475     belonging to all rigid bodies within all DMPC molecules \\
3476     \hline
3477     \end{tabular}
3478     \end{center}
3479    
3480     \subsection{\label{section:index}Index expressions}
3481    
3482     \begin{center}
3483     \begin{tabular}{|lp{4in}|}
3484     \hline
3485     {\bf examples} & {\bf translation of examples} \\
3486     \hline
3487     select 20 & select all of the StuntDoubles belonging to Molecule 20 \\
3488     select 20 to 30 & select all of the StuntDoubles belonging to
3489     molecules which have global indices between 20 (inclusive) and 30
3490     (exclusive) \\
3491     \hline
3492     \end{tabular}
3493     \end{center}
3494    
3495     \subsection{\label{section:predefined}Predefined sets}
3496    
3497     \begin{center}
3498     \begin{tabular}{|ll|}
3499     \hline
3500     {\bf keyword} & {\bf description} \\
3501     \hline
3502     all & select all StuntDoubles \\
3503     none & select none of the StuntDoubles \\
3504     \hline
3505     \end{tabular}
3506     \end{center}
3507    
3508     \subsection{\label{section:userdefined}User-defined expressions}
3509    
3510     Users can define arbitrary terms to represent groups of StuntDoubles,
3511     and then use the define terms in select commands. The general form for
3512     the define command is: {\bf define {\it term expression}}
3513    
3514     Once defined, the user can specify such terms in boolean expressions
3515    
3516     {\tt define SSDWATER SSD or SSD1 or SSDRF}
3517    
3518     {\tt select SSDWATER}
3519    
3520     \subsection{\label{section:comparison}Comparison expressions}
3521    
3522     StuntDoubles can be selected by using comparision operators on their
3523     properties. The general form for the comparison command is: a property
3524     name, followed by a comparision operator and then a number.
3525    
3526     \begin{center}
3527     \begin{tabular}{|l|l|}
3528     \hline
3529     {\bf property} & mass, charge \\
3530     {\bf comparison operator} & ``$>$'', ``$<$'', ``$=$'', ``$>=$'',
3531     ``$<=$'', ``$!=$'' \\
3532     \hline
3533     \end{tabular}
3534     \end{center}
3535    
3536     For example, the phrase {\tt select mass > 16.0 and charge < -2}
3537 kstocke1 3708 would select StuntDoubles which have mass greater than 16.0 and charges
3538 gezelter 3607 less than -2.
3539    
3540     \subsection{\label{section:within}Within expressions}
3541    
3542     The ``within'' keyword allows the user to select all StuntDoubles
3543     within the specified distance (in Angstroms) from a selection,
3544     including the selected atom itself. The general form for within
3545     selection is: {\tt select within(distance, expression)}
3546    
3547     For example, the phrase {\tt select within(2.5, PO4 or NC4)} would
3548     select all StuntDoubles which are within 2.5 angstroms of PO4 or NC4
3549     atoms.
3550    
3551     \section{\label{section:tools}Tools which use the selection command}
3552    
3553     \subsection{\label{section:Dump2XYZ}Dump2XYZ}
3554    
3555     Dump2XYZ can transform an {\sc OpenMD} dump file into a xyz file which can
3556     be opened by other molecular dynamics viewers such as Jmol and
3557     VMD. The options available for Dump2XYZ are as follows:
3558    
3559    
3560     \begin{longtable}[c]{|EFG|}
3561     \caption{Dump2XYZ Command-line Options}
3562     \\ \hline
3563     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
3564     \endhead
3565     \hline
3566     \endfoot
3567     -h & {\tt -{}-help} & Print help and exit \\
3568     -V & {\tt -{}-version} & Print version and exit \\
3569     -i & {\tt -{}-input=filename} & input dump file \\
3570     -o & {\tt -{}-output=filename} & output file name \\
3571     -n & {\tt -{}-frame=INT} & print every n frame (default=`1') \\
3572     -w & {\tt -{}-water} & skip the the waters (default=off) \\
3573     -m & {\tt -{}-periodicBox} & map to the periodic box (default=off)\\
3574     -z & {\tt -{}-zconstraint} & replace the atom types of zconstraint molecules (default=off) \\
3575     -r & {\tt -{}-rigidbody} & add a pseudo COM atom to rigidbody (default=off) \\
3576     -t & {\tt -{}-watertype} & replace the atom type of water model (default=on) \\
3577     -b & {\tt -{}-basetype} & using base atom type (default=off) \\
3578     & {\tt -{}-repeatX=INT} & The number of images to repeat in the x direction (default=`0') \\
3579     & {\tt -{}-repeatY=INT} & The number of images to repeat in the y direction (default=`0') \\
3580     & {\tt -{}-repeatZ=INT} & The number of images to repeat in the z direction (default=`0') \\
3581     -s & {\tt -{}-selection=selection script} & By specifying {\tt -{}-selection}=``selection command'' with Dump2XYZ, the user can select an arbitrary set of StuntDoubles to be
3582     converted. \\
3583     & {\tt -{}-originsele} & By specifying {\tt -{}-originsele}=``selection command'' with Dump2XYZ, the user can re-center the origin of the system around a specific StuntDouble \\
3584     & {\tt -{}-refsele} & In order to rotate the system, {\tt -{}-originsele} and {\tt -{}-refsele} must be given to define the new coordinate set. A StuntDouble which contains a dipole (the direction of the dipole is always (0, 0, 1) in body frame) is specified by {\tt -{}-originsele}. The new x-z plane is defined by the direction of the dipole and the StuntDouble is specified by {\tt -{}-refsele}.
3585     \end{longtable}
3586    
3587    
3588     \subsection{\label{section:StaticProps}StaticProps}
3589    
3590     {\tt StaticProps} can compute properties which are averaged over some
3591     or all of the configurations that are contained within a dump file.
3592     The most common example of a static property that can be computed is
3593     the pair distribution function between atoms of type $A$ and other
3594     atoms of type $B$, $g_{AB}(r)$. StaticProps can also be used to
3595     compute the density distributions of other molecules in a reference
3596     frame {\it fixed to the body-fixed reference frame} of a selected atom
3597     or rigid body.
3598    
3599     There are five seperate radial distribution functions availiable in
3600     {\sc OpenMD}. Since every radial distrbution function invlove the calculation
3601     between pairs of bodies, {\tt -{}-sele1} and {\tt -{}-sele2} must be specified to tell
3602     StaticProps which bodies to include in the calculation.
3603    
3604     \begin{description}
3605     \item[{\tt -{}-gofr}] Computes the pair distribution function,
3606     \begin{equation*}
3607     g_{AB}(r) = \frac{1}{\rho_B}\frac{1}{N_A} \langle \sum_{i \in A}
3608     \sum_{j \in B} \delta(r - r_{ij}) \rangle
3609     \end{equation*}
3610     \item[{\tt -{}-r\_theta}] Computes the angle-dependent pair distribution
3611     function. The angle is defined by the intermolecular vector $\vec{r}$ and
3612     $z$-axis of DirectionalAtom A,
3613     \begin{equation*}
3614     g_{AB}(r, \cos \theta) = \frac{1}{\rho_B}\frac{1}{N_A} \langle \sum_{i \in A}
3615     \sum_{j \in B} \delta(r - r_{ij}) \delta(\cos \theta_{ij} - \cos \theta)\rangle
3616     \end{equation*}
3617     \item[{\tt -{}-r\_omega}] Computes the angle-dependent pair distribution
3618     function. The angle is defined by the $z$-axes of the two
3619     DirectionalAtoms A and B.
3620     \begin{equation*}
3621     g_{AB}(r, \cos \omega) = \frac{1}{\rho_B}\frac{1}{N_A} \langle \sum_{i \in A}
3622     \sum_{j \in B} \delta(r - r_{ij}) \delta(\cos \omega_{ij} - \cos \omega)\rangle
3623     \end{equation*}
3624     \item[{\tt -{}-theta\_omega}] Computes the pair distribution in the angular
3625     space $\theta, \omega$ defined by the two angles mentioned above.
3626     \begin{equation*}
3627     g_{AB}(\cos\theta, \cos \omega) = \frac{1}{\rho_B}\frac{1}{N_A} \langle \sum_{i \in A}
3628     \sum_{j \in B} \langle \delta(\cos \theta_{ij} - \cos \theta)
3629     \delta(\cos \omega_{ij} - \cos \omega)\rangle
3630     \end{equation*}
3631     \item[{\tt -{}-gxyz}] Calculates the density distribution of particles of type
3632     B in the body frame of particle A. Therefore, {\tt -{}-originsele} and
3633     {\tt -{}-refsele} must be given to define A's internal coordinate set as
3634     the reference frame for the calculation.
3635     \end{description}
3636    
3637     The vectors (and angles) associated with these angular pair
3638     distribution functions are most easily seen in the figure below:
3639    
3640     \begin{figure}
3641     \centering
3642     \includegraphics[width=3in]{definition.pdf}
3643     \caption[Definitions of the angles between directional objects]{ \\ Any
3644     two directional objects (DirectionalAtoms and RigidBodies) have a set
3645     of two angles ($\theta$, and $\omega$) between the z-axes of their
3646     body-fixed frames.}
3647     \label{fig:gofr}
3648     \end{figure}
3649    
3650     The options available for {\tt StaticProps} are as follows:
3651     \begin{longtable}[c]{|EFG|}
3652     \caption{StaticProps Command-line Options}
3653     \\ \hline
3654     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
3655     \endhead
3656     \hline
3657     \endfoot
3658     -h& {\tt -{}-help} & Print help and exit \\
3659     -V& {\tt -{}-version} & Print version and exit \\
3660     -i& {\tt -{}-input=filename} & input dump file \\
3661     -o& {\tt -{}-output=filename} & output file name \\
3662     -n& {\tt -{}-step=INT} & process every n frame (default=`1') \\
3663     -r& {\tt -{}-nrbins=INT} & number of bins for distance (default=`100') \\
3664     -a& {\tt -{}-nanglebins=INT} & number of bins for cos(angle) (default= `50') \\
3665     -l& {\tt -{}-length=DOUBLE} & maximum length (Defaults to 1/2 smallest length of first frame) \\
3666     & {\tt -{}-sele1=selection script} & select the first StuntDouble set \\
3667     & {\tt -{}-sele2=selection script} & select the second StuntDouble set \\
3668     & {\tt -{}-sele3=selection script} & select the third StuntDouble set \\
3669     & {\tt -{}-refsele=selection script} & select reference (can only be used with {\tt -{}-gxyz}) \\
3670     & {\tt -{}-molname=STRING} & molecule name \\
3671     & {\tt -{}-begin=INT} & begin internal index \\
3672     & {\tt -{}-end=INT} & end internal index \\
3673     \hline
3674     \multicolumn{3}{|l|}{One option from the following group of options is required:} \\
3675     \hline
3676     & {\tt -{}-gofr} & $g(r)$ \\
3677     & {\tt -{}-r\_theta} & $g(r, \cos(\theta))$ \\
3678     & {\tt -{}-r\_omega} & $g(r, \cos(\omega))$ \\
3679     & {\tt -{}-theta\_omega} & $g(\cos(\theta), \cos(\omega))$ \\
3680     & {\tt -{}-gxyz} & $g(x, y, z)$ \\
3681     & {\tt -{}-p2} & $P_2$ order parameter ({\tt -{}-sele1} and {\tt -{}-sele2} must be specified) \\
3682     & {\tt -{}-scd} & $S_{CD}$ order parameter(either {\tt -{}-sele1}, {\tt -{}-sele2}, {\tt -{}-sele3} are specified or {\tt -{}-molname}, {\tt -{}-begin}, {\tt -{}-end} are specified) \\
3683     & {\tt -{}-density} & density plot ({\tt -{}-sele1} must be specified) \\
3684     & {\tt -{}-slab\_density} & slab density ({\tt -{}-sele1} must be specified)
3685     \end{longtable}
3686    
3687     \subsection{\label{section:DynamicProps}DynamicProps}
3688    
3689     {\tt DynamicProps} computes time correlation functions from the
3690     configurations stored in a dump file. Typical examples of time
3691     correlation functions are the mean square displacement and the
3692     velocity autocorrelation functions. Once again, the selection syntax
3693     can be used to specify the StuntDoubles that will be used for the
3694     calculation. A general time correlation function can be thought of
3695     as:
3696     \begin{equation}
3697     C_{AB}(t) = \langle \vec{u}_A(t) \cdot \vec{v}_B(0) \rangle
3698     \end{equation}
3699     where $\vec{u}_A(t)$ is a vector property associated with an atom of
3700     type $A$ at time $t$, and $\vec{v}_B(t^{\prime})$ is a different vector
3701     property associated with an atom of type $B$ at a different time
3702     $t^{\prime}$. In most autocorrelation functions, the vector properties
3703     ($\vec{v}$ and $\vec{u}$) and the types of atoms ($A$ and $B$) are
3704     identical, and the three calculations built in to {\tt DynamicProps}
3705     make these assumptions. It is possible, however, to make simple
3706     modifications to the {\tt DynamicProps} code to allow the use of {\it
3707     cross} time correlation functions (i.e. with different vectors). The
3708     ability to use two selection scripts to select different types of
3709     atoms is already present in the code.
3710    
3711     The options available for DynamicProps are as follows:
3712     \begin{longtable}[c]{|EFG|}
3713     \caption{DynamicProps Command-line Options}
3714     \\ \hline
3715     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
3716     \endhead
3717     \hline
3718     \endfoot
3719     -h& {\tt -{}-help} & Print help and exit \\
3720     -V& {\tt -{}-version} & Print version and exit \\
3721     -i& {\tt -{}-input=filename} & input dump file \\
3722     -o& {\tt -{}-output=filename} & output file name \\
3723     & {\tt -{}-sele1=selection script} & select first StuntDouble set \\
3724     & {\tt -{}-sele2=selection script} & select second StuntDouble set (if sele2 is not set, use script from sele1) \\
3725     \hline
3726     \multicolumn{3}{|l|}{One option from the following group of options is required:} \\
3727     \hline
3728     -r& {\tt -{}-rcorr} & compute mean square displacement \\
3729     -v& {\tt -{}-vcorr} & compute velocity correlation function \\
3730     -d& {\tt -{}-dcorr} & compute dipole correlation function
3731     \end{longtable}
3732    
3733     \chapter{\label{section:PreparingInput} Preparing Input Configurations}
3734    
3735     {\sc OpenMD} version 4 comes with a few utility programs to aid in
3736     setting up initial configuration and meta-data files. Usually, a user
3737     is interested in either importing a structure from some other format
3738     (usually XYZ or PDB), or in building an initial configuration in some
3739     perfect crystalline lattice. The programs bundled with {\sc OpenMD}
3740     which import coordinate files are {\tt atom2md}, {\tt xyz2md}, and
3741     {\tt pdb2md}. The programs which generate perfect crystals are called
3742     {\tt SimpleBuilder} and {\tt RandomBuilder}
3743    
3744     \section{\label{section:atom2md}atom2md, xyz2md, and pdb2md}
3745    
3746     {\tt atom2md}, {\tt xyz2md}, and {\tt pdb2md} attempt to construct
3747     {\tt .md} files from a single file containing only atomic coordinate
3748     information. To do this task, they make reasonable guesses about
3749     bonding from the distance between atoms in the coordinate, and attempt
3750     to identify other terms in the potential energy from the topology of
3751     the graph of discovered bonds. This procedure is not perfect, and the
3752     user should check the discovered bonding topology that is contained in
3753     the {\tt $<$MetaData$>$} block in the file that is generated.
3754    
3755     Typically, the user would run:
3756    
3757     {\tt atom2md $<$input spec$>$ [Options]}
3758    
3759     Here {\tt $<$input spec$>$} can be used to specify the type of file being
3760     used for configuration input. I.e. using {\tt -ipdb} specifies that the
3761     input file contains coordinate information in the PDB format.
3762    
3763     The options available for atom2md are as follows:
3764     \begin{longtable}[c]{|HI|}
3765     \caption{atom2md Command-line Options}
3766     \\ \hline
3767     {\bf option} & {\bf behavior} \\ \hline
3768     \endhead
3769     \hline
3770     \endfoot
3771     -f \# & Start import at molecule \# specified \\
3772     -l \# & End import at molecule \# specified \\
3773     -t & All input files describe a single molecule \\
3774     -e & Continue with next object after error, if possible \\
3775     -z & Compress the output with gzip \\
3776     -H & Outputs this help text \\
3777     -Hxxx & (xxx is file format ID e.g. -Hpdb) gives format info \\
3778     -Hall & Outputs details of all formats \\
3779     -V & Outputs version number \\
3780     \hline
3781     \multicolumn{2}{|l|}{The following file formats are recognized:}\\
3782     \hline
3783     ent & Protein Data Bank format \\
3784     in & {\sc OpenMD} cartesian coordinates format \\
3785     pdb & Protein Data Bank format \\
3786     prep & Amber Prep format \\
3787     xyz & XYZ cartesian coordinates format \\
3788     \hline
3789     \multicolumn{2}{|l|}{More specific info and options are available
3790     using -H$<$format-type$>$, e.g. -Hpdb}
3791     \end{longtable}
3792    
3793     The specific programs {\tt xyz2md} and {\tt pdb2md} are identical
3794     to {\tt atom2md}, but they use a specific input format and do not
3795     expect the the input specifier on the command line.
3796    
3797     \section{\label{section:SimpleBuilder}SimpleBuilder}
3798    
3799     {\tt SimpleBuilder} creates simple lattice structures. It requires an
3800     initial, but skeletal {\sc OpenMD} file to specify the components that are to
3801     be placed on the lattice. The total number of placed molecules will
3802     be shown at the top of the configuration file that is generated, and
3803     that number may not match the original meta-data file, so a new
3804     meta-data file is also generated which matches the lattice structure.
3805    
3806     The options available for SimpleBuilder are as follows:
3807     \begin{longtable}[c]{|EFG|}
3808     \caption{SimpleBuilder Command-line Options}
3809     \\ \hline
3810     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
3811     \endhead
3812     \hline
3813     \endfoot
3814     -h& {\tt -{}-help} & Print help and exit\\
3815     -V& {\tt -{}-version} & Print version and exit\\
3816     -o& {\tt -{}-output=STRING} & Output file name\\
3817     & {\tt -{}-density=DOUBLE} & density ($\mathrm{g~cm}^{-3}$)\\
3818     & {\tt -{}-nx=INT} & number of unit cells in x\\
3819     & {\tt -{}-ny=INT} & number of unit cells in y\\
3820     & {\tt -{}-nz=INT} & number of unit cells in z
3821     \end{longtable}
3822    
3823     \section{\label{section:Hydro}Hydro}
3824     {\tt Hydro} generates resistance tensor ({\tt .diff}) files which are
3825     required when using the Langevin integrator using complex rigid
3826     bodies. {\tt Hydro} supports two approximate models: the {\tt
3827     BeadModel} and {\tt RoughShell}. Additionally, {\tt Hydro} can
3828     generate resistance tensor files using analytic solutions for simple
3829     shapes. To generate a {\tt }.diff file, a meta-data file is needed as
3830     the input file. Since the resistance tensor depends on these
3831     quantities, the {\tt viscosity} of the solvent and the temperature
3832     ({\tt targetTemp}) of the system must be defined in meta-data file. If
3833     the approximate model in use is the {\tt RoughShell} model the {\tt
3834     beadSize} (the diameter of the small beads used to approximate the
3835     surface of the body) must also be specified.
3836    
3837     The options available for Hydro are as follows:
3838     \begin{longtable}[c]{|EFG|}
3839     \caption{Hydro Command-line Options}
3840     \\ \hline
3841     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
3842     \endhead
3843     \hline
3844     \endfoot
3845     -h& {\tt -{}-help} & Print help and exit\\
3846     -V& {\tt -{}-version} & Print version and exit\\
3847     -i& {\tt -{}-input=filename} & input MetaData (md) file\\
3848     -o& {\tt -{}-output=STRING} & Output file name\\
3849     & {\tt -{}-model=STRING} & hydrodynamics model (supports both
3850     {\tt RoughShell} and {\tt BeadModel})\\
3851     -b& {\tt -{}-beads} & generate the beads only,
3852     hydrodynamic calculations will not be performed (default=off)\\
3853     \end{longtable}
3854    
3855    
3856     \chapter{\label{section:parallelization} Parallel Simulation Implementation}
3857    
3858     Although processor power is continually improving, it is still
3859     unreasonable to simulate systems of more than 10,000 atoms on a single
3860     processor. To facilitate study of larger system sizes or smaller
3861     systems for longer time scales, parallel methods were developed to
3862     allow multiple CPU's to share the simulation workload. Three general
3863     categories of parallel decomposition methods have been developed:
3864     these are the atomic,\cite{Fox88} spatial~\cite{plimpton95} and
3865     force~\cite{Paradyn} decomposition methods.
3866    
3867     Algorithmically simplest of the three methods is atomic decomposition,
3868     where $N$ particles in a simulation are split among $P$ processors for
3869     the duration of the simulation. Computational cost scales as an
3870     optimal $\mathcal{O}(N/P)$ for atomic decomposition. Unfortunately, all
3871     processors must communicate positions and forces with all other
3872     processors at every force evaluation, leading the communication costs
3873     to scale as an unfavorable $\mathcal{O}(N)$, \emph{independent of the
3874     number of processors}. This communication bottleneck led to the
3875     development of spatial and force decomposition methods, in which
3876     communication among processors scales much more favorably. Spatial or
3877     domain decomposition divides the physical spatial domain into 3D boxes
3878     in which each processor is responsible for calculation of forces and
3879     positions of particles located in its box. Particles are reassigned to
3880     different processors as they move through simulation space. To
3881     calculate forces on a given particle, a processor must simply know the
3882     positions of particles within some cutoff radius located on nearby
3883     processors rather than the positions of particles on all
3884     processors. Both communication between processors and computation
3885     scale as $\mathcal{O}(N/P)$ in the spatial method. However, spatial
3886     decomposition adds algorithmic complexity to the simulation code and
3887     is not very efficient for small $N$, since the overall communication
3888     scales as the surface to volume ratio $\mathcal{O}(N/P)^{2/3}$ in
3889     three dimensions.
3890    
3891     The parallelization method used in {\sc OpenMD} is the force
3892     decomposition method.\cite{hendrickson:95} Force decomposition assigns
3893     particles to processors based on a block decomposition of the force
3894     matrix. Processors are split into an optimally square grid forming row
3895     and column processor groups. Forces are calculated on particles in a
3896     given row by particles located in that processor's column
3897     assignment. One deviation from the algorithm described by Hendrickson
3898     {\it et al.} is the use of column ordering based on the row indexes
3899     preventing the need for a transpose operation necessitating a second
3900     communication step when gathering the final force components. Force
3901     decomposition is less complex to implement than the spatial method but
3902     still scales computationally as $\mathcal{O}(N/P)$ and scales as
3903     $\mathcal{O}(N/\sqrt{P})$ in communication cost. Plimpton has also
3904     found that force decompositions scale more favorably than spatial
3905     decompositions for systems up to 10,000 atoms and favorably compete
3906     with spatial methods up to 100,000 atoms.\cite{plimpton95}
3907    
3908     \chapter{\label{section:conclusion}Conclusion}
3909    
3910     We have presented a new parallel simulation program called {\sc
3911     OpenMD}. This program offers some novel capabilities, but mostly makes
3912     available a library of modern object-oriented code for the scientific
3913     community to use freely. Notably, {\sc OpenMD} can handle symplectic
3914     integration of objects (atoms and rigid bodies) which have
3915     orientational degrees of freedom. It can also work with transition
3916     metal force fields and point-dipoles. It is capable of scaling across
3917     multiple processors through the use of force based decomposition. It
3918     also implements several advanced integrators allowing the end user
3919     control over temperature and pressure. In addition, it is capable of
3920     integrating constrained dynamics through both the {\sc rattle}
3921     algorithm and the $z$-constraint method.
3922    
3923     We encourage other researchers to download and apply this program to
3924     their own research problems. By making the code available, we hope to
3925     encourage other researchers to contribute their own code and make it a
3926     more powerful package for everyone in the molecular dynamics community
3927     to use. All source code for {\sc OpenMD} is available for download at
3928     {\tt http://openmd.net}.
3929    
3930     \chapter{Acknowledgments}
3931    
3932     Development of {\sc OpenMD} was funded by a New Faculty Award from the
3933     Camille and Henry Dreyfus Foundation and by the National Science
3934     Foundation under grant CHE-0134881. Computation time was provided by
3935     the Notre Dame Bunch-of-Boxes (B.o.B) computer cluster under NSF grant
3936     DMR-0079647.
3937    
3938    
3939 skuang 3793 \bibliographystyle{aip}
3940 gezelter 3607 \bibliography{openmdDoc}
3941    
3942     \end{document}