ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 4105
Committed: Mon Apr 28 21:41:01 2014 UTC (10 years, 4 months ago) by gezelter
Content type: application/x-tex
File size: 219644 byte(s)
Log Message:
Edits

File Contents

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