ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/oopseDocs/oopseDoc.tex
Revision: 3399
Committed: Fri May 30 14:09:56 2008 UTC (16 years, 3 months ago) by xsun
Content type: application/x-tex
File size: 160305 byte(s)
Log Message:
add langevin and hydro in.

File Contents

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