ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 3708
Committed: Mon Nov 22 22:34:45 2010 UTC (14 years, 5 months ago) by kstocke1
Content type: application/x-tex
File size: 170781 byte(s)
Log Message:
added documentation for Langevin Hull

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