1 |
\documentclass[11pt]{article} |
2 |
\usepackage{amsmath} |
3 |
\usepackage{amssymb} |
4 |
\usepackage{endfloat} |
5 |
\usepackage{listings} |
6 |
\usepackage{berkeley} |
7 |
\usepackage{graphicx} |
8 |
\usepackage[ref]{overcite} |
9 |
\usepackage{setspace} |
10 |
\usepackage{tabularx} |
11 |
\pagestyle{plain} |
12 |
\pagenumbering{arabic} |
13 |
\oddsidemargin 0.0cm \evensidemargin 0.0cm |
14 |
\topmargin -21pt \headsep 10pt |
15 |
\textheight 9.0in \textwidth 6.5in |
16 |
\brokenpenalty=10000 |
17 |
\renewcommand{\baselinestretch}{1.2} |
18 |
\renewcommand\citemid{\ } % no comma in optional reference note |
19 |
|
20 |
\begin{document} |
21 |
\lstset{language=C,frame=TB,basicstyle=\small,basicstyle=\ttfamily, % |
22 |
xleftmargin=0.5in, xrightmargin=0.5in,captionpos=b, % |
23 |
abovecaptionskip=0.5cm, belowcaptionskip=0.5cm} |
24 |
\renewcommand{\lstlistingname}{Scheme} |
25 |
\title{{\sc oopse}: An Open Source Object-Oriented Parallel Simulation |
26 |
Engine for Molecular Dynamics} |
27 |
|
28 |
\author{Matthew A. Meineke, Charles F. Vardeman II, Teng Lin,\\ |
29 |
Christopher J. Fennell and J. Daniel Gezelter\\ |
30 |
Department of Chemistry and Biochemistry\\ |
31 |
University of Notre Dame\\ |
32 |
Notre Dame, Indiana 46556} |
33 |
|
34 |
\date{\today} |
35 |
\maketitle |
36 |
|
37 |
\begin{abstract} |
38 |
{\sc oopse} is a new molecular dynamics simulation program which is |
39 |
capable of efficiently integrating equations of motion for atom types |
40 |
with orientational degrees of freedom (e.g. ``sticky'' atoms and point |
41 |
dipoles). Transition metals can also be simulated using the embedded |
42 |
atom method ({\sc eam}) potential included in the code. Parallel |
43 |
simulations are carried out using the force-based decomposition |
44 |
method. Simulations are specified using a very simple C-based |
45 |
meta-data language. A number of advanced integrators are included, |
46 |
and the base integrator for orientational dynamics provides |
47 |
substantial improvements over older quaternion-base schemes. All |
48 |
source code is available under a very permissive (BSD-style) Open |
49 |
Source license. |
50 |
\end{abstract} |
51 |
|
52 |
\section{\label{sec:intro}Introduction} |
53 |
|
54 |
There are a number of excellent molecular dynamics packages available |
55 |
to the chemical physics |
56 |
community.\cite{Brooks83,MacKerell98,pearlman:1995,Gromacs,Gromacs3,DL_POLY,Tinker,Paradyn} |
57 |
All of these packages are stable, polished programs which solve many |
58 |
problems of interest. Most are now capable of performing molecular |
59 |
dynamics simulations on parallel computers. Some have source code |
60 |
which is freely available to the entire scientific community. Few, |
61 |
however, are capable of efficiently integrating the equations of |
62 |
motion for atom types with orientational degrees of freedom |
63 |
(e.g. point dipoles, and ``sticky'' atoms). And only one of the |
64 |
programs referenced can handle transition metal force fields like the |
65 |
Embedded Atom Method ({\sc eam}). The direction our research program |
66 |
has taken us now involves the use of atoms with orientational degrees |
67 |
of freedom and transition metals. Since these simulation methods may |
68 |
be of some use to other researchers, we have decided to release our |
69 |
program to the scientific community with a permissive open source |
70 |
license. |
71 |
|
72 |
This paper communicates the algorithmic details of our program, which |
73 |
we have been calling the Open source Object-oriented Parallel |
74 |
Simulation Engine (i.e. {\sc oopse}). We have structured this paper |
75 |
to first discuss the underlying concepts in this simulation package |
76 |
(Sec. \ref{oopseSec:IOfiles}). The empirical energy functions |
77 |
implemented are discussed in Sec.~\ref{oopseSec:empiricalEnergy}. |
78 |
Sec.~\ref{oopseSec:mechanics} describes the various Molecular Dynamics |
79 |
algorithms {\sc oopse} implements in the integration of Hamilton's |
80 |
equations of motion. Program design considerations for parallel |
81 |
computing are presented in |
82 |
Sec.~\ref{oopseSec:parallelization}. Concluding remarks are presented |
83 |
in Sec.~\ref{oopseSec:conclusion}. |
84 |
|
85 |
\section{\label{oopseSec:IOfiles}Concepts \& Files} |
86 |
|
87 |
A simulation in {\sc oopse} is built using a few fundamental |
88 |
conceptual building blocks most of which are chemically intuitive. |
89 |
The basic unit of a simulation is an {\tt atom}. The parameters |
90 |
describing an {\tt atom} have been generalized to make it as flexible |
91 |
as possible; this means that in addition to translational degrees of |
92 |
freedom, {\tt Atoms} may also have {\it orientational} degrees of freedom. |
93 |
|
94 |
The fundamental (static) properties of {\tt atoms} are defined by the |
95 |
{\tt forceField} chosen for the simulation. The atomic properties |
96 |
specified by a {\tt forceField} might include (but are not limited to) |
97 |
charge, $\sigma$ and $\epsilon$ values for Lennard-Jones interactions, |
98 |
the strength of the dipole moment ($\mu$), the mass, and the moments |
99 |
of inertia. Other more complicated properties of atoms might also be |
100 |
specified by the {\tt forceField}. |
101 |
|
102 |
{\tt Atoms} can be grouped together in many ways. A {\tt rigidBody} |
103 |
contains atoms that exert no forces on one another and which move as a |
104 |
single rigid unit. A {\tt cutoffGroup} may contain atoms which |
105 |
function together as a (rigid {\it or} non-rigid) unit for potential |
106 |
energy calculations, |
107 |
\begin{equation} |
108 |
V_{ab} = s(r_{ab}) \sum_{i \in a} \sum_{j \in b} V_{ij}(r_{ij}) |
109 |
\end{equation} |
110 |
Here, $a$ and $b$ are two {\tt cutoffGroups} containing multiple atoms |
111 |
($a = \left\{i\right\}$ and $b = \left\{j\right\}$). $s(r_{ab})$ is a |
112 |
generalized switching function which insures that the atoms in the two |
113 |
{\tt cutoffGroups} are treated identically as the two groups enter or |
114 |
leave an interaction region. |
115 |
|
116 |
{\tt Atoms} may also be grouped in more traditional ways into {\tt |
117 |
bonds}, {\tt bends}, and {\tt torsions}. These groupings allow the |
118 |
correct choice of interaction parameters for short-range interactions |
119 |
to be chosen from the definitions in the {\tt forceField}. |
120 |
|
121 |
All of these groups of {\tt atoms} are brought together in the {\tt |
122 |
molecule}, which is the fundamental structure for setting up and {\sc |
123 |
oopse} simulation. {\tt Molecules} contain lists of {\tt atoms} |
124 |
followed by listings of the other atomic groupings ({\tt bonds}, {\tt |
125 |
bends}, {\tt torsions}, {\tt rigidBodies}, and {\tt cutoffGroups}) |
126 |
which relate the atoms to one another. |
127 |
|
128 |
Simulations often involve heterogeneous collections of molecules. To |
129 |
specify a mixture of {\tt molecule} types, {\sc oopse} uses {\tt |
130 |
components}. Even simulations containing only one type of molecule |
131 |
must specify a single {\tt component}. |
132 |
|
133 |
Starting a simulation requires two types of information: {\it |
134 |
meta-data}, which describes the types of objects present in the |
135 |
simulation, and {\it configuration} information, which describes the |
136 |
initial state of these objects. The meta-data is given to {\sc oopse} |
137 |
using a C-based syntax that is parsed at the beginning of the |
138 |
simulation. Configuration information is specified using an extended |
139 |
XYZ file format. Both the meta-data and configuration file formats |
140 |
are described in the following sections. |
141 |
|
142 |
\subsection{Meta-data Files} |
143 |
|
144 |
{\sc oopse} uses a C-based script syntax to parse the meta-data files |
145 |
at run time. These files allow the user to completely describe the |
146 |
system they wish to simulate, as well as tailor {\sc oopse}'s behavior |
147 |
during the simulation. Meta-data files are typically denoted with the |
148 |
extension {\tt .md} (which can stand for Meta-Data or Molecular |
149 |
Dynamics or Molecule Definition depending on the user's mood). An |
150 |
example meta-data file is shown in Scheme~\ref{sch:mdExample}. |
151 |
|
152 |
\begin{lstlisting}[float,caption={[An example of a complete meta-data |
153 |
file] An example showing a complete meta-data |
154 |
file.},label={sch:mdExample}] |
155 |
|
156 |
molecule{ |
157 |
name = "Ar"; |
158 |
nAtoms = 1; |
159 |
atom[0]{ |
160 |
type="Ar"; |
161 |
position( 0.0, 0.0, 0.0 ); |
162 |
} |
163 |
} |
164 |
|
165 |
nComponents = 1; |
166 |
component{ |
167 |
type = "Ar"; |
168 |
nMol = 108; |
169 |
} |
170 |
|
171 |
initialConfig = "./argon.in"; |
172 |
|
173 |
forceField = "LJ"; |
174 |
ensemble = "NVE"; // specify the simulation ensemble |
175 |
dt = 1.0; // the time step for integration |
176 |
runTime = 1e3; // the total simulation run time |
177 |
sampleTime = 100; // trajectory file frequency |
178 |
statusTime = 50; // statistics file frequency |
179 |
|
180 |
\end{lstlisting} |
181 |
|
182 |
Within the meta-data file it is necessary to provide a complete |
183 |
description of the molecule before it is actually placed in the |
184 |
simulation. {\sc oopse}'s meta-data syntax was originally developed |
185 |
with this goal in mind, and allows for the use of {\it include files} |
186 |
to specify all atoms in a molecular prototype, as well as any bonds, |
187 |
bends, or torsions. Include files allow the user to describe a |
188 |
molecular prototype once, then simply include it into each simulation |
189 |
containing that molecule. Returning to the example in |
190 |
Scheme~\ref{sch:mdExample}, the include file's contents would be |
191 |
Scheme~\ref{sch:mdIncludeExample}, and the new meta-data file would |
192 |
become Scheme~\ref{sch:mdExPrime}. |
193 |
|
194 |
\begin{lstlisting}[float,caption={An example molecule definition in an |
195 |
include file.},label={sch:mdIncludeExample}] |
196 |
|
197 |
molecule{ |
198 |
name = "Ar"; |
199 |
nAtoms = 1; |
200 |
atom[0]{ |
201 |
type="Ar"; |
202 |
position( 0.0, 0.0, 0.0 ); |
203 |
} |
204 |
} |
205 |
|
206 |
\end{lstlisting} |
207 |
|
208 |
\begin{lstlisting}[float,caption={Revised meta-data example.},label={sch:mdExPrime}] |
209 |
|
210 |
#include "argon.md" |
211 |
|
212 |
nComponents = 1; |
213 |
component{ |
214 |
type = "Ar"; |
215 |
nMol = 108; |
216 |
} |
217 |
|
218 |
initialConfig = "./argon.in"; |
219 |
|
220 |
forceField = "LJ"; |
221 |
ensemble = "NVE"; |
222 |
dt = 1.0; |
223 |
runTime = 1e3; |
224 |
sampleTime = 100; |
225 |
statusTime = 50; |
226 |
|
227 |
\end{lstlisting} |
228 |
|
229 |
\subsection{\label{oopseSec:atomsMolecules}Atoms, Molecules, and other |
230 |
ways of grouping atoms} |
231 |
|
232 |
As mentioned above, the fundamental unit for an {\sc oopse} simulation |
233 |
is the {\tt atom}. Atoms can be collected into secondary structures |
234 |
such as {\tt rigidBodies}, {\tt cutoffGroups}, or {\tt molecules}. The |
235 |
{\tt molecule} is a way for {\sc oopse} to keep track of the atoms in |
236 |
a simulation in logical manner. Molecular units store the identities |
237 |
of all the atoms and rigid bodies associated with themselves, and they |
238 |
are responsible for the evaluation of their own internal interactions |
239 |
(\emph{i.e.}~bonds, bends, and torsions). Scheme |
240 |
\ref{sch:mdIncludeExample} shows how one creates a molecule in an |
241 |
included meta-data file. The positions of the atoms given in the |
242 |
declaration are relative to the origin of the molecule, and the origin |
243 |
is used when creating a system containing the molecule. |
244 |
|
245 |
One of the features that sets {\sc oopse} apart from most of the |
246 |
current molecular simulation packages is the ability to handle rigid |
247 |
body dynamics. Rigid bodies are non-spherical particles or collections |
248 |
of particles (e.g. $\mbox{C}_{60}$) that have a constant internal |
249 |
potential and move collectively.\cite{Goldstein01} They are not |
250 |
included in most simulation packages because of the algorithmic |
251 |
complexity involved in propagating orientational degrees of freedom. |
252 |
Integrators which propagate orientational motion with an acceptable |
253 |
level of energy conservation for molecular dynamics are relatively |
254 |
new inventions. |
255 |
|
256 |
Moving a rigid body involves determination of both the force and |
257 |
torque applied by the surroundings, which directly affect the |
258 |
translational and rotational motion in turn. In order to accumulate |
259 |
the total force on a rigid body, the external forces and torques must |
260 |
first be calculated for all the internal particles. The total force on |
261 |
the rigid body is simply the sum of these external forces. |
262 |
Accumulation of the total torque on the rigid body is more complex |
263 |
than the force because the torque is applied to the center of mass of |
264 |
the rigid body. The space-fixed torque on rigid body $i$ is |
265 |
\begin{equation} |
266 |
\boldsymbol{\tau}_i= |
267 |
\sum_{a}\biggl[(\mathbf{r}_{ia}-\mathbf{r}_i)\times \mathbf{f}_{ia} |
268 |
+ \boldsymbol{\tau}_{ia}\biggr], |
269 |
\label{eq:torqueAccumulate} |
270 |
\end{equation} |
271 |
where $\boldsymbol{\tau}_i$ and $\mathbf{r}_i$ are the torque on and |
272 |
position of the center of mass respectively, while $\mathbf{f}_{ia}$, |
273 |
$\mathbf{r}_{ia}$, and $\boldsymbol{\tau}_{ia}$ are the force on, |
274 |
position of, and torque on the component particles of the rigid body. |
275 |
|
276 |
The summation of the total torque is done in the body fixed axis of |
277 |
each rigid body. In order to move between the space fixed and body |
278 |
fixed coordinate axes, parameters describing the orientation must be |
279 |
maintained for each rigid body. At a minimum, the rotation matrix |
280 |
($\mathsf{A}$) can be described by the three Euler angles ($\phi, |
281 |
\theta,$ and $\psi$), where the elements of $\mathsf{A}$ are composed of |
282 |
trigonometric operations involving $\phi, \theta,$ and |
283 |
$\psi$.\cite{Goldstein01} In order to avoid numerical instabilities |
284 |
inherent in using the Euler angles, the four parameter ``quaternion'' |
285 |
scheme is often used. The elements of $\mathsf{A}$ can be expressed as |
286 |
arithmetic operations involving the four quaternions ($q_0, q_1, q_2,$ |
287 |
and $q_3$).\cite{allen87:csl} Use of quaternions also leads to |
288 |
performance enhancements, particularly for very small |
289 |
systems.\cite{Evans77} |
290 |
|
291 |
Rather than use one of the previously stated methods, {\sc oopse} |
292 |
utilizes a relatively new scheme that propagates the entire nine |
293 |
parameter rotation matrix. Further discussion on this choice can be |
294 |
found in Sec.~\ref{oopseSec:integrate}. An example definition of a |
295 |
rigid body can be seen in Scheme |
296 |
\ref{sch:rigidBody}. |
297 |
|
298 |
\begin{lstlisting}[float,caption={[Defining rigid bodies]A sample |
299 |
definition of a molecule containing a rigid body and a cutoff |
300 |
group},label={sch:rigidBody}] |
301 |
molecule{ |
302 |
name = "TIP3P"; |
303 |
nAtoms = 3; |
304 |
atom[0]{ |
305 |
type = "O_TIP3P"; |
306 |
position( 0.0, 0.0, -0.06556 ); |
307 |
} |
308 |
atom[1]{ |
309 |
type = "H_TIP3P"; |
310 |
position( 0.0, 0.75695, 0.52032 ); |
311 |
} |
312 |
atom[2]{ |
313 |
type = "H_TIP3P"; |
314 |
position( 0.0, -0.75695, 0.52032 ); |
315 |
} |
316 |
|
317 |
nRigidBodies = 1; |
318 |
rigidBody[0]{ |
319 |
nMembers = 3; |
320 |
members(0, 1, 2); |
321 |
} |
322 |
|
323 |
nCutoffGroups = 1; |
324 |
cutoffGroup[0]{ |
325 |
nMembers = 3; |
326 |
members(0, 1, 2); |
327 |
} |
328 |
} |
329 |
\end{lstlisting} |
330 |
|
331 |
\subsection{\label{sec:miscConcepts}Creating a Metadata File} |
332 |
|
333 |
The actual creation of a metadata file requires several key |
334 |
components. The first part of the file needs to be the declaration of |
335 |
all of the molecule prototypes used in the simulation. This is |
336 |
typically done through included meta-data files. Only the molecules |
337 |
actually present in the simulation need to be declared; however, {\sc |
338 |
oopse} allows for the declaration of more molecules than are |
339 |
needed. This gives the user the ability to build up a library of |
340 |
commonly used molecules into a single include file. |
341 |
|
342 |
Once all prototypes are declared, the ordering of the rest of the |
343 |
script is less stringent. The molecular composition of the simulation |
344 |
is specified with {\tt component} statements. Each different type of |
345 |
molecule present in the simulation is considered a separate |
346 |
component. The number of components must be declared before the first |
347 |
component block statement (an example is shown in |
348 |
Sch.~\ref{sch:mdExPrime}). The component blocks tell {\sc oopse} the |
349 |
number of molecules that will be in the simulation, and the order in |
350 |
which the components blocks are declared sets the ordering of the real |
351 |
atoms in the configuration file as well as in the output files. The |
352 |
remainder of the script then sets the various simulation parameters |
353 |
for the system of interest. |
354 |
|
355 |
The required set of parameters that must be present in all simulations |
356 |
is given in Table~\ref{table:reqParams}. Since the user can use {\sc |
357 |
oopse} to perform energy minimizations as well as molecular dynamics |
358 |
simulations, one of the {\tt minimizer} or {\tt ensemble} keywords |
359 |
must be present. The {\tt ensemble} keyword is responsible for |
360 |
selecting the integration method used for the calculation of the |
361 |
equations of motion. An in depth discussion of the various methods |
362 |
available in {\sc oopse} can be found in |
363 |
Sec.~\ref{oopseSec:mechanics}. The {\tt minimizer} keyword selects |
364 |
which minimization method to use, and more details on the choices of |
365 |
minimizer parameters can be found in |
366 |
Sec.~\ref{oopseSec:minimizer}. The {\tt forceField} statement is |
367 |
important for the selection of which forces will be used in the course |
368 |
of the simulation. {\sc oopse} supports several force fields, as |
369 |
outlined in Sec.~\ref{oopseSec:empiricalEnergy}. The force fields are |
370 |
interchangeable between simulations, with the only requirement being |
371 |
that all atoms needed by the simulation are defined within the |
372 |
selected force field. |
373 |
|
374 |
For molecular dynamics simulations, the time step between force |
375 |
evaluations is set with the {\tt dt} parameter, and {\tt runTime} will |
376 |
set the time length of the simulation. Note, that {\tt runTime} is an |
377 |
absolute time, meaning if the simulation is started at t = 10.0~ns |
378 |
with a {\tt runTime} of 25.0~ns, the simulation will only run for an |
379 |
additional 15.0~ns. |
380 |
|
381 |
For energy minimizations, it is not necessary to specify {\tt dt} or |
382 |
{\tt runTime}. |
383 |
|
384 |
The final required parameter is the {\tt initialConfig} |
385 |
statement. This will set the initial coordinates for the system, as |
386 |
well as the initial time if the {\tt useInitalTime} flag is set to |
387 |
{\tt true}. The format of the file specified in {\tt initialConfig}, |
388 |
is given in Sec.~\ref{oopseSec:coordFiles}. Additional parameters are |
389 |
summarized in Table~\ref{table:genParams}. |
390 |
|
391 |
It is important to note the fundamental units in all files which are |
392 |
read and written by {\sc oopse}. Energies are in $\mbox{kcal |
393 |
mol}^{-1}$, distances are in $\mbox{\AA}$, times are in $\mbox{fs}$, |
394 |
translational velocities are in $\mbox{\AA fs}^{-1}$, and masses are |
395 |
in $\mbox{amu}$. Orientational degrees of freedom are described using |
396 |
quaternions (unitless, but $q_w^2 + q_x^2 + q_y^2 + q_z^2 = 1$), |
397 |
body-fixed angular momenta ($\mbox{amu \AA}^{2} \mbox{radians |
398 |
fs}^{-1}$), and body-fixed moments of inertia ($\mbox{amu \AA}^{2}$). |
399 |
|
400 |
\begin{table} |
401 |
\caption{Meta-data Keywords: Required Parameters} |
402 |
\label{table:reqParams} |
403 |
\begin{center} |
404 |
% Note when adding or removing columns, the \hsize numbers must add up to the total number |
405 |
% of columns. |
406 |
\begin{tabularx}{\linewidth}% |
407 |
{>{\setlength{\hsize}{1.00\hsize}}X% |
408 |
>{\setlength{\hsize}{0.4\hsize}}X% |
409 |
>{\setlength{\hsize}{1.2\hsize}}X% |
410 |
>{\setlength{\hsize}{1.4\hsize}}X} |
411 |
|
412 |
{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline |
413 |
|
414 |
{\tt forceField} & string & Sets the force field. & Possible force fields are "DUFF", "LJ", and "EAM". \\ |
415 |
{\tt nComponents} & integer & Sets the number of components. & Needs to appear before the first {\tt Component} block. \\ |
416 |
{\tt initialConfig} & string & Sets the file containing the initial configuration. & Can point to any file containing the configuration in the correct order. \\ |
417 |
{\tt minimizer}& string & Chooses a minimizer & Possible minimizers |
418 |
are "SD" and "CG". Either {\tt ensemble} or {\tt minimizer} must be specified. \\ |
419 |
{\tt ensemble} & string & Sets the ensemble. & Possible ensembles are |
420 |
"NVE", "NVT", "NPTi", "NPTf", and "NPTxyz". Either {\tt ensemble} |
421 |
or {\tt minimizer} must be specified. \\ |
422 |
{\tt dt} & fs & Sets the time step. & Selection of {\tt dt} should be |
423 |
small enough to sample the fastest motion of the simulation. (required |
424 |
for molecular dynamics simulations)\\ |
425 |
{\tt runTime} & fs & Sets the time at which the simulation should |
426 |
end. & This is an absolute time, and will end the simulation when the |
427 |
current time meets or exceeds the {\tt runTime}. (required for |
428 |
molecular dynamics simulations)\\ |
429 |
|
430 |
\end{tabularx} |
431 |
\end{center} |
432 |
\end{table} |
433 |
|
434 |
\begin{table} |
435 |
\caption{Meta-data Keywords: General Parameters} |
436 |
\label{table:genParams} |
437 |
\begin{center} |
438 |
% Note when adding or removing columns, the \hsize numbers must add up to the total number |
439 |
% of columns. |
440 |
\begin{tabularx}{\linewidth}% |
441 |
{>{\setlength{\hsize}{1.00\hsize}}X% |
442 |
>{\setlength{\hsize}{0.4\hsize}}X% |
443 |
>{\setlength{\hsize}{1.2\hsize}}X% |
444 |
>{\setlength{\hsize}{1.4\hsize}}X} |
445 |
|
446 |
{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline |
447 |
|
448 |
{\tt finalConfig} & string & Sets the name of the final |
449 |
output file. & Useful when stringing simulations together. Defaults to |
450 |
the root name of the initial meta-data file but with an {\tt .eor} |
451 |
extension. \\ |
452 |
{\tt useInitialTime} & logical & Sets whether the initial time is taken from the {\tt .in} file. & Useful when recovering a simulation from a crashed processor. Default is false. \\ |
453 |
{\tt sampleTime} & fs & Sets the frequency at which the {\tt .dump} file is written. & Default sets the frequency to the {\tt runTime}. \\ |
454 |
{\tt statusTime} & fs & Sets the frequency at which the {\tt .stat} file is written. & Defaults set the frequency to the {\tt sampleTime}. \\ |
455 |
{\tt cutoffRadius} & $\mbox{\AA}$ & Manually sets the cutoffRadius & Defaults to |
456 |
$15\mbox{\AA}$ for systems containing charges or dipoles or to $2.5 |
457 |
\sigma_{L}$, where $\sigma_{L}$ is the largest LJ $\sigma$ in the |
458 |
simulation. \\ |
459 |
{\tt switchingRadius} & $\mbox{\AA}$ & Manually sets the inner radius for the switching function. & Defaults to 95~\% of the {\tt cutoffRadius}. \\ |
460 |
{\tt useReactionField} & logical & Turns the reaction field correction on/off. & Default is "false". \\ |
461 |
{\tt dielectric} & unitless & Sets the dielectric constant for reaction field. & If {\tt useReactionField} is true, then {\tt dielectric} must be set. \\ |
462 |
{\tt usePeriodicBoundaryConditions} & & & \\ |
463 |
& logical & Turns periodic boundary conditions on/off. & Default is "true". \\ |
464 |
{\tt seed } & integer & Sets the seed value for the random number |
465 |
generator. & The seed needs to be at least 9 digits long. The default |
466 |
is to take the seed from the CPU clock. \\ |
467 |
{\tt forceFieldVariant} & string & Sets the name of the variant of the |
468 |
force field. ({\sc eam} has three variants: {\tt u3}, {\tt u6}, and |
469 |
{\tt VC}. |
470 |
|
471 |
\end{tabularx} |
472 |
\end{center} |
473 |
\end{table} |
474 |
|
475 |
|
476 |
\subsection{\label{oopseSec:coordFiles}Coordinate Files} |
477 |
|
478 |
The standard format for storage of a systems coordinates is a modified |
479 |
xyz-file syntax, the exact details of which can be seen in |
480 |
Scheme~\ref{sch:dumpFormat}. As all bonding and molecular information |
481 |
is stored in the meta-data files, the coordinate files contain only |
482 |
the coordinates of the objects which move independently during the |
483 |
simulation. It is important to note that {\it not all atoms} are |
484 |
capable of independent motion. Atoms which are part of rigid bodies |
485 |
are not ``integrable objects'' in the equations of motion; the rigid |
486 |
bodies themselves are the integrable objects. Therefore, the |
487 |
coordinate file contains coordinates of all the {\tt |
488 |
integrableObjects} in the system. For systems without rigid bodies, |
489 |
this is simply the coordinates of all the atoms. |
490 |
|
491 |
It is important to note that although the simulation propagates the |
492 |
complete rotation matrix, directional entities are written out using |
493 |
quaternions to save space in the output files. All objects (atoms, |
494 |
orientational atoms, and rigid bodies) are given quaternions and |
495 |
angular momenta in coordinate files which are output by OOPSE, but it |
496 |
is not necessary for the user to specify the quaternions or angular |
497 |
momenta for atoms without orientational degrees of freedom. |
498 |
|
499 |
\begin{lstlisting}[float,caption={[The format of the coordinate |
500 |
files] An example of the format of the coordinate files. The fist line |
501 |
is the number of {\tt integrableObjects} (freely-moving atoms and |
502 |
rigid bodies). The second line begins with the time stamp followed by |
503 |
the three $\mathsf{H}$ column vectors. It is important to note that |
504 |
for extended system ensembles, additional information pertinent to the |
505 |
integrators may be stored on this line as well. The next lines are the |
506 |
coordinates for all integrable objects in the system. The name of the |
507 |
integrable object is followed by position, velocity, quaternions, and |
508 |
lastly, body fixed angular momentum.},label=sch:dumpFormat] |
509 |
|
510 |
nIntegrable |
511 |
time; Hxx Hyx Hzx; Hxy Hyy Hzy; Hxz Hyz Hzz; |
512 |
Name1 x y z vx vy vz qw qx qy qz jx jy jz |
513 |
Name2 x y z vx vy vz qw qx qy qz jx jy jz |
514 |
etc... |
515 |
|
516 |
\end{lstlisting} |
517 |
|
518 |
The {\tt name} field for atoms is simply the atom type as specified in |
519 |
the meta-data file. The {\tt name} field for a rigid body is |
520 |
specified as {\tt MOLTYPE\_RB\_N}, to specify that this is {\tt |
521 |
rigidBody} N in a molecule of type MOLTYPE. In simulations with rigid |
522 |
body models of water, a sample coordinate line might be: |
523 |
|
524 |
\begin{tt} |
525 |
TIP3P\_RB\_0 x y z vx vy vz qw qx qy qz jx jy jz |
526 |
\end{tt} |
527 |
|
528 |
which tells the program that the rigid body representing a TIP3P |
529 |
molecule (rigid body \# 0) is listed on that line. |
530 |
|
531 |
There are three files used by {\sc oopse} which are written in the |
532 |
coordinate format. They are: the initial coordinate file |
533 |
(\texttt{.in}), the simulation trajectory file (\texttt{.dump}), and |
534 |
the final coordinates or ``end-of-run'' for the simulation |
535 |
(\texttt{.eor}). The initial coordinate file is necessary for {\sc |
536 |
oopse} to start the simulation with the proper coordinates, and this |
537 |
file must be generated by the user before the simulation run. The |
538 |
trajectory (or ``dump'') file is updated during simulation and is used |
539 |
to store snapshots of the coordinates at regular intervals. The first |
540 |
frame is a duplication of the |
541 |
\texttt{.in} file, and each subsequent frame is appended to the file |
542 |
at an interval specified in the meta-data file with the |
543 |
\texttt{sampleTime} flag. The final coordinate file is the |
544 |
``end-of-run'' file. The \texttt{.eor} file stores the final |
545 |
configuration of the system for a given simulation. The file is |
546 |
updated at the same time as the \texttt{.dump} file, but it only |
547 |
contains the most recent frame. In this way, an \texttt{.eor} file may |
548 |
be used to initialize a second simulation should it be necessary to |
549 |
recover from a crash or power outage. |
550 |
|
551 |
\subsection{\label{oopseSec:initCoords}Generation of Initial Coordinates} |
552 |
|
553 |
As was stated in Sec.~\ref{oopseSec:coordFiles}, an initial coordinate |
554 |
file is needed to provide the starting coordinates for a simulation. |
555 |
Since each simulation is different, system creation is left to the end |
556 |
user; however, we have included a few sample programs which make some |
557 |
specialized structures. The {\tt .in} file must list the integrable |
558 |
objects in the correct order. The ordering of the integrable objects |
559 |
relies on the ordering of molecules within the meta-data file. {\sc |
560 |
oopse} expects the order to comply with the following guidelines: |
561 |
\begin{enumerate} |
562 |
\item All of the molecules of the first declared component are given |
563 |
before proceeding to the molecules of the second component, and so on |
564 |
for all subsequently declared components. |
565 |
\item The ordering of the atoms for each molecule follows the order |
566 |
declared in the molecule's declaration within the model file. |
567 |
\item Only atoms which are not members of a {\tt rigidBody} are |
568 |
included |
569 |
\item Rigid Body coordinates for a molecule are listed immediately |
570 |
after the the other atoms in a molecule. Some molecules may be |
571 |
entirely rigid, in which case, only the rigid body coordinates are |
572 |
given. |
573 |
\end{enumerate} |
574 |
An example is given in the meta-data file in Scheme~\ref{sch:initEx1} |
575 |
which results in the {\tt .in} file shown in Scheme~\ref{sch:initEx2}. |
576 |
|
577 |
\begin{lstlisting}[float,caption={Example declaration of the |
578 |
$\text{I}_2$ molecule and the HCl molecule. The two molecules are then |
579 |
included into a simulation.}, label=sch:initEx1] |
580 |
|
581 |
molecule{ |
582 |
name = "I2"; |
583 |
nAtoms = 2; |
584 |
atom[0]{ |
585 |
type = "I"; |
586 |
} |
587 |
atom[1]{ |
588 |
type = "I"; |
589 |
} |
590 |
nBonds = 1; |
591 |
bond[0]{ |
592 |
members( 0, 1); |
593 |
} |
594 |
} |
595 |
|
596 |
molecule{ |
597 |
name = "HCl" |
598 |
nAtoms = 2; |
599 |
atom[0]{ |
600 |
type = "H"; |
601 |
} |
602 |
atom[1]{ |
603 |
type = "Cl"; |
604 |
} |
605 |
nBonds = 1; |
606 |
bond[0]{ |
607 |
members( 0, 1); |
608 |
} |
609 |
} |
610 |
|
611 |
nComponents = 2; |
612 |
component{ |
613 |
type = "HCl"; |
614 |
nMol = 4; |
615 |
} |
616 |
component{ |
617 |
type = "I2"; |
618 |
nMol = 1; |
619 |
} |
620 |
|
621 |
initialConfig = "mixture.in"; |
622 |
|
623 |
\end{lstlisting} |
624 |
|
625 |
\begin{lstlisting}[float,caption={The contents of the {\tt |
626 |
mixture.in} file matching the declarations in |
627 |
Scheme~\ref{sch:initEx1}. Note that even though $\text{I}_2$ is |
628 |
declared before HCl, the {\tt .in} file follows the order {\it in |
629 |
which the components were included}.},label=sch:initEx2] |
630 |
|
631 |
10 |
632 |
0.0; 10.0 0.0 0.0; 0.0 10.0 0.0; 0.0 0.0 10.0; |
633 |
H ... |
634 |
Cl ... |
635 |
H ... |
636 |
Cl ... |
637 |
H ... |
638 |
Cl ... |
639 |
H ... |
640 |
Cl ... |
641 |
I ... |
642 |
I ... |
643 |
|
644 |
\end{lstlisting} |
645 |
|
646 |
|
647 |
\subsection{The Statistics File} |
648 |
|
649 |
The last output file generated by {\sc oopse} is the statistics |
650 |
file. This file records such statistical quantities as the |
651 |
instantaneous temperature (in $K$), volume (in $\mbox{\AA}^{3}$), |
652 |
pressure (in $\mbox{atm}$), etc. It is written out with the frequency |
653 |
specified in the meta-data file with the |
654 |
\texttt{statusTime} keyword. The file allows the user to observe the |
655 |
system variables as a function of simulation time while the simulation |
656 |
is in progress. One useful function the statistics file serves is to |
657 |
monitor the conserved quantity of a given simulation ensemble, |
658 |
allowing the user to gauge the stability of the integrator. The |
659 |
statistics file is denoted with the \texttt{.stat} file extension. |
660 |
|
661 |
\section{\label{oopseSec:empiricalEnergy}The Empirical Energy |
662 |
Functions} |
663 |
|
664 |
Like many simulation packages, {\sc oopse} splits the potential energy |
665 |
into the short-ranged (bonded) portion and a long-range (non-bonded) |
666 |
potential, |
667 |
\begin{equation} |
668 |
V = V_{\mathrm{short-range}} + V_{\mathrm{long-range}}. |
669 |
\end{equation} |
670 |
The short-ranged portion includes explicit bonds, bends and torsions, |
671 |
which have been defined in the meta-data file for the molecules which |
672 |
present in the simulation. The functional forms and parameters for |
673 |
these interactions are defined by the force field which is chosen. |
674 |
|
675 |
Calculating long-range (non-bonded) potential involves a sum over all |
676 |
pairs of atoms (except for those atoms which are involved in a bond, |
677 |
bend, or torsion with each other). If done poorly, calculating the |
678 |
the long-range interactions for $N$ atoms would involve $N^2$ |
679 |
evaluations of atomic distance. To reduce the number of distance |
680 |
evaluations between pairs of atoms, {\sc oopse} uses a switched cutoff |
681 |
with Verlet neighbor lists.\cite{allen87:csl} It is well known that |
682 |
neutral groups which contain charges will exhibit pathological forces |
683 |
unless the cutoff is applied to the neutral groups evenly instead of |
684 |
to the individual atoms.\cite{leach01:mm} {\sc oopse} allows users to |
685 |
specify cutoff groups which may contain an arbitrary number of atoms |
686 |
in the molecule. Atoms in a cutoff group are treated as a single unit |
687 |
for the evaluation of the switching function: |
688 |
\begin{equation} |
689 |
V_{\mathrm{long-range}} = \sum_{a} \sum_{b>a} s(r_{ab}) \sum_{i \in a} \sum_{j \in b} V_{ij}(r_{ij}), |
690 |
\end{equation} |
691 |
where $r_{ab}$ is the distance between the centers of mass of the two |
692 |
cutoff groups ($a$ and $b$). |
693 |
|
694 |
The sums over $a$ and $b$ are over the cutoffGroups that are present |
695 |
in the simulation. Atoms which are not explicitly defined as members |
696 |
of a {\tt cutoffGroup} are treated as a group consisting of only one |
697 |
atom. The switching function, $s(r)$ is the standard cubic switching |
698 |
function, |
699 |
\begin{equation} |
700 |
S(r) = |
701 |
\begin{cases} |
702 |
1 & \text{if $r \le r_{\text{sw}}$},\\ |
703 |
\frac{(r_{\text{cut}} + 2r - 3r_{\text{sw}})(r_{\text{cut}} - r)^2} |
704 |
{(r_{\text{cut}} - r_{\text{sw}})^2} |
705 |
& \text{if $r_{\text{sw}} < r \le r_{\text{cut}}$}, \\ |
706 |
0 & \text{if $r > r_{\text{cut}}$.} |
707 |
\end{cases} |
708 |
\label{eq:dipoleSwitching} |
709 |
\end{equation} |
710 |
Here, $r_{\text{sw}}$ is the {\tt switchingRadius}, or the distance |
711 |
beyond which interactions are reduced, and $r_{\text{cut}}$ is the |
712 |
{\tt cutoffRadius}, or the distance at which interactions are |
713 |
truncated. |
714 |
|
715 |
Users of {\sc oopse} do not need to specify the {\tt cutoffRadius} or |
716 |
{\tt switchingRadius}. In simulations containing only Lennard-Jones |
717 |
atoms, the cutoff radius has a default value of $2.5\sigma_{ii}$, |
718 |
where $\sigma_{ii}$ is the largest Lennard-Jones length parameter |
719 |
present in the simulation. In simulations containing charged or |
720 |
dipolar atoms, the default cutoff Radius is $15 \mbox{\AA}$. |
721 |
|
722 |
The {\tt switchingRadius} is set to a default value of 95\% of the |
723 |
{\tt cutoffRadius}. In the special case of a simulation containing |
724 |
{\it only} Lennard-Jones atoms, the default switching radius takes the |
725 |
same value as the cutoff radius, and {\sc oopse} will use a shifted |
726 |
potential to remove discontinuities in the potential at the cutoff. |
727 |
Both radii may be specified in the meta-data file. |
728 |
|
729 |
Force fields can easily be added to {\sc oopse}, although it comes |
730 |
with a few simple examples (Lennard-Jones, {\sc duff}, {\sc water}, |
731 |
and {\sc eam}) which are explained in the following sections. |
732 |
|
733 |
\subsection{\label{sec:LJPot}The Lennard Jones Force Field} |
734 |
|
735 |
The most basic force field implemented in {\sc oopse} is the |
736 |
Lennard-Jones force field, which mimics the van der Waals interaction |
737 |
at long distances and uses an empirical repulsion at short |
738 |
distances. The Lennard-Jones potential is given by: |
739 |
\begin{equation} |
740 |
V_{\text{LJ}}(r_{ij}) = |
741 |
4\epsilon_{ij} \biggl[ |
742 |
\biggl(\frac{\sigma_{ij}}{r_{ij}}\biggr)^{12} |
743 |
- \biggl(\frac{\sigma_{ij}}{r_{ij}}\biggr)^{6} |
744 |
\biggr], |
745 |
\label{eq:lennardJonesPot} |
746 |
\end{equation} |
747 |
where $r_{ij}$ is the distance between particles $i$ and $j$, |
748 |
$\sigma_{ij}$ scales the length of the interaction, and |
749 |
$\epsilon_{ij}$ scales the well depth of the potential. Scheme |
750 |
\ref{sch:LJFF} gives an example meta-data file that |
751 |
sets up a system of 108 Ar particles to be simulated using the |
752 |
Lennard-Jones force field. |
753 |
|
754 |
\begin{lstlisting}[float,caption={[Invocation of the Lennard-Jones |
755 |
force field] A sample meta-data file for a small Lennard-Jones |
756 |
simulation.},label={sch:LJFF}] |
757 |
|
758 |
#include "argon.md" |
759 |
|
760 |
nComponents = 1; |
761 |
component{ |
762 |
type = "Ar"; |
763 |
nMol = 108; |
764 |
} |
765 |
|
766 |
initialConfig = "./argon.in"; |
767 |
|
768 |
forceField = "LJ"; |
769 |
\end{lstlisting} |
770 |
|
771 |
Interactions between dissimilar particles requires the generation of |
772 |
cross term parameters for $\sigma$ and $\epsilon$. These parameters |
773 |
are determined using the Lorentz-Berthelot mixing |
774 |
rules:\cite{allen87:csl} |
775 |
\begin{equation} |
776 |
\sigma_{ij} = \frac{1}{2}[\sigma_{ii} + \sigma_{jj}], |
777 |
\label{eq:sigmaMix} |
778 |
\end{equation} |
779 |
and |
780 |
\begin{equation} |
781 |
\epsilon_{ij} = \sqrt{\epsilon_{ii} \epsilon_{jj}}. |
782 |
\label{eq:epsilonMix} |
783 |
\end{equation} |
784 |
|
785 |
\subsection{\label{oopseSec:DUFF}Dipolar Unified-Atom Force Field} |
786 |
|
787 |
The dipolar unified-atom force field ({\sc duff}) was developed to |
788 |
simulate lipid bilayers. These types of simulations require a model |
789 |
capable of forming bilayers, while still being sufficiently |
790 |
computationally efficient to allow large systems ($\sim$100's of |
791 |
phospholipids, $\sim$1000's of waters) to be simulated for long times |
792 |
($\sim$10's of nanoseconds). With this goal in mind, {\sc duff} has no |
793 |
point charges. Charge-neutral distributions are replaced with dipoles, |
794 |
while most atoms and groups of atoms are reduced to Lennard-Jones |
795 |
interaction sites. This simplification reduces the length scale of |
796 |
long range interactions from $\frac{1}{r}$ to $\frac{1}{r^3}$, |
797 |
removing the need for the computationally expensive Ewald |
798 |
sum. Instead, Verlet neighbor-lists and cutoff radii are used for the |
799 |
dipolar interactions, and, if desired, a reaction field may be added |
800 |
to mimic longer range interactions. |
801 |
|
802 |
As an example, lipid head-groups in {\sc duff} are represented as |
803 |
point dipole interaction sites. Placing a dipole at the head group's |
804 |
center of mass mimics the charge separation found in common |
805 |
phospholipid head groups such as phosphatidylcholine.\cite{Cevc87} |
806 |
Additionally, a large Lennard-Jones site is located at the |
807 |
pseudoatom's center of mass. The model is illustrated by the red atom |
808 |
in Fig.~\ref{oopseFig:lipidModel}. The water model we use to |
809 |
complement the dipoles of the lipids is a |
810 |
reparameterization\cite{fennell04} of the soft sticky dipole (SSD) |
811 |
model of Ichiye |
812 |
\emph{et al.}\cite{liu96:new_model} |
813 |
|
814 |
\begin{figure} |
815 |
\centering |
816 |
\includegraphics[width=\linewidth]{lipidModel.eps} |
817 |
\caption[A representation of a lipid model in {\sc duff}]{A |
818 |
representation of the lipid model. $\phi$ is the torsion angle, |
819 |
$\theta$ is the bend angle, and $\mu$ is the dipole moment of the head |
820 |
group.} |
821 |
\label{oopseFig:lipidModel} |
822 |
\end{figure} |
823 |
|
824 |
A set of scalable parameters has been used to model the alkyl groups |
825 |
with Lennard-Jones sites. For this, parameters from the TraPPE force |
826 |
field of Siepmann \emph{et al.}\cite{Siepmann1998} have been |
827 |
utilized. TraPPE is a unified-atom representation of n-alkanes which |
828 |
is parametrized against phase equilibria using Gibbs ensemble Monte |
829 |
Carlo simulation techniques.\cite{Siepmann1998} One of the advantages |
830 |
of TraPPE is that it generalizes the types of atoms in an alkyl chain |
831 |
to keep the number of pseudoatoms to a minimum; thus, the parameters |
832 |
for a unified atom such as $\text{CH}_2$ do not change depending on |
833 |
what species are bonded to it. |
834 |
|
835 |
As is required by TraPPE, {\sc duff} also constrains all bonds to be |
836 |
of fixed length. Typically, bond vibrations are the fastest motions in |
837 |
a molecular dynamic simulation. With these vibrations present, small |
838 |
time steps between force evaluations must be used to ensure adequate |
839 |
energy conservation in the bond degrees of freedom. By constraining |
840 |
the bond lengths, larger time steps may be used when integrating the |
841 |
equations of motion. A simulation using {\sc duff} is illustrated in |
842 |
Scheme \ref{sch:DUFF}. |
843 |
|
844 |
\begin{lstlisting}[float,caption={[Invocation of {\sc duff}]A portion |
845 |
of a meta-data file showing a simulation utilizing {\sc |
846 |
duff}},label={sch:DUFF}] |
847 |
|
848 |
#include "water.md" |
849 |
#include "lipid.md" |
850 |
|
851 |
nComponents = 2; |
852 |
component{ |
853 |
type = "simpleLipid_16"; |
854 |
nMol = 60; |
855 |
} |
856 |
|
857 |
component{ |
858 |
type = "SSD_water"; |
859 |
nMol = 1936; |
860 |
} |
861 |
|
862 |
initialConfig = "bilayer.in"; |
863 |
|
864 |
forceField = "DUFF"; |
865 |
|
866 |
\end{lstlisting} |
867 |
|
868 |
\subsubsection{\label{oopseSec:energyFunctions}{\sc duff} Energy Functions} |
869 |
|
870 |
The total potential energy function in {\sc duff} is |
871 |
\begin{equation} |
872 |
V = \sum^{N}_{I=1} V^{I}_{\text{Internal}} |
873 |
+ \sum^{N-1}_{I=1} \sum_{J>I} V^{IJ}_{\text{Cross}}, |
874 |
\label{eq:totalPotential} |
875 |
\end{equation} |
876 |
where $V^{I}_{\text{Internal}}$ is the internal potential of molecule $I$: |
877 |
\begin{equation} |
878 |
V^{I}_{\text{Internal}} = |
879 |
\sum_{\theta_{ijk} \in I} V_{\text{bend}}(\theta_{ijk}) |
880 |
+ \sum_{\phi_{ijkl} \in I} V_{\text{torsion}}(\phi_{ijkl}) |
881 |
+ \sum_{i \in I} \sum_{(j>i+4) \in I} |
882 |
\biggl[ V_{\text{LJ}}(r_{ij}) + V_{\text{dipole}} |
883 |
(\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j}) |
884 |
\biggr]. |
885 |
\label{eq:internalPotential} |
886 |
\end{equation} |
887 |
Here $V_{\text{bend}}$ is the bend potential for all 1, 3 bonded pairs |
888 |
within the molecule $I$, and $V_{\text{torsion}}$ is the torsion |
889 |
potential for all 1, 4 bonded pairs. The pairwise portions of the |
890 |
non-bonded interactions are excluded for atom pairs that are involved |
891 |
in the smae bond, bend, or torsion. All other atom pairs within a |
892 |
molecule are subject to the LJ pair potential. |
893 |
|
894 |
The bend potential of a molecule is represented by the following function: |
895 |
\begin{equation} |
896 |
V_{\text{bend}}(\theta_{ijk}) = k_{\theta}( \theta_{ijk} - \theta_0 |
897 |
)^2, \label{eq:bendPot} |
898 |
\end{equation} |
899 |
where $\theta_{ijk}$ is the angle defined by atoms $i$, $j$, and $k$ |
900 |
(see Fig.~\ref{oopseFig:lipidModel}), $\theta_0$ is the equilibrium |
901 |
bond angle, and $k_{\theta}$ is the force constant which determines the |
902 |
strength of the harmonic bend. The parameters for $k_{\theta}$ and |
903 |
$\theta_0$ are borrowed from those in TraPPE.\cite{Siepmann1998} |
904 |
|
905 |
The torsion potential and parameters are also borrowed from TraPPE. It is |
906 |
of the form: |
907 |
\begin{equation} |
908 |
V_{\text{torsion}}(\phi) = c_1[1 + \cos \phi] |
909 |
+ c_2[1 + \cos(2\phi)] |
910 |
+ c_3[1 + \cos(3\phi)], |
911 |
\label{eq:origTorsionPot} |
912 |
\end{equation} |
913 |
where: |
914 |
\begin{equation} |
915 |
\cos\phi = (\hat{\mathbf{r}}_{ij} \times \hat{\mathbf{r}}_{jk}) \cdot |
916 |
(\hat{\mathbf{r}}_{jk} \times \hat{\mathbf{r}}_{kl}). |
917 |
\label{eq:torsPhi} |
918 |
\end{equation} |
919 |
Here, $\hat{\mathbf{r}}_{\alpha\beta}$ are the set of unit bond |
920 |
vectors between atoms $i$, $j$, $k$, and $l$. For computational |
921 |
efficiency, the torsion potential has been recast after the method of |
922 |
{\sc charmm},\cite{Brooks83} in which the angle series is converted to |
923 |
a power series of the form: |
924 |
\begin{equation} |
925 |
V_{\text{torsion}}(\phi) = |
926 |
k_3 \cos^3 \phi + k_2 \cos^2 \phi + k_1 \cos \phi + k_0, |
927 |
\label{eq:torsionPot} |
928 |
\end{equation} |
929 |
where: |
930 |
\begin{align*} |
931 |
k_0 &= c_1 + c_3, \\ |
932 |
k_1 &= c_1 - 3c_3, \\ |
933 |
k_2 &= 2 c_2, \\ |
934 |
k_3 &= 4c_3. |
935 |
\end{align*} |
936 |
By recasting the potential as a power series, repeated trigonometric |
937 |
evaluations are avoided during the calculation of the potential |
938 |
energy. |
939 |
|
940 |
|
941 |
The cross potential between molecules $I$ and $J$, |
942 |
$V^{IJ}_{\text{Cross}}$, is as follows: |
943 |
\begin{equation} |
944 |
V^{IJ}_{\text{Cross}} = |
945 |
\sum_{i \in I} \sum_{j \in J} |
946 |
\biggl[ V_{\text{LJ}}(r_{ij}) + V_{\text{dipole}} |
947 |
(\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j}) |
948 |
+ V_{\text{sticky}} |
949 |
(\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j}) |
950 |
\biggr], |
951 |
\label{eq:crossPotentail} |
952 |
\end{equation} |
953 |
where $V_{\text{LJ}}$ is the Lennard Jones potential, |
954 |
$V_{\text{dipole}}$ is the dipole dipole potential, and |
955 |
$V_{\text{sticky}}$ is the sticky potential defined by the SSD model |
956 |
(Sec.~\ref{oopseSec:SSD}). Note that not all atom types include all |
957 |
interactions. |
958 |
|
959 |
The dipole-dipole potential has the following form: |
960 |
\begin{equation} |
961 |
V_{\text{dipole}}(\mathbf{r}_{ij},\boldsymbol{\Omega}_{i}, |
962 |
\boldsymbol{\Omega}_{j}) = \frac{|\mu_i||\mu_j|}{4\pi\epsilon_{0}r_{ij}^{3}} \biggl[ |
963 |
\boldsymbol{\hat{u}}_{i} \cdot \boldsymbol{\hat{u}}_{j} |
964 |
- |
965 |
3(\boldsymbol{\hat{u}}_i \cdot \hat{\mathbf{r}}_{ij}) % |
966 |
(\boldsymbol{\hat{u}}_j \cdot \hat{\mathbf{r}}_{ij}) \biggr]. |
967 |
\label{eq:dipolePot} |
968 |
\end{equation} |
969 |
Here $\mathbf{r}_{ij}$ is the vector starting at atom $i$ pointing |
970 |
towards $j$, and $\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$ |
971 |
are the orientational degrees of freedom for atoms $i$ and $j$ |
972 |
respectively. The magnitude of the dipole moment of atom $i$ is |
973 |
$|\mu_i|$, $\boldsymbol{\hat{u}}_i$ is the standard unit orientation |
974 |
vector of $\boldsymbol{\Omega}_i$, and $\boldsymbol{\hat{r}}_{ij}$ is |
975 |
the unit vector pointing along $\mathbf{r}_{ij}$ |
976 |
($\boldsymbol{\hat{r}}_{ij}=\mathbf{r}_{ij}/|\mathbf{r}_{ij}|$). |
977 |
|
978 |
\subsubsection{\label{oopseSec:SSD}The {\sc duff} Water Models: SSD/E |
979 |
and SSD/RF} |
980 |
|
981 |
In the interest of computational efficiency, the default solvent used |
982 |
by {\sc oopse} is the extended Soft Sticky Dipole (SSD/E) water |
983 |
model.\cite{fennell04} The original SSD was developed by Ichiye |
984 |
\emph{et al.}\cite{liu96:new_model} as a modified form of the hard-sphere |
985 |
water model proposed by Bratko, Blum, and |
986 |
Luzar.\cite{Bratko85,Bratko95} It consists of a single point dipole |
987 |
with a Lennard-Jones core and a sticky potential that directs the |
988 |
particles to assume the proper hydrogen bond orientation in the first |
989 |
solvation shell. Thus, the interaction between two SSD water molecules |
990 |
\emph{i} and \emph{j} is given by the potential |
991 |
\begin{equation} |
992 |
V_{ij} = |
993 |
V_{ij}^{LJ} (r_{ij})\ + V_{ij}^{dp} |
994 |
(\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)\ + |
995 |
V_{ij}^{sp} |
996 |
(\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j), |
997 |
\label{eq:ssdPot} |
998 |
\end{equation} |
999 |
where the $\mathbf{r}_{ij}$ is the position vector between molecules |
1000 |
\emph{i} and \emph{j} with magnitude equal to the distance $r_{ij}$, and |
1001 |
$\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$ represent the |
1002 |
orientations of the respective molecules. The Lennard-Jones and dipole |
1003 |
parts of the potential are given by equations \ref{eq:lennardJonesPot} |
1004 |
and \ref{eq:dipolePot} respectively. The sticky part is described by |
1005 |
the following, |
1006 |
\begin{equation} |
1007 |
u_{ij}^{sp}(\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)= |
1008 |
\frac{\nu_0}{2}[s(r_{ij})w(\mathbf{r}_{ij}, |
1009 |
\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j) + |
1010 |
s^\prime(r_{ij})w^\prime(\mathbf{r}_{ij}, |
1011 |
\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)]\ , |
1012 |
\label{eq:stickyPot} |
1013 |
\end{equation} |
1014 |
where $\nu_0$ is a strength parameter for the sticky potential, and |
1015 |
$s$ and $s^\prime$ are cubic switching functions which turn off the |
1016 |
sticky interaction beyond the first solvation shell. The $w$ function |
1017 |
can be thought of as an attractive potential with tetrahedral |
1018 |
geometry: |
1019 |
\begin{equation} |
1020 |
w({\bf r}_{ij},{\bf \Omega}_i,{\bf \Omega}_j)= |
1021 |
\sin\theta_{ij}\sin2\theta_{ij}\cos2\phi_{ij}, |
1022 |
\label{eq:stickyW} |
1023 |
\end{equation} |
1024 |
while the $w^\prime$ function counters the normal aligned and |
1025 |
anti-aligned structures favored by point dipoles: |
1026 |
\begin{equation} |
1027 |
w^\prime({\bf r}_{ij},{\bf \Omega}_i,{\bf \Omega}_j)= |
1028 |
(\cos\theta_{ij}-0.6)^2(\cos\theta_{ij}+0.8)^2-w^0, |
1029 |
\label{eq:stickyWprime} |
1030 |
\end{equation} |
1031 |
It should be noted that $w$ is proportional to the sum of the $Y_3^2$ |
1032 |
and $Y_3^{-2}$ spherical harmonics (a linear combination which |
1033 |
enhances the tetrahedral geometry for hydrogen bonded structures), |
1034 |
while $w^\prime$ is a purely empirical function. A more detailed |
1035 |
description of the functional parts and variables in this potential |
1036 |
can be found in the original SSD |
1037 |
articles.\cite{liu96:new_model,liu96:monte_carlo,chandra99:ssd_md,Ichiye03} |
1038 |
|
1039 |
\begin{figure} |
1040 |
\centering |
1041 |
\includegraphics[width=\linewidth]{waterAngle.eps} |
1042 |
\caption[Coordinate definition for the SSD/E water model]{Coordinates |
1043 |
for the interaction between two SSD/E water molecules. $\theta_{ij}$ |
1044 |
is the angle that $r_{ij}$ makes with the $\hat{z}$ vector in the |
1045 |
body-fixed frame for molecule $i$. The $\hat{z}$ vector bisects the |
1046 |
HOH angle in each water molecule. } |
1047 |
\label{oopseFig:ssd} |
1048 |
\end{figure} |
1049 |
|
1050 |
|
1051 |
Since SSD/E is a single-point {\it dipolar} model, the force |
1052 |
calculations are simplified significantly relative to the standard |
1053 |
{\it charged} multi-point models. In the original Monte Carlo |
1054 |
simulations using this model, Ichiye {\it et al.} reported that using |
1055 |
SSD decreased computer time by a factor of 6-7 compared to other |
1056 |
models.\cite{liu96:new_model} What is most impressive is that these |
1057 |
savings did not come at the expense of accurate depiction of the |
1058 |
liquid state properties. Indeed, SSD/E maintains reasonable agreement |
1059 |
with the Head-Gordon diffraction data for the structural features of |
1060 |
liquid water.\cite{hura00,liu96:new_model} Additionally, the dynamical |
1061 |
properties exhibited by SSD/E agree with experiment better than those |
1062 |
of more computationally expensive models (like TIP3P and |
1063 |
SPC/E).\cite{chandra99:ssd_md} The combination of speed and accurate |
1064 |
depiction of solvent properties makes SSD/E a very attractive model |
1065 |
for the simulation of large scale biochemical simulations. |
1066 |
|
1067 |
Recent constant pressure simulations revealed issues in the original |
1068 |
SSD model that led to lower than expected densities at all target |
1069 |
pressures.\cite{Ichiye03,fennell04} The default model in {\sc oopse} |
1070 |
is therefore SSD/E, a density corrected derivative of SSD that |
1071 |
exhibits improved liquid structure and transport behavior. If the use |
1072 |
of a reaction field long-range interaction correction is desired, it |
1073 |
is recommended that the parameters be modified to those of the SSD/RF |
1074 |
model (an SSD variant parameterized for reaction field). These solvent |
1075 |
parameters are listed and can be easily modified in the {\sc duff} |
1076 |
force field file ({\tt DUFF.frc}). A table of the parameter values |
1077 |
and the drawbacks and benefits of the different density corrected SSD |
1078 |
models can be found in reference~\citen{fennell04}. |
1079 |
|
1080 |
\subsection{\label{oopseSec:WATER}The {\sc water} Force Field} |
1081 |
|
1082 |
In addition to the {\sc duff} force field's solvent description, a |
1083 |
separate {\sc water} force field has been included for simulating many |
1084 |
of the common rigid-body water models. In addition to the simple or |
1085 |
dipolar models (SSD, SSD1, SSD/E, SSD/RF, and DPD water), the common |
1086 |
charge-based models were included (SPC, SPC/E, TIP3P, TIP4P, and |
1087 |
TIP5P).\cite{liu96:new_model,Ichiye03,fennell04,Marrink01,Berendsen81,Berendsen87,Jorgensen83,Mahoney00} |
1088 |
In order to handle these models, charge-charge interactions were |
1089 |
included in the force-loop: |
1090 |
\begin{equation} |
1091 |
V_{\text{charge}}(r_{ij}) = \sum_{ij}\frac{q_iq_je^2}{r_{ij}}, |
1092 |
\end{equation} |
1093 |
where $q$ represents the charge on particle $i$ or $j$, and $e$ is the |
1094 |
charge of an electron in Coulombs. The charge-charge interaction |
1095 |
support is rudimentary in the current version of {\sc oopse}. As with |
1096 |
the other pair interactions, charges can be simulated with a pure |
1097 |
cutoff or a reaction field. The various methods for performing the |
1098 |
Ewald summation have not yet been included. Also, the charge-dipole |
1099 |
and charge-quadrupole (for interactions between SSD type water and |
1100 |
charges) are not yet available, so it is currently inadvisable to mix |
1101 |
dipolar and charge based molecules in the same system. |
1102 |
|
1103 |
The {\sc water} force field can be easily expanded through |
1104 |
modification of the {\sc water} force field file ({\tt WATER.frc}). By |
1105 |
adding atom types and inserting the appropriate parameters, it is |
1106 |
possible to extend the force field to handle rigid molecules other |
1107 |
than water. |
1108 |
|
1109 |
\subsection{\label{oopseSec:eam}Embedded Atom Method} |
1110 |
|
1111 |
{\sc oopse} implements a potential that describes bonding in |
1112 |
transition metal |
1113 |
systems.~\cite{Finnis84,Ercolessi88,Chen90,Qi99,Ercolessi02} This |
1114 |
potential has an attractive interaction which models ``Embedding'' a |
1115 |
positively charged pseudo-atom core in the electron density due to the |
1116 |
free valance ``sea'' of electrons created by the surrounding atoms in |
1117 |
the system. A pairwise part of the potential (which is primarily |
1118 |
repulsive) describes the interaction of the positively charged metal |
1119 |
core ions with one another. The Embedded Atom Method ({\sc |
1120 |
eam})~\cite{Daw84,FBD86,johnson89,Lu97} has been widely adopted in the |
1121 |
materials science community and has been included in {\sc oopse}. A |
1122 |
good review of {\sc eam} and other formulations of metallic potentials |
1123 |
was given by Voter.\cite{Voter:95} |
1124 |
|
1125 |
The {\sc eam} potential has the form: |
1126 |
\begin{equation} |
1127 |
V = \sum_{i} F_{i}\left[\rho_{i}\right] + \sum_{i} \sum_{j \neq i} |
1128 |
\phi_{ij}({\bf r}_{ij}) |
1129 |
\end{equation} |
1130 |
where $F_{i} $ is an embedding functional that approximates the energy |
1131 |
required to embed a positively-charged core ion $i$ into a linear |
1132 |
superposition of spherically averaged atomic electron densities given |
1133 |
by $\rho_{i}$, |
1134 |
\begin{equation} |
1135 |
\rho_{i} = \sum_{j \neq i} f_{j}({\bf r}_{ij}), |
1136 |
\end{equation} |
1137 |
Since the density at site $i$ ($\rho_i$) must be computed before the |
1138 |
embedding functional can be evaluated, {\sc eam} and the related |
1139 |
transition metal potentials require two loops through the atom pairs |
1140 |
to compute the inter-atomic forces. |
1141 |
|
1142 |
The pairwise portion of the potential, $\phi_{ij}$, is a primarily |
1143 |
repulsive interaction between atoms $i$ and $j$. In the original |
1144 |
formulation of {\sc eam}\cite{Daw84}, $\phi_{ij}$ was an entirely |
1145 |
repulsive term; however later refinements to {\sc eam} allowed for |
1146 |
more general forms for $\phi$.\cite{Daw89} The effective cutoff |
1147 |
distance, $r_{{\text cut}}$ is the distance at which the values of |
1148 |
$f(r)$ and $\phi(r)$ drop to zero for all atoms present in the |
1149 |
simulation. In practice, this distance is fairly small, limiting the |
1150 |
summations in the {\sc eam} equation to the few dozen atoms |
1151 |
surrounding atom $i$ for both the density $\rho$ and pairwise $\phi$ |
1152 |
interactions. |
1153 |
|
1154 |
In computing forces for alloys, mixing rules as outlined by |
1155 |
Johnson~\cite{johnson89} are used to compute the heterogenous pair |
1156 |
potential, |
1157 |
\begin{eqnarray} |
1158 |
\label{eq:johnson} |
1159 |
\phi_{ab}(r)=\frac{1}{2}\left( |
1160 |
\frac{f_{b}(r)}{f_{a}(r)}\phi_{aa}(r)+ |
1161 |
\frac{f_{a}(r)}{f_{b}(r)}\phi_{bb}(r) |
1162 |
\right). |
1163 |
\end{eqnarray} |
1164 |
No mixing rule is needed for the densities, since the density at site |
1165 |
$i$ is simply the linear sum of density contributions of all the other |
1166 |
atoms. |
1167 |
|
1168 |
The {\sc eam} force field illustrates an additional feature of {\sc |
1169 |
oopse}. Foiles, Baskes and Daw fit {\sc eam} potentials for Cu, Ag, |
1170 |
Au, Ni, Pd, Pt and alloys of these metals.\cite{FBD86} These fits are |
1171 |
included in {\sc oopse} as the {\tt u3} variant of the {\sc eam} force |
1172 |
field. Voter and Chen reparamaterized a set of {\sc eam} functions |
1173 |
which do a better job of predicting melting points.\cite{Voter:87} |
1174 |
These functions are included in {\sc oopse} as the {\tt VC} variant of |
1175 |
the {\sc eam} force field. An additional set of functions (the |
1176 |
``Universal 6'' functions) are included in {\sc oopse} as the {\tt u6} |
1177 |
variant of {\sc eam}. For example, to specify the Voter-Chen variant |
1178 |
of the {\sc eam} force field, the user would add the {\tt |
1179 |
forceFieldVariant = "VC";} line to the meta-data file. |
1180 |
|
1181 |
The potential files used by the {\sc eam} force field are in the |
1182 |
standard {\tt funcfl} format, which is the format utilized by a number |
1183 |
of other codes (e.g. ParaDyn~\cite{Paradyn}, {\sc dynamo 86}). It |
1184 |
should be noted that the energy units in these files are in eV, not |
1185 |
$\mbox{kcal mol}^{-1}$ as in the rest of the {\sc oopse} force field |
1186 |
files. |
1187 |
|
1188 |
\subsection{\label{oopseSec:pbc}Periodic Boundary Conditions} |
1189 |
|
1190 |
\newcommand{\roundme}{\operatorname{round}} |
1191 |
|
1192 |
\textit{Periodic boundary conditions} are widely used to simulate bulk |
1193 |
properties with a relatively small number of particles. In this method |
1194 |
the simulation box is replicated throughout space to form an infinite |
1195 |
lattice. During the simulation, when a particle moves in the primary |
1196 |
cell, its image in other cells move in exactly the same direction with |
1197 |
exactly the same orientation. Thus, as a particle leaves the primary |
1198 |
cell, one of its images will enter through the opposite face. If the |
1199 |
simulation box is large enough to avoid ``feeling'' the symmetries of |
1200 |
the periodic lattice, surface effects can be ignored. The available |
1201 |
periodic cells in {\sc oopse} are cubic, orthorhombic and |
1202 |
parallelepiped. {\sc oopse} use a $3 \times 3$ matrix, $\mathsf{H}$, |
1203 |
to describe the shape and size of the simulation box. $\mathsf{H}$ is |
1204 |
defined: |
1205 |
\begin{equation} |
1206 |
\mathsf{H} = ( \mathbf{h}_x, \mathbf{h}_y, \mathbf{h}_z ), |
1207 |
\end{equation} |
1208 |
where $\mathbf{h}_{\alpha}$ is the column vector of the $\alpha$ axis of the |
1209 |
box. During the course of the simulation both the size and shape of |
1210 |
the box can be changed to allow volume fluctuations when constraining |
1211 |
the pressure. |
1212 |
|
1213 |
A real space vector, $\mathbf{r}$ can be transformed in to a box space |
1214 |
vector, $\mathbf{s}$, and back through the following transformations: |
1215 |
\begin{align} |
1216 |
\mathbf{s} &= \mathsf{H}^{-1} \mathbf{r}, \\ |
1217 |
\mathbf{r} &= \mathsf{H} \mathbf{s}. |
1218 |
\end{align} |
1219 |
The vector $\mathbf{s}$ is now a vector expressed as the number of box |
1220 |
lengths in the $\mathbf{h}_x$, $\mathbf{h}_y$, and $\mathbf{h}_z$ |
1221 |
directions. To find the minimum image of a vector $\mathbf{r}$, {\sc |
1222 |
oopse} first converts it to its corresponding vector in box space, and |
1223 |
then casts each element to lie in the range $[-0.5,0.5]$: |
1224 |
\begin{equation} |
1225 |
s_{i}^{\prime}=s_{i}-\roundme(s_{i}), |
1226 |
\end{equation} |
1227 |
where $s_i$ is the $i$th element of $\mathbf{s}$, and |
1228 |
$\roundme(s_i)$ is given by |
1229 |
\begin{equation} |
1230 |
\roundme(x) = |
1231 |
\begin{cases} |
1232 |
\lfloor x+0.5 \rfloor & \text{if $x \ge 0$,} \\ |
1233 |
\lceil x-0.5 \rceil & \text{if $x < 0$.} |
1234 |
\end{cases} |
1235 |
\end{equation} |
1236 |
Here $\lfloor x \rfloor$ is the floor operator, and gives the largest |
1237 |
integer value that is not greater than $x$, and $\lceil x \rceil$ is |
1238 |
the ceiling operator, and gives the smallest integer that is not less |
1239 |
than $x$. |
1240 |
|
1241 |
Finally, the minimum image coordinates $\mathbf{r}^{\prime}$ are |
1242 |
obtained by transforming back to real space, |
1243 |
\begin{equation} |
1244 |
\mathbf{r}^{\prime}=\mathsf{H}^{-1}\mathbf{s}^{\prime}.% |
1245 |
\end{equation} |
1246 |
In this way, particles are allowed to diffuse freely in $\mathbf{r}$, |
1247 |
but their minimum images, or $\mathbf{r}^{\prime}$, are used to compute |
1248 |
the inter-atomic forces. |
1249 |
|
1250 |
|
1251 |
|
1252 |
\section{\label{oopseSec:mechanics}Mechanics} |
1253 |
|
1254 |
\subsection{\label{oopseSec:integrate}Integrating the Equations of Motion: the |
1255 |
DLM method} |
1256 |
|
1257 |
The default method for integrating the equations of motion in {\sc |
1258 |
oopse} is a velocity-Verlet version of the symplectic splitting method |
1259 |
proposed by Dullweber, Leimkuhler and McLachlan |
1260 |
(DLM).\cite{Dullweber1997} When there are no directional atoms or |
1261 |
rigid bodies present in the simulation, this integrator becomes the |
1262 |
standard velocity-Verlet integrator which is known to sample the |
1263 |
microcanonical (NVE) ensemble.\cite{Frenkel1996} |
1264 |
|
1265 |
Previous integration methods for orientational motion have problems |
1266 |
that are avoided in the DLM method. Direct propagation of the Euler |
1267 |
angles has a known $1/\sin\theta$ divergence in the equations of |
1268 |
motion for $\phi$ and $\psi$,\cite{allen87:csl} leading to numerical |
1269 |
instabilities any time one of the directional atoms or rigid bodies |
1270 |
has an orientation near $\theta=0$ or $\theta=\pi$. Quaternion-based |
1271 |
integration methods work well for propagating orientational motion; |
1272 |
however, energy conservation concerns arise when using the |
1273 |
microcanonical (NVE) ensemble. An earlier implementation of {\sc |
1274 |
oopse} utilized quaternions for propagation of rotational motion; |
1275 |
however, a detailed investigation showed that they resulted in a |
1276 |
steady drift in the total energy, something that has been observed by |
1277 |
Laird {\it et al.}\cite{Laird97} |
1278 |
|
1279 |
The key difference in the integration method proposed by Dullweber |
1280 |
\emph{et al.} is that the entire $3 \times 3$ rotation matrix is |
1281 |
propagated from one time step to the next. In the past, this would not |
1282 |
have been feasible, since the rotation matrix for a single body has |
1283 |
nine elements compared with the more memory-efficient methods (using |
1284 |
three Euler angles or 4 quaternions). Computer memory has become much |
1285 |
less costly in recent years, and this can be translated into |
1286 |
substantial benefits in energy conservation. |
1287 |
|
1288 |
The basic equations of motion being integrated are derived from the |
1289 |
Hamiltonian for conservative systems containing rigid bodies, |
1290 |
\begin{equation} |
1291 |
H = \sum_{i} \left( \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i + |
1292 |
\frac{1}{2} {\bf j}_i^T \cdot \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot |
1293 |
{\bf j}_i \right) + |
1294 |
V\left(\left\{{\bf r}\right\}, \left\{\mathsf{A}\right\}\right), |
1295 |
\end{equation} |
1296 |
where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian position vector |
1297 |
and velocity of the center of mass of particle $i$, and ${\bf j}_i$, |
1298 |
$\overleftrightarrow{\mathsf{I}}_i$ are the body-fixed angular |
1299 |
momentum and moment of inertia tensor respectively, and the |
1300 |
superscript $T$ denotes the transpose of the vector. $\mathsf{A}_i$ |
1301 |
is the $3 \times 3$ rotation matrix describing the instantaneous |
1302 |
orientation of the particle. $V$ is the potential energy function |
1303 |
which may depend on both the positions $\left\{{\bf r}\right\}$ and |
1304 |
orientations $\left\{\mathsf{A}\right\}$ of all particles. The |
1305 |
equations of motion for the particle centers of mass are derived from |
1306 |
Hamilton's equations and are quite simple, |
1307 |
\begin{eqnarray} |
1308 |
\dot{{\bf r}} & = & {\bf v}, \\ |
1309 |
\dot{{\bf v}} & = & \frac{{\bf f}}{m}, |
1310 |
\end{eqnarray} |
1311 |
where ${\bf f}$ is the instantaneous force on the center of mass |
1312 |
of the particle, |
1313 |
\begin{equation} |
1314 |
{\bf f} = - \frac{\partial}{\partial |
1315 |
{\bf r}} V(\left\{{\bf r}(t)\right\}, \left\{\mathsf{A}(t)\right\}). |
1316 |
\end{equation} |
1317 |
|
1318 |
The equations of motion for the orientational degrees of freedom are |
1319 |
\begin{eqnarray} |
1320 |
\dot{\mathsf{A}} & = & \mathsf{A} \cdot |
1321 |
\mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right),\\ |
1322 |
\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1} |
1323 |
\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial |
1324 |
V}{\partial \mathsf{A}} \right). |
1325 |
\end{eqnarray} |
1326 |
In these equations of motion, the $\mbox{skew}$ matrix of a vector |
1327 |
${\bf v} = \left( v_1, v_2, v_3 \right)$ is defined: |
1328 |
\begin{equation} |
1329 |
\mbox{skew}\left( {\bf v} \right) := \left( |
1330 |
\begin{array}{ccc} |
1331 |
0 & v_3 & - v_2 \\ |
1332 |
-v_3 & 0 & v_1 \\ |
1333 |
v_2 & -v_1 & 0 |
1334 |
\end{array} |
1335 |
\right). |
1336 |
\end{equation} |
1337 |
The $\mbox{rot}$ notation refers to the mapping of the $3 \times 3$ |
1338 |
rotation matrix to a vector of orientations by first computing the |
1339 |
skew-symmetric part $\left(\mathsf{A} - \mathsf{A}^{T}\right)$ and |
1340 |
then associating this with a length 3 vector by inverting the |
1341 |
$\mbox{skew}$ function above: |
1342 |
\begin{equation} |
1343 |
\mbox{rot}\left(\mathsf{A}\right) := \mbox{ skew}^{-1}\left(\mathsf{A} |
1344 |
- \mathsf{A}^{T} \right). |
1345 |
\end{equation} |
1346 |
Written this way, the $\mbox{rot}$ operation creates a set of |
1347 |
conjugate angle coordinates to the body-fixed angular momenta |
1348 |
represented by ${\bf j}$. This equation of motion for angular momenta |
1349 |
is equivalent to the more familiar body-fixed forms, |
1350 |
\begin{eqnarray} |
1351 |
\dot{j_{x}} & = & \tau^b_x(t) - |
1352 |
\left(\overleftrightarrow{\mathsf{I}}_{yy}^{-1} - \overleftrightarrow{\mathsf{I}}_{zz}^{-1} \right) j_y j_z, \\ |
1353 |
\dot{j_{y}} & = & \tau^b_y(t) - |
1354 |
\left(\overleftrightarrow{\mathsf{I}}_{zz}^{-1} - \overleftrightarrow{\mathsf{I}}_{xx}^{-1} \right) j_z j_x,\\ |
1355 |
\dot{j_{z}} & = & \tau^b_z(t) - |
1356 |
\left(\overleftrightarrow{\mathsf{I}}_{xx}^{-1} - \overleftrightarrow{\mathsf{I}}_{yy}^{-1} \right) j_x j_y, |
1357 |
\end{eqnarray} |
1358 |
which utilize the body-fixed torques, ${\bf \tau}^b$. Torques are |
1359 |
most easily derived in the space-fixed frame, |
1360 |
\begin{equation} |
1361 |
{\bf \tau}^b(t) = \mathsf{A}(t) \cdot {\bf \tau}^s(t), |
1362 |
\end{equation} |
1363 |
where the torques are either derived from the forces on the |
1364 |
constituent atoms of the rigid body, or for directional atoms, |
1365 |
directly from derivatives of the potential energy, |
1366 |
\begin{equation} |
1367 |
{\bf \tau}^s(t) = - \hat{\bf u}(t) \times \left( \frac{\partial} |
1368 |
{\partial \hat{\bf u}} V\left(\left\{ {\bf r}(t) \right\}, \left\{ |
1369 |
\mathsf{A}(t) \right\}\right) \right). |
1370 |
\end{equation} |
1371 |
Here $\hat{\bf u}$ is a unit vector pointing along the principal axis |
1372 |
of the particle in the space-fixed frame. |
1373 |
|
1374 |
The DLM method uses a Trotter factorization of the orientational |
1375 |
propagator. This has three effects: |
1376 |
\begin{enumerate} |
1377 |
\item the integrator is area-preserving in phase space (i.e. it is |
1378 |
{\it symplectic}), |
1379 |
\item the integrator is time-{\it reversible}, making it suitable for Hybrid |
1380 |
Monte Carlo applications, and |
1381 |
\item the error for a single time step is of order $\mathcal{O}\left(h^4\right)$ |
1382 |
for timesteps of length $h$. |
1383 |
\end{enumerate} |
1384 |
|
1385 |
The integration of the equations of motion is carried out in a |
1386 |
velocity-Verlet style 2-part algorithm, where $h= \delta t$: |
1387 |
|
1388 |
{\tt moveA:} |
1389 |
\begin{align*} |
1390 |
{\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) |
1391 |
+ \frac{h}{2} \left( {\bf f}(t) / m \right), \\ |
1392 |
% |
1393 |
{\bf r}(t + h) &\leftarrow {\bf r}(t) |
1394 |
+ h {\bf v}\left(t + h / 2 \right), \\ |
1395 |
% |
1396 |
{\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t) |
1397 |
+ \frac{h}{2} {\bf \tau}^b(t), \\ |
1398 |
% |
1399 |
\mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left( h {\bf j} |
1400 |
(t + h / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} \right). |
1401 |
\end{align*} |
1402 |
|
1403 |
In this context, the $\mathrm{rotate}$ function is the reversible product |
1404 |
of the three body-fixed rotations, |
1405 |
\begin{equation} |
1406 |
\mathrm{rotate}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot |
1407 |
\mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y / |
1408 |
2) \cdot \mathsf{G}_x(a_x /2), |
1409 |
\end{equation} |
1410 |
where each rotational propagator, $\mathsf{G}_\alpha(\theta)$, rotates |
1411 |
both the rotation matrix ($\mathsf{A}$) and the body-fixed angular |
1412 |
momentum (${\bf j}$) by an angle $\theta$ around body-fixed axis |
1413 |
$\alpha$, |
1414 |
\begin{equation} |
1415 |
\mathsf{G}_\alpha( \theta ) = \left\{ |
1416 |
\begin{array}{lcl} |
1417 |
\mathsf{A}(t) & \leftarrow & \mathsf{A}(0) \cdot \mathsf{R}_\alpha(\theta)^T, \\ |
1418 |
{\bf j}(t) & \leftarrow & \mathsf{R}_\alpha(\theta) \cdot {\bf j}(0). |
1419 |
\end{array} |
1420 |
\right. |
1421 |
\end{equation} |
1422 |
$\mathsf{R}_\alpha$ is a quadratic approximation to |
1423 |
the single-axis rotation matrix. For example, in the small-angle |
1424 |
limit, the rotation matrix around the body-fixed x-axis can be |
1425 |
approximated as |
1426 |
\begin{equation} |
1427 |
\mathsf{R}_x(\theta) \approx \left( |
1428 |
\begin{array}{ccc} |
1429 |
1 & 0 & 0 \\ |
1430 |
0 & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} & -\frac{\theta}{1+ |
1431 |
\theta^2 / 4} \\ |
1432 |
0 & \frac{\theta}{1+ |
1433 |
\theta^2 / 4} & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} |
1434 |
\end{array} |
1435 |
\right). |
1436 |
\end{equation} |
1437 |
All other rotations follow in a straightforward manner. |
1438 |
|
1439 |
After the first part of the propagation, the forces and body-fixed |
1440 |
torques are calculated at the new positions and orientations |
1441 |
|
1442 |
{\tt doForces:} |
1443 |
\begin{align*} |
1444 |
{\bf f}(t + h) &\leftarrow |
1445 |
- \left(\frac{\partial V}{\partial {\bf r}}\right)_{{\bf r}(t + h)}, \\ |
1446 |
% |
1447 |
{\bf \tau}^{s}(t + h) &\leftarrow {\bf u}(t + h) |
1448 |
\times \frac{\partial V}{\partial {\bf u}}, \\ |
1449 |
% |
1450 |
{\bf \tau}^{b}(t + h) &\leftarrow \mathsf{A}(t + h) |
1451 |
\cdot {\bf \tau}^s(t + h). |
1452 |
\end{align*} |
1453 |
|
1454 |
{\sc oopse} automatically updates ${\bf u}$ when the rotation matrix |
1455 |
$\mathsf{A}$ is calculated in {\tt moveA}. Once the forces and |
1456 |
torques have been obtained at the new time step, the velocities can be |
1457 |
advanced to the same time value. |
1458 |
|
1459 |
{\tt moveB:} |
1460 |
\begin{align*} |
1461 |
{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + h / 2 \right) |
1462 |
+ \frac{h}{2} \left( {\bf f}(t + h) / m \right), \\ |
1463 |
% |
1464 |
{\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t + h / 2 \right) |
1465 |
+ \frac{h}{2} {\bf \tau}^b(t + h) . |
1466 |
\end{align*} |
1467 |
|
1468 |
The matrix rotations used in the DLM method end up being more costly |
1469 |
computationally than the simpler arithmetic quaternion |
1470 |
propagation. With the same time step, a 1024-molecule water simulation |
1471 |
shows an 12\% increase in computation time (averaged over several |
1472 |
different time steps) using the DLM method in place of |
1473 |
quaternions. This cost is more than justified when comparing the |
1474 |
energy conservation of the two methods. Figure ~\ref{quatdlm} provides |
1475 |
a comparative analysis of the {\sc dlm} method versus the simple |
1476 |
quaternion method that was originally implemented. |
1477 |
|
1478 |
\begin{figure} |
1479 |
\centering |
1480 |
\includegraphics[width=\linewidth]{quatvsdlm.eps} |
1481 |
\caption[Energy conservation analysis of the {\sc dlm} and quaternion |
1482 |
integration methods]{The logarithm of absolute value of the slope of |
1483 |
the energy drift (\delta E$_1$) and the standard deviation of the |
1484 |
energy fluctuations (\delta E$_0$) as a function of chosen time |
1485 |
step. All simulations were of a 1024-molecule simulation of SSD water |
1486 |
at 298 K starting from the same initial configuration. Note that the |
1487 |
{\sc dlm} method provides a greater-than order-of-magnitude |
1488 |
improvement in energy conservation and relative energy fluctuations |
1489 |
over the quaternion method at all the tested time steps. The energy |
1490 |
drift is quite steep for the larger time steps in both methods, and |
1491 |
results in discontinuous behavior as the systems compound their |
1492 |
anomolous energy accumulation.} |
1493 |
\label{quatdlm} |
1494 |
\end{figure} |
1495 |
|
1496 |
In Fig.~\ref{quatdlm}, \delta E$_1$ is a measure of the linear energy |
1497 |
drift in units of kcal/mol per particle over a nanosecond of |
1498 |
simulation time, and \delta E$_0$ is the standard deviation of the |
1499 |
energy fluctuations in units of kcal/mol per particle. In the top |
1500 |
plot, it is apparent that the energy drift is reduced by a significant |
1501 |
amount (2 to 3 orders-of-magnitude improvement at every tested time |
1502 |
step) by chosing the {\sc dlm} method over the simple non-symplectic |
1503 |
quaternion integration method. When the energy drift becomes very |
1504 |
small ($log_{10}[|\delta\text{E}_1|] < -3$), it is more difficult to |
1505 |
calculate a slope, resulting in the larger displayed error bars. In |
1506 |
addition to this improvement in energy drift, the fluctuation is the |
1507 |
total energy are also dampened out by 1 to 2 orders-of-magnitude by |
1508 |
utilizing the {\sc dlm} integration method. |
1509 |
|
1510 |
It was stated previously that the {\sc dlm} method was the more |
1511 |
computationally expensive of the two implimented integration |
1512 |
methodologies. In order to incorporate this information into the |
1513 |
energy analysis a plot of energy drift versus computational cost was |
1514 |
generated (Fig.~\ref{cpuCost}). This figure provides an estimate of |
1515 |
the CPU time required under the two integration schemes for 1 |
1516 |
nanosecond of simulation time for the model 1024-molecule system. The |
1517 |
plot is read by chosing a desired energy drift value and determining |
1518 |
where both the curves cross. If a \delta E$_1$ of 1E-3 kcal/mol per |
1519 |
particle is desired, a nanosecond of simulation time will require ~19 |
1520 |
hours of CPU time with the {\sc dlm} integrator, while the same small |
1521 |
drift value will require ~154 hours of CPU time. This demonstrates the |
1522 |
computational advantage of the integration scheme utilized in {\sc |
1523 |
oopse}. |
1524 |
|
1525 |
\begin{figure} |
1526 |
\centering |
1527 |
\includegraphics[width=\linewidth]{compCost.eps} |
1528 |
\caption[Energy drift as a function of required simulation run |
1529 |
time]{The logarithm of absolute value of the slope of the energy drift |
1530 |
(\delta E$_1$) as a function of simulation run time. Simulations were |
1531 |
performed on a single 2.5 GHz Pentium IV processor. Simulation time |
1532 |
comparisons can be made by tracing horizontally from one curve to the |
1533 |
other. For example, a simulation that takes ~24 hours using the {\sc |
1534 |
dlm} method will take roughly 210 hours using the simple quaternion |
1535 |
method if the same degree of energy conservation is desired.} |
1536 |
\label{cpuCost} |
1537 |
\end{figure} |
1538 |
|
1539 |
There is only one specific keyword relevant to the default integrator, |
1540 |
and that is the time step for integrating the equations of motion. |
1541 |
|
1542 |
\begin{center} |
1543 |
\begin{tabular}{llll} |
1544 |
{\bf variable} & {\bf Meta-data keyword} & {\bf units} & {\bf |
1545 |
default value} \\ |
1546 |
$h$ & {\tt dt = 2.0;} & fs & none |
1547 |
\end{tabular} |
1548 |
\end{center} |
1549 |
|
1550 |
\subsection{\label{sec:extended}Extended Systems for other Ensembles} |
1551 |
|
1552 |
{\sc oopse} implements a number of extended system integrators for |
1553 |
sampling from other ensembles relevant to chemical physics. The |
1554 |
integrator can be selected with the {\tt ensemble} keyword in the |
1555 |
meta-data file: |
1556 |
|
1557 |
\begin{center} |
1558 |
\begin{tabular}{lll} |
1559 |
{\bf Integrator} & {\bf Ensemble} & {\bf Meta-data instruction} \\ |
1560 |
NVE & microcanonical & {\tt ensemble = NVE; } \\ |
1561 |
NVT & canonical & {\tt ensemble = NVT; } \\ |
1562 |
NPTi & isobaric-isothermal & {\tt ensemble = NPTi;} \\ |
1563 |
& (with isotropic volume changes) & \\ |
1564 |
NPTf & isobaric-isothermal & {\tt ensemble = NPTf;} \\ |
1565 |
& (with changes to box shape) & \\ |
1566 |
NPTxyz & approximate isobaric-isothermal & {\tt ensemble = NPTxyz;} \\ |
1567 |
& (with separate barostats on each box dimension) & \\ |
1568 |
\end{tabular} |
1569 |
\end{center} |
1570 |
|
1571 |
The relatively well-known Nos\'e-Hoover thermostat\cite{Hoover85} is |
1572 |
implemented in {\sc oopse}'s NVT integrator. This method couples an |
1573 |
extra degree of freedom (the thermostat) to the kinetic energy of the |
1574 |
system and it has been shown to sample the canonical distribution in |
1575 |
the system degrees of freedom while conserving a quantity that is, to |
1576 |
within a constant, the Helmholtz free energy.\cite{melchionna93} |
1577 |
|
1578 |
NPT algorithms attempt to maintain constant pressure in the system by |
1579 |
coupling the volume of the system to a barostat. {\sc oopse} contains |
1580 |
three different constant pressure algorithms. The first two, NPTi and |
1581 |
NPTf have been shown to conserve a quantity that is, to within a |
1582 |
constant, the Gibbs free energy.\cite{melchionna93} The Melchionna |
1583 |
modification to the Hoover barostat is implemented in both NPTi and |
1584 |
NPTf. NPTi allows only isotropic changes in the simulation box, while |
1585 |
box {\it shape} variations are allowed in NPTf. The NPTxyz integrator |
1586 |
has {\it not} been shown to sample from the isobaric-isothermal |
1587 |
ensemble. It is useful, however, in that it maintains orthogonality |
1588 |
for the axes of the simulation box while attempting to equalize |
1589 |
pressure along the three perpendicular directions in the box. |
1590 |
|
1591 |
Each of the extended system integrators requires additional keywords |
1592 |
to set target values for the thermodynamic state variables that are |
1593 |
being held constant. Keywords are also required to set the |
1594 |
characteristic decay times for the dynamics of the extended |
1595 |
variables. |
1596 |
|
1597 |
\begin{center} |
1598 |
\begin{tabular}{llll} |
1599 |
{\bf variable} & {\bf Meta-data instruction} & {\bf units} & {\bf |
1600 |
default value} \\ |
1601 |
$T_{\mathrm{target}}$ & {\tt targetTemperature = 300;} & K & none \\ |
1602 |
$P_{\mathrm{target}}$ & {\tt targetPressure = 1;} & atm & none \\ |
1603 |
$\tau_T$ & {\tt tauThermostat = 1e3;} & fs & none \\ |
1604 |
$\tau_B$ & {\tt tauBarostat = 5e3;} & fs & none \\ |
1605 |
& {\tt resetTime = 200;} & fs & none \\ |
1606 |
& {\tt useInitialExtendedSystemState = true;} & logical & |
1607 |
true |
1608 |
\end{tabular} |
1609 |
\end{center} |
1610 |
|
1611 |
Two additional keywords can be used to either clear the extended |
1612 |
system variables periodically ({\tt resetTime}), or to maintain the |
1613 |
state of the extended system variables between simulations ({\tt |
1614 |
useInitialExtendedSystemState}). More details on these variables |
1615 |
and their use in the integrators follows below. |
1616 |
|
1617 |
\subsection{\label{oopseSec:noseHooverThermo}Nos\'{e}-Hoover Thermostatting} |
1618 |
|
1619 |
The Nos\'e-Hoover equations of motion are given by\cite{Hoover85} |
1620 |
\begin{eqnarray} |
1621 |
\dot{{\bf r}} & = & {\bf v}, \\ |
1622 |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v} ,\\ |
1623 |
\dot{\mathsf{A}} & = & \mathsf{A} \cdot |
1624 |
\mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right), \\ |
1625 |
\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1} |
1626 |
\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial |
1627 |
V}{\partial \mathsf{A}} \right) - \chi {\bf j}. |
1628 |
\label{eq:nosehoovereom} |
1629 |
\end{eqnarray} |
1630 |
|
1631 |
$\chi$ is an ``extra'' variable included in the extended system, and |
1632 |
it is propagated using the first order equation of motion |
1633 |
\begin{equation} |
1634 |
\dot{\chi} = \frac{1}{\tau_{T}^2} \left( \frac{T}{T_{\mathrm{target}}} - 1 \right). |
1635 |
\label{eq:nosehooverext} |
1636 |
\end{equation} |
1637 |
|
1638 |
The instantaneous temperature $T$ is proportional to the total kinetic |
1639 |
energy (both translational and orientational) and is given by |
1640 |
\begin{equation} |
1641 |
T = \frac{2 K}{f k_B} |
1642 |
\end{equation} |
1643 |
Here, $f$ is the total number of degrees of freedom in the system, |
1644 |
\begin{equation} |
1645 |
f = 3 N + 3 N_{\mathrm{orient}} - N_{\mathrm{constraints}}, |
1646 |
\end{equation} |
1647 |
and $K$ is the total kinetic energy, |
1648 |
\begin{equation} |
1649 |
K = \sum_{i=1}^{N} \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i + |
1650 |
\sum_{i=1}^{N_{\mathrm{orient}}} \frac{1}{2} {\bf j}_i^T \cdot |
1651 |
\overleftrightarrow{\mathsf{I}}_i^{-1} \cdot {\bf j}_i. |
1652 |
\end{equation} |
1653 |
|
1654 |
In eq.(\ref{eq:nosehooverext}), $\tau_T$ is the time constant for |
1655 |
relaxation of the temperature to the target value. To set values for |
1656 |
$\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one would use the |
1657 |
{\tt tauThermostat} and {\tt targetTemperature} keywords in the |
1658 |
meta-data file. The units for {\tt tauThermostat} are fs, and the |
1659 |
units for the {\tt targetTemperature} are degrees K. The integration |
1660 |
of the equations of motion is carried out in a velocity-Verlet style 2 |
1661 |
part algorithm: |
1662 |
|
1663 |
{\tt moveA:} |
1664 |
\begin{align*} |
1665 |
T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\ |
1666 |
% |
1667 |
{\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) |
1668 |
+ \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) |
1669 |
\chi(t)\right), \\ |
1670 |
% |
1671 |
{\bf r}(t + h) &\leftarrow {\bf r}(t) |
1672 |
+ h {\bf v}\left(t + h / 2 \right) ,\\ |
1673 |
% |
1674 |
{\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t) |
1675 |
+ \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) |
1676 |
\chi(t) \right) ,\\ |
1677 |
% |
1678 |
\mathsf{A}(t + h) &\leftarrow \mathrm{rotate} |
1679 |
\left(h * {\bf j}(t + h / 2) |
1680 |
\overleftrightarrow{\mathsf{I}}^{-1} \right) ,\\ |
1681 |
% |
1682 |
\chi\left(t + h / 2 \right) &\leftarrow \chi(t) |
1683 |
+ \frac{h}{2 \tau_T^2} \left( \frac{T(t)} |
1684 |
{T_{\mathrm{target}}} - 1 \right) . |
1685 |
\end{align*} |
1686 |
|
1687 |
Here $\mathrm{rotate}(h * {\bf j} |
1688 |
\overleftrightarrow{\mathsf{I}}^{-1})$ is the same symplectic Trotter |
1689 |
factorization of the three rotation operations that was discussed in |
1690 |
the section on the DLM integrator. Note that this operation modifies |
1691 |
both the rotation matrix $\mathsf{A}$ and the angular momentum ${\bf |
1692 |
j}$. {\tt moveA} propagates velocities by a half time step, and |
1693 |
positional degrees of freedom by a full time step. The new positions |
1694 |
(and orientations) are then used to calculate a new set of forces and |
1695 |
torques in exactly the same way they are calculated in the {\tt |
1696 |
doForces} portion of the DLM integrator. |
1697 |
|
1698 |
Once the forces and torques have been obtained at the new time step, |
1699 |
the temperature, velocities, and the extended system variable can be |
1700 |
advanced to the same time value. |
1701 |
|
1702 |
{\tt moveB:} |
1703 |
\begin{align*} |
1704 |
T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, |
1705 |
\left\{{\bf j}(t + h)\right\}, \\ |
1706 |
% |
1707 |
\chi\left(t + h \right) &\leftarrow \chi\left(t + h / |
1708 |
2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+h)} |
1709 |
{T_{\mathrm{target}}} - 1 \right), \\ |
1710 |
% |
1711 |
{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t |
1712 |
+ h / 2 \right) + \frac{h}{2} \left( |
1713 |
\frac{{\bf f}(t + h)}{m} - {\bf v}(t + h) |
1714 |
\chi(t h)\right) ,\\ |
1715 |
% |
1716 |
{\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t |
1717 |
+ h / 2 \right) + \frac{h}{2} |
1718 |
\left( {\bf \tau}^b(t + h) - {\bf j}(t + h) |
1719 |
\chi(t + h) \right) . |
1720 |
\end{align*} |
1721 |
|
1722 |
Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required to calculate |
1723 |
$T(t + h)$ as well as $\chi(t + h)$, they indirectly depend on their |
1724 |
own values at time $t + h$. {\tt moveB} is therefore done in an |
1725 |
iterative fashion until $\chi(t + h)$ becomes self-consistent. The |
1726 |
relative tolerance for the self-consistency check defaults to a value |
1727 |
of $\mbox{10}^{-6}$, but {\sc oopse} will terminate the iteration |
1728 |
after 4 loops even if the consistency check has not been satisfied. |
1729 |
|
1730 |
The Nos\'e-Hoover algorithm is known to conserve a Hamiltonian for the |
1731 |
extended system that is, to within a constant, identical to the |
1732 |
Helmholtz free energy,\cite{melchionna93} |
1733 |
\begin{equation} |
1734 |
H_{\mathrm{NVT}} = V + K + f k_B T_{\mathrm{target}} \left( |
1735 |
\frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime |
1736 |
\right). |
1737 |
\end{equation} |
1738 |
Poor choices of $h$ or $\tau_T$ can result in non-conservation |
1739 |
of $H_{\mathrm{NVT}}$, so the conserved quantity is maintained in the |
1740 |
last column of the {\tt .stat} file to allow checks on the quality of |
1741 |
the integration. |
1742 |
|
1743 |
Bond constraints are applied at the end of both the {\tt moveA} and |
1744 |
{\tt moveB} portions of the algorithm. Details on the constraint |
1745 |
algorithms are given in section \ref{oopseSec:rattle}. |
1746 |
|
1747 |
\subsection{\label{sec:NPTi}Constant-pressure integration with |
1748 |
isotropic box deformations (NPTi)} |
1749 |
|
1750 |
To carry out isobaric-isothermal ensemble calculations, {\sc oopse} |
1751 |
implements the Melchionna modifications to the Nos\'e-Hoover-Andersen |
1752 |
equations of motion.\cite{melchionna93} The equations of motion are |
1753 |
the same as NVT with the following exceptions: |
1754 |
|
1755 |
\begin{eqnarray} |
1756 |
\dot{{\bf r}} & = & {\bf v} + \eta \left( {\bf r} - {\bf R}_0 \right), \\ |
1757 |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\eta + \chi) {\bf v}, \\ |
1758 |
\dot{\eta} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V \left( P - |
1759 |
P_{\mathrm{target}} \right), \\ |
1760 |
\dot{\mathcal{V}} & = & 3 \mathcal{V} \eta . |
1761 |
\label{eq:melchionna1} |
1762 |
\end{eqnarray} |
1763 |
|
1764 |
$\chi$ and $\eta$ are the ``extra'' degrees of freedom in the extended |
1765 |
system. $\chi$ is a thermostat, and it has the same function as it |
1766 |
does in the Nos\'e-Hoover NVT integrator. $\eta$ is a barostat which |
1767 |
controls changes to the volume of the simulation box. ${\bf R}_0$ is |
1768 |
the location of the center of mass for the entire system, and |
1769 |
$\mathcal{V}$ is the volume of the simulation box. At any time, the |
1770 |
volume can be calculated from the determinant of the matrix which |
1771 |
describes the box shape: |
1772 |
\begin{equation} |
1773 |
\mathcal{V} = \det(\mathsf{H}). |
1774 |
\end{equation} |
1775 |
|
1776 |
The NPTi integrator requires an instantaneous pressure. This quantity |
1777 |
is calculated via the pressure tensor, |
1778 |
\begin{equation} |
1779 |
\overleftrightarrow{\mathsf{P}}(t) = \frac{1}{\mathcal{V}(t)} \left( |
1780 |
\sum_{i=1}^{N} m_i {\bf v}_i(t) \otimes {\bf v}_i(t) \right) + |
1781 |
\overleftrightarrow{\mathsf{W}}(t). |
1782 |
\end{equation} |
1783 |
The kinetic contribution to the pressure tensor utilizes the {\it |
1784 |
outer} product of the velocities, denoted by the $\otimes$ symbol. The |
1785 |
stress tensor is calculated from another outer product of the |
1786 |
inter-atomic separation vectors (${\bf r}_{ij} = {\bf r}_j - {\bf |
1787 |
r}_i$) with the forces between the same two atoms, |
1788 |
\begin{equation} |
1789 |
\overleftrightarrow{\mathsf{W}}(t) = \sum_{i} \sum_{j>i} {\bf r}_{ij}(t) |
1790 |
\otimes {\bf f}_{ij}(t). |
1791 |
\end{equation} |
1792 |
In systems containing cutoff groups, the stress tensor is computed |
1793 |
between the centers-of-mass of the cutoff groups: |
1794 |
\begin{equation} |
1795 |
\overleftrightarrow{\mathsf{W}}(t) = \sum_{a} \sum_{b} {\bf r}_{ab}(t) |
1796 |
\otimes {\bf f}_{ab}(t). |
1797 |
\end{equation} |
1798 |
where ${\bf r}_{ab}$ is the distance between the centers of mass, and |
1799 |
\begin{equation} |
1800 |
{\bf f}_{ab} = s(r_{ab}) \sum_{i \in a} \sum_{j \in b} {\bf f}_{ij} + |
1801 |
s\prime(r_{ab}) \frac{{\bf r}_{ab}}{|r_{ab}|} \sum_{i \in a} \sum_{j |
1802 |
\in b} V_{ij}({\bf r}_{ij}). |
1803 |
\end{equation} |
1804 |
|
1805 |
The instantaneous pressure is then simply obtained from the trace of |
1806 |
the pressure tensor, |
1807 |
\begin{equation} |
1808 |
P(t) = \frac{1}{3} \mathrm{Tr} \left( \overleftrightarrow{\mathsf{P}}(t). |
1809 |
\right) |
1810 |
\end{equation} |
1811 |
|
1812 |
In eq.(\ref{eq:melchionna1}), $\tau_B$ is the time constant for |
1813 |
relaxation of the pressure to the target value. To set values for |
1814 |
$\tau_B$ or $P_{\mathrm{target}}$ in a simulation, one would use the |
1815 |
{\tt tauBarostat} and {\tt targetPressure} keywords in the meta-data |
1816 |
file. The units for {\tt tauBarostat} are fs, and the units for the |
1817 |
{\tt targetPressure} are atmospheres. Like in the NVT integrator, the |
1818 |
integration of the equations of motion is carried out in a |
1819 |
velocity-Verlet style 2 part algorithm with only the following differences: |
1820 |
|
1821 |
{\tt moveA:} |
1822 |
\begin{align*} |
1823 |
P(t) &\leftarrow \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\} ,\\ |
1824 |
% |
1825 |
{\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) |
1826 |
+ \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) |
1827 |
\left(\chi(t) + \eta(t) \right) \right), \\ |
1828 |
% |
1829 |
\eta(t + h / 2) &\leftarrow \eta(t) + \frac{h |
1830 |
\mathcal{V}(t)}{2 N k_B T(t) \tau_B^2} \left( P(t) |
1831 |
- P_{\mathrm{target}} \right), \\ |
1832 |
% |
1833 |
{\bf r}(t + h) &\leftarrow {\bf r}(t) + h |
1834 |
\left\{ {\bf v}\left(t + h / 2 \right) |
1835 |
+ \eta(t + h / 2)\left[ {\bf r}(t + h) |
1836 |
- {\bf R}_0 \right] \right\} ,\\ |
1837 |
% |
1838 |
\mathsf{H}(t + h) &\leftarrow e^{-h \eta(t + h / 2)} |
1839 |
\mathsf{H}(t). |
1840 |
\end{align*} |
1841 |
|
1842 |
The propagation of positions to time $t + h$ |
1843 |
depends on the positions at the same time. {\sc oopse} carries out |
1844 |
this step iteratively (with a limit of 5 passes through the iterative |
1845 |
loop). Also, the simulation box $\mathsf{H}$ is scaled uniformly for |
1846 |
one full time step by an exponential factor that depends on the value |
1847 |
of $\eta$ at time $t + |
1848 |
h / 2$. Reshaping the box uniformly also scales the volume of |
1849 |
the box by |
1850 |
\begin{equation} |
1851 |
\mathcal{V}(t + h) \leftarrow e^{ - 3 h \eta(t + h /2)} \times |
1852 |
\mathcal{V}(t) |
1853 |
\end{equation} |
1854 |
|
1855 |
The {\tt doForces} step for the NPTi integrator is exactly the same as |
1856 |
in both the DLM and NVT integrators. Once the forces and torques have |
1857 |
been obtained at the new time step, the velocities can be advanced to |
1858 |
the same time value. |
1859 |
|
1860 |
{\tt moveB:} |
1861 |
\begin{align*} |
1862 |
P(t + h) &\leftarrow \left\{{\bf r}(t + h)\right\}, |
1863 |
\left\{{\bf v}(t + h)\right\}, \\ |
1864 |
% |
1865 |
\eta(t + h) &\leftarrow \eta(t + h / 2) + |
1866 |
\frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h) |
1867 |
\tau_B^2} \left( P(t + h) - P_{\mathrm{target}} \right), \\ |
1868 |
% |
1869 |
{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t |
1870 |
+ h / 2 \right) + \frac{h}{2} \left( |
1871 |
\frac{{\bf f}(t + h)}{m} - {\bf v}(t + h) |
1872 |
(\chi(t + h) + \eta(t + h)) \right) ,\\ |
1873 |
% |
1874 |
{\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t |
1875 |
+ h / 2 \right) + \frac{h}{2} \left( {\bf |
1876 |
\tau}^b(t + h) - {\bf j}(t + h) |
1877 |
\chi(t + h) \right) . |
1878 |
\end{align*} |
1879 |
|
1880 |
Once again, since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required |
1881 |
to calculate $T(t + h)$, $P(t + h)$, $\chi(t + h)$, and $\eta(t + |
1882 |
h)$, they indirectly depend on their own values at time $t + h$. {\tt |
1883 |
moveB} is therefore done in an iterative fashion until $\chi(t + h)$ |
1884 |
and $\eta(t + h)$ become self-consistent. The relative tolerance for |
1885 |
the self-consistency check defaults to a value of $\mbox{10}^{-6}$, |
1886 |
but {\sc oopse} will terminate the iteration after 4 loops even if the |
1887 |
consistency check has not been satisfied. |
1888 |
|
1889 |
The Melchionna modification of the Nos\'e-Hoover-Andersen algorithm is |
1890 |
known to conserve a Hamiltonian for the extended system that is, to |
1891 |
within a constant, identical to the Gibbs free energy, |
1892 |
\begin{equation} |
1893 |
H_{\mathrm{NPTi}} = V + K + f k_B T_{\mathrm{target}} \left( |
1894 |
\frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime |
1895 |
\right) + P_{\mathrm{target}} \mathcal{V}(t). |
1896 |
\end{equation} |
1897 |
Poor choices of $\delta t$, $\tau_T$, or $\tau_B$ can result in |
1898 |
non-conservation of $H_{\mathrm{NPTi}}$, so the conserved quantity is |
1899 |
maintained in the last column of the {\tt .stat} file to allow checks |
1900 |
on the quality of the integration. It is also known that this |
1901 |
algorithm samples the equilibrium distribution for the enthalpy |
1902 |
(including contributions for the thermostat and barostat), |
1903 |
\begin{equation} |
1904 |
H_{\mathrm{NPTi}} = V + K + \frac{f k_B T_{\mathrm{target}}}{2} \left( |
1905 |
\chi^2 \tau_T^2 + \eta^2 \tau_B^2 \right) + P_{\mathrm{target}} |
1906 |
\mathcal{V}(t). |
1907 |
\end{equation} |
1908 |
|
1909 |
Bond constraints are applied at the end of both the {\tt moveA} and |
1910 |
{\tt moveB} portions of the algorithm. Details on the constraint |
1911 |
algorithms are given in section \ref{oopseSec:rattle}. |
1912 |
|
1913 |
\subsection{\label{sec:NPTf}Constant-pressure integration with a |
1914 |
flexible box (NPTf)} |
1915 |
|
1916 |
There is a relatively simple generalization of the |
1917 |
Nos\'e-Hoover-Andersen method to include changes in the simulation box |
1918 |
{\it shape} as well as in the volume of the box. This method utilizes |
1919 |
the full $3 \times 3$ pressure tensor and introduces a tensor of |
1920 |
extended variables ($\overleftrightarrow{\eta}$) to control changes to |
1921 |
the box shape. The equations of motion for this method differ from |
1922 |
those of NPTi as follows: |
1923 |
\begin{eqnarray} |
1924 |
\dot{{\bf r}} & = & {\bf v} + \overleftrightarrow{\eta} \cdot \left( {\bf r} - {\bf R}_0 \right), \\ |
1925 |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\overleftrightarrow{\eta} + |
1926 |
\chi \cdot \mathsf{1}) {\bf v}, \\ |
1927 |
\dot{\overleftrightarrow{\eta}} & = & \frac{1}{\tau_{B}^2 f k_B |
1928 |
T_{\mathrm{target}}} V \left( \overleftrightarrow{\mathsf{P}} - P_{\mathrm{target}}\mathsf{1} \right) ,\\ |
1929 |
\dot{\mathsf{H}} & = & \overleftrightarrow{\eta} \cdot \mathsf{H} . |
1930 |
\label{eq:melchionna2} |
1931 |
\end{eqnarray} |
1932 |
|
1933 |
Here, $\mathsf{1}$ is the unit matrix and $\overleftrightarrow{\mathsf{P}}$ |
1934 |
is the pressure tensor. Again, the volume, $\mathcal{V} = \det |
1935 |
\mathsf{H}$. |
1936 |
|
1937 |
The propagation of the equations of motion is nearly identical to the |
1938 |
NPTi integration: |
1939 |
|
1940 |
{\tt moveA:} |
1941 |
\begin{align*} |
1942 |
\overleftrightarrow{\mathsf{P}}(t) &\leftarrow \left\{{\bf r}(t)\right\}, |
1943 |
\left\{{\bf v}(t)\right\} ,\\ |
1944 |
% |
1945 |
{\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) |
1946 |
+ \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - |
1947 |
\left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot |
1948 |
{\bf v}(t) \right), \\ |
1949 |
% |
1950 |
\overleftrightarrow{\eta}(t + h / 2) &\leftarrow |
1951 |
\overleftrightarrow{\eta}(t) + \frac{h \mathcal{V}(t)}{2 N k_B |
1952 |
T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t) |
1953 |
- P_{\mathrm{target}}\mathsf{1} \right), \\ |
1954 |
% |
1955 |
{\bf r}(t + h) &\leftarrow {\bf r}(t) + h \left\{ {\bf v} |
1956 |
\left(t + h / 2 \right) + \overleftrightarrow{\eta}(t + |
1957 |
h / 2) \cdot \left[ {\bf r}(t + h) |
1958 |
- {\bf R}_0 \right] \right\}, \\ |
1959 |
% |
1960 |
\mathsf{H}(t + h) &\leftarrow \mathsf{H}(t) \cdot e^{-h |
1961 |
\overleftrightarrow{\eta}(t + h / 2)} . |
1962 |
\end{align*} |
1963 |
{\sc oopse} uses a power series expansion truncated at second order |
1964 |
for the exponential operation which scales the simulation box. |
1965 |
|
1966 |
The {\tt moveB} portion of the algorithm is largely unchanged from the |
1967 |
NPTi integrator: |
1968 |
|
1969 |
{\tt moveB:} |
1970 |
\begin{align*} |
1971 |
\overleftrightarrow{\mathsf{P}}(t + h) &\leftarrow \left\{{\bf r} |
1972 |
(t + h)\right\}, \left\{{\bf v}(t |
1973 |
+ h)\right\}, \left\{{\bf f}(t + h)\right\} ,\\ |
1974 |
% |
1975 |
\overleftrightarrow{\eta}(t + h) &\leftarrow |
1976 |
\overleftrightarrow{\eta}(t + h / 2) + |
1977 |
\frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h) |
1978 |
\tau_B^2} \left( \overleftrightarrow{P}(t + h) |
1979 |
- P_{\mathrm{target}}\mathsf{1} \right) ,\\ |
1980 |
% |
1981 |
{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t |
1982 |
+ h / 2 \right) + \frac{h}{2} \left( |
1983 |
\frac{{\bf f}(t + h)}{m} - |
1984 |
(\chi(t + h)\mathsf{1} + \overleftrightarrow{\eta}(t |
1985 |
+ h)) \right) \cdot {\bf v}(t + h), \\ |
1986 |
\end{align*} |
1987 |
|
1988 |
The iterative schemes for both {\tt moveA} and {\tt moveB} are |
1989 |
identical to those described for the NPTi integrator. |
1990 |
|
1991 |
The NPTf integrator is known to conserve the following Hamiltonian: |
1992 |
\begin{equation} |
1993 |
H_{\mathrm{NPTf}} = V + K + f k_B T_{\mathrm{target}} \left( |
1994 |
\frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime |
1995 |
\right) + P_{\mathrm{target}} \mathcal{V}(t) + \frac{f k_B |
1996 |
T_{\mathrm{target}}}{2} |
1997 |
\mathrm{Tr}\left[\overleftrightarrow{\eta}(t)\right]^2 \tau_B^2. |
1998 |
\end{equation} |
1999 |
|
2000 |
This integrator must be used with care, particularly in liquid |
2001 |
simulations. Liquids have very small restoring forces in the |
2002 |
off-diagonal directions, and the simulation box can very quickly form |
2003 |
elongated and sheared geometries which become smaller than the cutoff |
2004 |
radius. The NPTf integrator finds most use in simulating crystals or |
2005 |
liquid crystals which assume non-orthorhombic geometries. |
2006 |
|
2007 |
\subsection{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)} |
2008 |
|
2009 |
There is one additional extended system integrator which is somewhat |
2010 |
simpler than the NPTf method described above. In this case, the three |
2011 |
axes have independent barostats which each attempt to preserve the |
2012 |
target pressure along the box walls perpendicular to that particular |
2013 |
axis. The lengths of the box axes are allowed to fluctuate |
2014 |
independently, but the angle between the box axes does not change. |
2015 |
The equations of motion are identical to those described above, but |
2016 |
only the {\it diagonal} elements of $\overleftrightarrow{\eta}$ are |
2017 |
computed. The off-diagonal elements are set to zero (even when the |
2018 |
pressure tensor has non-zero off-diagonal elements). |
2019 |
|
2020 |
It should be noted that the NPTxyz integrator is {\it not} known to |
2021 |
preserve any Hamiltonian of interest to the chemical physics |
2022 |
community. The integrator is extremely useful, however, in generating |
2023 |
initial conditions for other integration methods. It {\it is} suitable |
2024 |
for use with liquid simulations, or in cases where there is |
2025 |
orientational anisotropy in the system (i.e. in lipid bilayer |
2026 |
simulations). |
2027 |
|
2028 |
\subsection{\label{sec:constraints}Constraint Methods} |
2029 |
|
2030 |
\subsubsection{\label{oopseSec:rattle}The {\sc rattle} Method for Bond |
2031 |
Constraints} |
2032 |
|
2033 |
In order to satisfy the constraints of fixed bond lengths within {\sc |
2034 |
oopse}, we have implemented the {\sc rattle} algorithm of |
2035 |
Andersen.\cite{andersen83} {\sc rattle} is a velocity-Verlet |
2036 |
formulation of the {\sc shake} method\cite{ryckaert77} for iteratively |
2037 |
solving the Lagrange multipliers which maintain the holonomic |
2038 |
constraints. Both methods are covered in depth in the |
2039 |
literature,\cite{leach01:mm,allen87:csl} and a detailed description of |
2040 |
this method would be redundant. |
2041 |
|
2042 |
\subsubsection{\label{oopseSec:zcons}The Z-Constraint Method} |
2043 |
|
2044 |
A force auto-correlation method based on the fluctuation-dissipation |
2045 |
theorem was developed by Roux and Karplus to investigate the dynamics |
2046 |
of ions inside ion channels.\cite{Roux91} The time-dependent friction |
2047 |
coefficient can be calculated from the deviation of the instantaneous |
2048 |
force from its mean value: |
2049 |
\begin{equation} |
2050 |
\xi(z,t)=\langle\delta F(z,t)\delta F(z,0)\rangle/k_{B}T, |
2051 |
\end{equation} |
2052 |
where% |
2053 |
\begin{equation} |
2054 |
\delta F(z,t)=F(z,t)-\langle F(z,t)\rangle. |
2055 |
\end{equation} |
2056 |
|
2057 |
If the time-dependent friction decays rapidly, the static friction |
2058 |
coefficient can be approximated by |
2059 |
\begin{equation} |
2060 |
\xi_{\text{static}}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt. |
2061 |
\end{equation} |
2062 |
|
2063 |
This allows the diffusion constant to then be calculated through the |
2064 |
Einstein relation:\cite{Marrink94} |
2065 |
\begin{equation} |
2066 |
D(z)=\frac{k_{B}T}{\xi_{\text{static}}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty |
2067 |
}\langle\delta F(z,t)\delta F(z,0)\rangle dt}.% |
2068 |
\end{equation} |
2069 |
|
2070 |
The Z-Constraint method, which fixes the $z$ coordinates of a few |
2071 |
``tagged'' molecules with respect to the center of the mass of the |
2072 |
system is a technique that was proposed to obtain the forces required |
2073 |
for the force auto-correlation calculation.\cite{Marrink94} However, |
2074 |
simply resetting the coordinate will move the center of the mass of |
2075 |
the whole system. To avoid this problem, we have developed a new |
2076 |
method that is utilized in {\sc oopse}. Instead of resetting the |
2077 |
coordinates, we reset the forces of $z$-constrained molecules and |
2078 |
subtract the total constraint forces from the rest of the system after |
2079 |
the force calculation at each time step. |
2080 |
|
2081 |
After the force calculation, the total force on molecule $\alpha$, |
2082 |
\begin{equation} |
2083 |
G_{\alpha} = \sum_i F_{\alpha i}, |
2084 |
\label{oopseEq:zc1} |
2085 |
\end{equation} |
2086 |
where $F_{\alpha i}$ is the force in the $z$ direction on atom $i$ in |
2087 |
$z$-constrained molecule $\alpha$. The forces on the atoms in the |
2088 |
$z$-constrained molecule are then adjusted to remove the total force |
2089 |
on molecule $\alpha$: |
2090 |
\begin{equation} |
2091 |
F_{\alpha i} = F_{\alpha i} - |
2092 |
\frac{m_{\alpha i} G_{\alpha}}{\sum_i m_{\alpha i}}. |
2093 |
\end{equation} |
2094 |
Here, $m_{\alpha i}$ is the mass of atom $i$ in the $z$-constrained |
2095 |
molecule. After the forces have been adjusted, the velocities must |
2096 |
also be modified to subtract out molecule $\alpha$'s center-of-mass |
2097 |
velocity in the $z$ direction. |
2098 |
\begin{equation} |
2099 |
v_{\alpha i} = v_{\alpha i} - |
2100 |
\frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}}, |
2101 |
\end{equation} |
2102 |
where $v_{\alpha i}$ is the velocity of atom $i$ in the z direction. |
2103 |
Lastly, all of the accumulated constraint forces must be subtracted |
2104 |
from the rest of the unconstrained system to keep the system center of |
2105 |
mass of the entire system from drifting. |
2106 |
\begin{equation} |
2107 |
F_{\beta i} = F_{\beta i} - \frac{m_{\beta i} \sum_{\alpha} G_{\alpha}} |
2108 |
{\sum_{\beta}\sum_i m_{\beta i}}, |
2109 |
\end{equation} |
2110 |
where $\beta$ denotes all {\it unconstrained} molecules in the |
2111 |
system. Similarly, the velocities of the unconstrained molecules must |
2112 |
also be scaled: |
2113 |
\begin{equation} |
2114 |
v_{\beta i} = v_{\beta i} + \sum_{\alpha} \frac{\sum_i m_{\alpha i} |
2115 |
v_{\alpha i}}{\sum_i m_{\alpha i}}. |
2116 |
\end{equation} |
2117 |
|
2118 |
This method will pin down the centers-of-mass of all of the |
2119 |
$z$-constrained molecules, and will also keep the entire system fixed |
2120 |
at the original system center-of-mass location. |
2121 |
|
2122 |
At the very beginning of the simulation, the molecules may not be at |
2123 |
their desired positions. To steer a $z$-constrained molecule to its |
2124 |
specified position, a simple harmonic potential is used: |
2125 |
\begin{equation} |
2126 |
U(t)=\frac{1}{2}k_{\text{Harmonic}}(z(t)-z_{\text{cons}})^{2},% |
2127 |
\end{equation} |
2128 |
where $k_{\text{Harmonic}}$ is an harmonic force constant, $z(t)$ is |
2129 |
the current $z$ coordinate of the center of mass of the constrained |
2130 |
molecule, and $z_{\text{cons}}$ is the desired constraint |
2131 |
position. The harmonic force operating on the $z$-constrained molecule |
2132 |
at time $t$ can be calculated by |
2133 |
\begin{equation} |
2134 |
F_{z_{\text{Harmonic}}}(t)=-\frac{\partial U(t)}{\partial z(t)}= |
2135 |
-k_{\text{Harmonic}}(z(t)-z_{\text{cons}}). |
2136 |
\end{equation} |
2137 |
|
2138 |
The user may also specify the use of a constant velocity method |
2139 |
(steered molecular dynamics) to move the molecules to their desired |
2140 |
initial positions. |
2141 |
|
2142 |
To use of the $z$-constraint method in an {\sc oopse} simulation, the |
2143 |
molecules must be specified using the {\tt nZconstraints} keyword in |
2144 |
the meta-data file. The other parameters for modifying the behavior |
2145 |
of the $z$-constraint method are listed in table~\ref{table:zconParams}. |
2146 |
|
2147 |
\begin{table} |
2148 |
\caption{The Global Keywords: Z-Constraint Parameters} |
2149 |
\label{table:zconParams} |
2150 |
\begin{center} |
2151 |
% Note when adding or removing columns, the \hsize numbers must add up to the total number |
2152 |
% of columns. |
2153 |
\begin{tabularx}{\linewidth}% |
2154 |
{>{\setlength{\hsize}{1.00\hsize}}X% |
2155 |
>{\setlength{\hsize}{0.4\hsize}}X% |
2156 |
>{\setlength{\hsize}{1.2\hsize}}X% |
2157 |
>{\setlength{\hsize}{1.4\hsize}}X} |
2158 |
|
2159 |
{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline |
2160 |
|
2161 |
{\tt nZconstraints} & integer & The number of zconstraint molecules& If using zconstraint method, {\tt nZconstraints} must be set \\ |
2162 |
{\tt zconsTime} & fs & Sets the frequency at which the {\tt .fz} file is written & \\ |
2163 |
{\tt zconsForcePolicy} & string & The strategy of subtracting |
2164 |
zconstraint force from the unconstrained molecules & Possible |
2165 |
strategies are {\tt BYMASS} and {\tt BYNUMBER}. Default |
2166 |
strategy is set to {\tt BYMASS}\\ |
2167 |
{\tt zconsGap} & $\mbox{\AA}$ & Set the distance between two adjacent |
2168 |
constraint positions& Used mainly in moving molecules through a simulation \\ |
2169 |
{\tt zconsFixtime} & fs & Sets how long the zconstraint molecule is |
2170 |
fixed & {\tt zconsFixtime} must be set if {\tt zconsGap} is set\\ |
2171 |
{\tt zconsUsingSMD} &logical & Flag for using Steered Molecular |
2172 |
Dynamics or Harmonic Forces to move the molecule & Harmonic Forces are |
2173 |
used by default\\ |
2174 |
|
2175 |
\end{tabularx} |
2176 |
\end{center} |
2177 |
\end{table} |
2178 |
|
2179 |
|
2180 |
\section{\label{oopseSec:minimizer}Energy Minimization} |
2181 |
|
2182 |
As one of the basic procedures of molecular modeling, energy |
2183 |
minimization is used to identify local configurations that are stable |
2184 |
points on the potential energy surface. There is a vast literature on |
2185 |
energy minimization algorithms have been developed to search for the |
2186 |
global energy minimum as well as to find local structures which are |
2187 |
stable fixed points on the surface. We have included two simple |
2188 |
minimization algorithms: steepest descent, ({\sc sd}) and conjugate |
2189 |
gradient ({\sc cg}) to help users find reasonable local minima from |
2190 |
their initial configurations. |
2191 |
|
2192 |
Since {\sc oopse} handles atoms and rigid bodies which have |
2193 |
orientational coordinates as well as translational coordinates, there |
2194 |
is some subtlety to the choice of parameters for minimization |
2195 |
algorithms. |
2196 |
|
2197 |
Given a coordinate set $x_{k}$ and a search direction $d_{k}$, a line |
2198 |
search algorithm is performed along $d_{k}$ to produce |
2199 |
$x_{k+1}=x_{k}+$ $\lambda _{k}d_{k}$. |
2200 |
|
2201 |
In the steepest descent ({\sc sd}) algorithm,% |
2202 |
\begin{equation} |
2203 |
d_{k}=-\nabla V(x_{k}) |
2204 |
\end{equation} |
2205 |
The gradient and the direction of next step are always orthogonal. |
2206 |
This may cause oscillatory behavior in narrow valleys. To overcome |
2207 |
this problem, the Fletcher-Reeves variant~\cite{FletcherReeves} of the |
2208 |
conjugate gradient ({\sc cg}) algorithm is used to generate $d_{k+1}$ |
2209 |
via simple recursion: |
2210 |
\begin{align} |
2211 |
d_{k+1} & =-\nabla V(x_{k+1})+\gamma_{k}d_{k}\\ |
2212 |
\gamma_{k} & =\frac{\nabla V(x_{k+1})^{T}\nabla V(x_{k+1})}{\nabla |
2213 |
V(x_{k})^{T}\nabla V(x_{k})}% |
2214 |
\end{align} |
2215 |
|
2216 |
The Polak-Ribiere variant~\cite{PolakRibiere} of the conjugate |
2217 |
gradient ($\gamma_{k}$) is defined as% |
2218 |
\begin{equation} |
2219 |
\gamma_{k}=\frac{[\nabla V(x_{k+1})-\nabla V(x)]^{T}\nabla V(x_{k+1})}{\nabla |
2220 |
V(x_{k})^{T}\nabla V(x_{k})}% |
2221 |
\end{equation} |
2222 |
|
2223 |
The conjugate gradient method assumes that the conformation is close |
2224 |
enough to a local minimum that the potential energy surface is very |
2225 |
nearly quadratic. When the initial structure is far from the minimum, |
2226 |
the steepest descent method can be superior to the conjugate gradient |
2227 |
method. Hence, the steepest descent method is often used for the first |
2228 |
10-100 steps of minimization. Another useful feature of minimization |
2229 |
methods in {\sc oopse} is that a modified {\sc shake} algorithm can be |
2230 |
applied during the minimization to constraint the bond lengths if this |
2231 |
is required by the force field. Meta-data parameters concerning the |
2232 |
minimizer are given in Table~\ref{table:minimizeParams} |
2233 |
|
2234 |
\begin{table} |
2235 |
\caption{The Global Keywords: Energy Minimizer Parameters} |
2236 |
\label{table:minimizeParams} |
2237 |
\begin{center} |
2238 |
% Note when adding or removing columns, the \hsize numbers must add up to the total number |
2239 |
% of columns. |
2240 |
\begin{tabularx}{\linewidth}% |
2241 |
{>{\setlength{\hsize}{1.2\hsize}}X% |
2242 |
>{\setlength{\hsize}{0.6\hsize}}X% |
2243 |
>{\setlength{\hsize}{1.1\hsize}}X% |
2244 |
>{\setlength{\hsize}{1.1\hsize}}X} |
2245 |
|
2246 |
{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline |
2247 |
|
2248 |
{\tt minimizer} & string & selects the minimization method to be used |
2249 |
& either {\tt CG} (conjugate gradient) or {\tt SD} (steepest |
2250 |
descent) \\ |
2251 |
{\tt minimizerMaxIter} & steps & Sets the maximum iteration number in the energy minimization & Default value is 200\\ |
2252 |
{\tt minimizerWriteFreq} & steps & Sets the frequency at which the {\tt .dump} and {\tt .stat} files are writtern during energy minimization & \\ |
2253 |
{\tt minimizerStepSize} & $\mbox{\AA}$ & Set the step size of line search & Default value is 0.01\\ |
2254 |
{\tt minimizerFTol} & $\mbox{kcal mol}^{-1}$ & Sets energy tolerance & Default value is $10^{-8}$\\ |
2255 |
{\tt minimizerGTol} & $\mbox{kcal mol}^{-1}\mbox{\AA}^{-1}$ & Sets gradient tolerance & Default value is $10^{-8}$\\ |
2256 |
{\tt minimizerLSTol} & $\mbox{kcal mol}^{-1}$ & Sets line search tolerance & Default value is $10^{-8}$\\ |
2257 |
{\tt minimizerLSMaxIter} & steps & Sets the maximum iteration of line searching & Default value is 50\\ |
2258 |
|
2259 |
\end{tabularx} |
2260 |
\end{center} |
2261 |
\end{table} |
2262 |
|
2263 |
\section{\label{oopseSec:parallelization} Parallel Simulation Implementation} |
2264 |
|
2265 |
Although processor power is continually improving, it is still |
2266 |
unreasonable to simulate systems of more then a 1000 atoms on a single |
2267 |
processor. To facilitate study of larger system sizes or smaller |
2268 |
systems for longer time scales, parallel methods were developed to |
2269 |
allow multiple CPU's to share the simulation workload. Three general |
2270 |
categories of parallel decomposition methods have been developed: |
2271 |
these are the atomic,\cite{Fox88} spatial~\cite{plimpton95} and |
2272 |
force~\cite{Paradyn} decomposition methods. |
2273 |
|
2274 |
Algorithmically simplest of the three methods is atomic decomposition, |
2275 |
where $N$ particles in a simulation are split among $P$ processors for |
2276 |
the duration of the simulation. Computational cost scales as an |
2277 |
optimal $\mathcal{O}(N/P)$ for atomic decomposition. Unfortunately all |
2278 |
processors must communicate positions and forces with all other |
2279 |
processors at every force evaluation, leading the communication costs |
2280 |
to scale as an unfavorable $\mathcal{O}(N)$, \emph{independent of the |
2281 |
number of processors}. This communication bottleneck led to the |
2282 |
development of spatial and force decomposition methods, in which |
2283 |
communication among processors scales much more favorably. Spatial or |
2284 |
domain decomposition divides the physical spatial domain into 3D boxes |
2285 |
in which each processor is responsible for calculation of forces and |
2286 |
positions of particles located in its box. Particles are reassigned to |
2287 |
different processors as they move through simulation space. To |
2288 |
calculate forces on a given particle, a processor must simply know the |
2289 |
positions of particles within some cutoff radius located on nearby |
2290 |
processors rather than the positions of particles on all |
2291 |
processors. Both communication between processors and computation |
2292 |
scale as $\mathcal{O}(N/P)$ in the spatial method. However, spatial |
2293 |
decomposition adds algorithmic complexity to the simulation code and |
2294 |
is not very efficient for small $N$, since the overall communication |
2295 |
scales as the surface to volume ratio $\mathcal{O}(N/P)^{2/3}$ in |
2296 |
three dimensions. |
2297 |
|
2298 |
The parallelization method used in {\sc oopse} is the force |
2299 |
decomposition method. Force decomposition assigns particles to |
2300 |
processors based on a block decomposition of the force |
2301 |
matrix. Processors are split into an optimally square grid forming row |
2302 |
and column processor groups. Forces are calculated on particles in a |
2303 |
given row by particles located in that processor's column |
2304 |
assignment. Force decomposition is less complex to implement than the |
2305 |
spatial method but still scales computationally as $\mathcal{O}(N/P)$ |
2306 |
and scales as $\mathcal{O}(N/\sqrt{P})$ in communication |
2307 |
cost. Plimpton has also found that force decompositions scale more |
2308 |
favorably than spatial decompositions for systems up to 10,000 atoms |
2309 |
and favorably compete with spatial methods up to 100,000 |
2310 |
atoms.\cite{plimpton95} |
2311 |
|
2312 |
\section{\label{oopseSec:conclusion}Conclusion} |
2313 |
|
2314 |
We have presented a new open source parallel simulation program {\sc |
2315 |
oopse}. This program offers some novel capabilities, but mostly makes |
2316 |
available a library of modern object-oriented code for the scientific |
2317 |
community to use freely. Notably, {\sc oopse} can handle symplectic |
2318 |
integration of objects (atoms and rigid bodies) which have |
2319 |
orientational degrees of freedom. It can also work with transition |
2320 |
metal force fields and point-dipoles. It is capable of scaling across |
2321 |
multiple processors through the use of force based decomposition. It |
2322 |
also implements several advanced integrators allowing the end user |
2323 |
control over temperature and pressure. In addition, it is capable of |
2324 |
integrating constrained dynamics through both the {\sc rattle} |
2325 |
algorithm and the $z$-constraint method. |
2326 |
|
2327 |
We encourage other researchers to download and apply this program to |
2328 |
their own research problems. By making the code available, we hope to |
2329 |
encourage other researchers to contribute their own code and make it a |
2330 |
more powerful package for everyone in the molecular dynamics community |
2331 |
to use. All source code for {\sc oopse} is available for download at |
2332 |
{\tt http://oopse.org}. |
2333 |
|
2334 |
\newpage |
2335 |
\section{Acknowledgments} |
2336 |
|
2337 |
Development of {\sc oopse} was funded by a New Faculty Award from the |
2338 |
Camille and Henry Dreyfus Foundation and by the National Science |
2339 |
Foundation under grant CHE-0134881. Computation time was provided by |
2340 |
the Notre Dame Bunch-of-Boxes (B.o.B) computer cluster under NSF grant |
2341 |
DMR-0079647. |
2342 |
|
2343 |
\bibliographystyle{achemso} |
2344 |
\bibliography{oopsePaper} |
2345 |
|
2346 |
\end{document} |