ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/openmdDocs/openmdDoc.tex
Revision: 4322
Committed: Wed Mar 25 17:23:48 2015 UTC (10 years, 1 month ago) by gezelter
Content type: application/x-tex
File size: 233379 byte(s)
Log Message:
Updated for version 2.3

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