ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 3726
Committed: Wed May 11 15:22:29 2011 UTC (13 years, 4 months ago) by kstocke1
Content type: application/x-tex
File size: 170040 byte(s)
Log Message:
updated Langevin Hull section

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