ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 3792
Committed: Thu Aug 9 18:48:23 2012 UTC (12 years, 8 months ago) by gezelter
Content type: application/x-tex
File size: 177449 byte(s)
Log Message:
RNEMD edits

File Contents

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