ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 4101
Committed: Wed Apr 16 12:53:07 2014 UTC (10 years, 5 months ago) by gezelter
Content type: application/x-tex
File size: 195559 byte(s)
Log Message:
Changes for force field files

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