ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mattDisertation/oopse.tex
Revision: 1051
Committed: Fri Feb 13 21:24:07 2004 UTC (20 years, 6 months ago) by mmeineke
Content type: application/x-tex
File size: 51028 byte(s)
Log Message:
added an introduction to oopse, and started smoothing out the wrinkles.

File Contents

# User Rev Content
1 mmeineke 1045 \chapter{\label{chapt:oopse}OOPSE: AN OPEN SOURCE OBJECT-ORIENTED PARALLEL SIMULATION ENGINE FOR MOLECULAR DYNAMICS}
2 mmeineke 1044
3    
4    
5 mmeineke 1045 %% \begin{abstract}
6     %% We detail the capabilities of a new open-source parallel simulation
7     %% package ({\sc oopse}) that can perform molecular dynamics simulations
8     %% on atom types that are missing from other popular packages. In
9     %% particular, {\sc oopse} is capable of performing orientational
10     %% dynamics on dipolar systems, and it can handle simulations of metallic
11     %% systems using the embedded atom method ({\sc eam}).
12     %% \end{abstract}
13 mmeineke 1044
14 mmeineke 1045 \lstset{language=C,frame=TB,basicstyle=\small,basicstyle=\ttfamily, %
15     xleftmargin=0.5in, xrightmargin=0.5in,captionpos=b, %
16     abovecaptionskip=0.5cm, belowcaptionskip=0.5cm}
17 mmeineke 1044
18 mmeineke 1051 \section{\label{oopseSec:foreword}Foreword}
19 mmeineke 1044
20 mmeineke 1051 In this chapter, I present and detail the capabilities of the open
21     source simulation package {\sc oopse}. It is important to note, that a
22     simulation package of this size and scope would not have been possible
23     without the collaborative efforts of my colleagues: Charles
24     F.~Vardeman II, Teng Lin, Christopher J.~Fennell and J.~Daniel
25     Gezelter. Although my contributions to [\sc oopse} are signifigant,
26     consideration of my work apart from the others, would not give a
27     complete description to the package's capabilities. As such, all
28     contributions to {\sc oopse} to date are presented in this chapter.
29 mmeineke 1044
30 mmeineke 1051 {\sc give final breakdown of who wrote which section here.}
31 mmeineke 1044
32 mmeineke 1051 \section{\label{sec:intro}Introduction}
33 mmeineke 1044
34 mmeineke 1051 When choosing to simulate a chemical system with molecular dynamics,
35     there are a variety of options available. For simple systems, one
36     might consider writing one's own programming code. However, as systems
37     grow larger and more complex, building and maintaining code for the
38     simulations becomes a time consuming task. In such cases it is usually
39     more convienent for a researcher to turn to pre-existing simulation
40     packages. These packages, such as {\sc amber}\cite{pearlman:1995} and
41     {\sc charmm}\cite{Brooks83}, provide powerful tools for researchers to
42     conduct simulations of their systems without spending their time
43     developing a code base to conduct their research. This then frees them
44     to perhaps explore experimental analouges to their models.
45 mmeineke 1044
46 mmeineke 1051 Despite their utility, problems with these packages arise when
47     researchers try to develop techniques or energetic models that the
48     code was not originally designed to do. Examples of uncommonly
49     implemented techniques and energetics include; dipole-dipole
50     interactions, rigid body dynamics, and metallic emmbedded
51     potentials. When faced with these obstacles, a researcher must either
52     develop their own code or license and extend one of the commercial
53     packages. What we have elected to do, is develop a package of
54     simulation code capable of implementing the types of models upon which
55     our research is based.
56 mmeineke 1044
57 mmeineke 1051 Having written {\sc oopse} we are implementing the concept of Open
58     Source dcevelopment, and releaseing our source code into the public
59     domain. It is our intent that by doing so, other researchers might
60     benefit from our work, and add their own contributions to the
61     package. The license under which {\sc oopse} is distributed allows any
62     researcher to download and modify the source code for their own
63     use. In this way further development of {\sc oopse} is not limited to
64     only the models of interest to ourselves, but also those of the
65     community of scientists who contribute back to the project.
66 mmeineke 1044
67 mmeineke 1051 We have structured this chapter to first discuss the emperical energy
68     functions that {\sc oopse } implements in
69     Sec.~\ref{oopseSec:empericalEnergy}. Following that is a discusion of
70     the various input and output files associated with the package
71     (Sec.~\ref{oopseSec:IOfiles}). In Sec.~\ref{oopseSec:Mechanics}
72     elucidates the various Molecular Dynamics algorithms {\sc oopse}
73     mplements in the integration of the Newtonian equations of
74     motion. Basic analysis of the trajectories obtained from the
75     simulation is discussed in Sec.~\ref{oopseSec:props}. Program design
76     considerations as well as the software distribution license is
77     presented in Sec.~\ref{oopseSec:design}. And lastly,
78     Sec.~\ref{oopseSec:conclusion} concludes the chapter.
79 mmeineke 1044
80 mmeineke 1051 \section{\label{oopseSec:empiricalEnergy}The Empirical Energy Functions}
81    
82     \subsection{\label{oopseSec:atomsMolecules}Atoms, Molecules and Rigid Bodies}
83    
84 mmeineke 1044 The basic unit of an {\sc oopse} simulation is the atom. The
85     parameters describing the atom are generalized to make the atom as
86     flexible a representation as possible. They may represent specific
87     atoms of an element, or be used for collections of atoms such as
88     methyl and carbonyl groups. The atoms are also capable of having
89     directional components associated with them (\emph{e.g.}~permanent
90     dipoles). Charges on atoms are not currently supported by {\sc oopse}.
91    
92 mmeineke 1045 \begin{lstlisting}[float,caption={[Specifier for molecules and atoms] A sample specification of the simple Ar molecule},label=sch:AtmMole]
93 mmeineke 1044 molecule{
94     name = "Ar";
95     nAtoms = 1;
96     atom[0]{
97     type="Ar";
98     position( 0.0, 0.0, 0.0 );
99     }
100     }
101     \end{lstlisting}
102    
103 mmeineke 1045
104 mmeineke 1044 Atoms can be collected into secondary srtructures such as rigid bodies
105     or molecules. The molecule is a way for {\sc oopse} to keep track of
106     the atoms in a simulation in logical manner. Molecular units store the
107     identities of all the atoms associated with themselves, and are
108     responsible for the evaluation of their own internal interactions
109     (\emph{i.e.}~bonds, bends, and torsions). Scheme \ref{sch:AtmMole}
110     shws how one creates a molecule in the \texttt{.mdl} files. The
111     position of the atoms given in the declaration are relative to the
112     origin of the molecule, and is used when creating a system containing
113     the molecule.
114    
115     As stated previously, one of the features that sets {\sc oopse} apart
116     from most of the current molecular simulation packages is the ability
117     to handle rigid body dynamics. Rigid bodies are non-spherical
118     particles or collections of particles that have a constant internal
119     potential and move collectively.\cite{Goldstein01} They are not
120     included in most simulation packages because of the requirement to
121     propagate the orientational degrees of freedom. Until recently,
122     integrators which propagate orientational motion have been lacking.
123    
124     Moving a rigid body involves determination of both the force and
125     torque applied by the surroundings, which directly affect the
126     translational and rotational motion in turn. In order to accumulate
127     the total force on a rigid body, the external forces and torques must
128     first be calculated for all the internal particles. The total force on
129     the rigid body is simply the sum of these external forces.
130     Accumulation of the total torque on the rigid body is more complex
131     than the force in that it is the torque applied on the center of mass
132     that dictates rotational motion. The torque on rigid body {\it i} is
133     \begin{equation}
134     \boldsymbol{\tau}_i=
135     \sum_{a}(\mathbf{r}_{ia}-\mathbf{r}_i)\times \mathbf{f}_{ia}
136     + \boldsymbol{\tau}_{ia},
137     \label{eq:torqueAccumulate}
138     \end{equation}
139     where $\boldsymbol{\tau}_i$ and $\mathbf{r}_i$ are the torque on and
140     position of the center of mass respectively, while $\mathbf{f}_{ia}$,
141     $\mathbf{r}_{ia}$, and $\boldsymbol{\tau}_{ia}$ are the force on,
142     position of, and torque on the component particles of the rigid body.
143    
144     The summation of the total torque is done in the body fixed axis of
145     the rigid body. In order to move between the space fixed and body
146     fixed coordinate axes, parameters describing the orientation must be
147     maintained for each rigid body. At a minimum, the rotation matrix
148     (\textbf{A}) can be described by the three Euler angles ($\phi,
149     \theta,$ and $\psi$), where the elements of \textbf{A} are composed of
150     trigonometric operations involving $\phi, \theta,$ and
151     $\psi$.\cite{Goldstein01} In order to avoid numerical instabilities
152     inherent in using the Euler angles, the four parameter ``quaternion''
153     scheme is often used. The elements of \textbf{A} can be expressed as
154     arithmetic operations involving the four quaternions ($q_0, q_1, q_2,$
155     and $q_3$).\cite{allen87:csl} Use of quaternions also leads to
156     performance enhancements, particularly for very small
157     systems.\cite{Evans77}
158    
159     {\sc oopse} utilizes a relatively new scheme that propagates the
160     entire nine parameter rotation matrix internally. Further discussion
161     on this choice can be found in Sec.~\ref{sec:integrate}. An example
162     definition of a riged body can be seen in Scheme
163     \ref{sch:rigidBody}. The positions in the atom definitions are the
164     placements of the atoms relative to the origin of the rigid body,
165     which itself has a position relative to the origin of the molecule.
166    
167 mmeineke 1045 \begin{lstlisting}[float,caption={[Defining rigid bodies]A sample definition of a rigid body},label={sch:rigidBody}]
168 mmeineke 1044 molecule{
169     name = "TIP3P_water";
170     nRigidBodies = 1;
171     rigidBody[0]{
172     nAtoms = 3;
173     atom[0]{
174     type = "O_TIP3P";
175     position( 0.0, 0.0, -0.06556 );
176     }
177     atom[1]{
178     type = "H_TIP3P";
179     position( 0.0, 0.75695, 0.52032 );
180     }
181     atom[2]{
182     type = "H_TIP3P";
183     position( 0.0, -0.75695, 0.52032 );
184     }
185     position( 0.0, 0.0, 0.0 );
186     orientation( 0.0, 0.0, 1.0 );
187     }
188     }
189     \end{lstlisting}
190    
191     \subsection{\label{sec:LJPot}The Lennard Jones Potential}
192    
193     The most basic force field implemented in {\sc oopse} is the
194     Lennard-Jones potential, which mimics the van der Waals interaction at
195     long distances, and uses an empirical repulsion at short
196     distances. The Lennard-Jones potential is given by:
197     \begin{equation}
198     V_{\text{LJ}}(r_{ij}) =
199     4\epsilon_{ij} \biggl[
200     \biggl(\frac{\sigma_{ij}}{r_{ij}}\biggr)^{12}
201     - \biggl(\frac{\sigma_{ij}}{r_{ij}}\biggr)^{6}
202     \biggr]
203     \label{eq:lennardJonesPot}
204     \end{equation}
205     Where $r_{ij}$ is the distance between particles $i$ and $j$,
206     $\sigma_{ij}$ scales the length of the interaction, and
207     $\epsilon_{ij}$ scales the well depth of the potential. Scheme
208     \ref{sch:LJFF} gives and example partial \texttt{.bass} file that
209     shows a system of 108 Ar particles simulated with the Lennard-Jones
210     force field.
211    
212 mmeineke 1045 \begin{lstlisting}[float,caption={[Invocation of the Lennard-Jones force field] A sample system using the Lennard-Jones force field.},label={sch:LJFF}]
213 mmeineke 1044
214     /*
215     * The Ar molecule is specified
216     * external to the.bass file
217     */
218    
219     #include "argon.mdl"
220    
221     nComponents = 1;
222     component{
223     type = "Ar";
224     nMol = 108;
225     }
226    
227     /*
228     * The initial configuration is generated
229     * before the simulation is invoked.
230     */
231    
232     initialConfig = "./argon.init";
233    
234     forceField = "LJ";
235     \end{lstlisting}
236    
237     Because this potential is calculated between all pairs, the force
238     evaluation can become computationally expensive for large systems. To
239     keep the pair evaluations to a manageable number, {\sc oopse} employs
240     a cut-off radius.\cite{allen87:csl} The cutoff radius is set to be
241     $2.5\sigma_{ii}$, where $\sigma_{ii}$ is the largest Lennard-Jones
242     length parameter present in the simulation. Truncating the calculation
243     at $r_{\text{cut}}$ introduces a discontinuity into the potential
244     energy. To offset this discontinuity, the energy value at
245     $r_{\text{cut}}$ is subtracted from the potential. This causes the
246     potential to go to zero smoothly at the cut-off radius.
247    
248     Interactions between dissimilar particles requires the generation of
249     cross term parameters for $\sigma$ and $\epsilon$. These are
250     calculated through the Lorentz-Berthelot mixing
251     rules:\cite{allen87:csl}
252     \begin{equation}
253     \sigma_{ij} = \frac{1}{2}[\sigma_{ii} + \sigma_{jj}]
254     \label{eq:sigmaMix}
255     \end{equation}
256     and
257     \begin{equation}
258     \epsilon_{ij} = \sqrt{\epsilon_{ii} \epsilon_{jj}}
259     \label{eq:epsilonMix}
260     \end{equation}
261    
262    
263    
264 mmeineke 1051 \subsection{\label{oopseSec:DUFF}Dipolar Unified-Atom Force Field}
265 mmeineke 1044
266     The dipolar unified-atom force field ({\sc duff}) was developed to
267     simulate lipid bilayers. The simulations require a model capable of
268     forming bilayers, while still being sufficiently computationally
269     efficient to allow large systems ($\approx$100's of phospholipids,
270     $\approx$1000's of waters) to be simulated for long times
271     ($\approx$10's of nanoseconds).
272    
273     With this goal in mind, {\sc duff} has no point
274     charges. Charge-neutral distributions were replaced with dipoles,
275     while most atoms and groups of atoms were reduced to Lennard-Jones
276     interaction sites. This simplification cuts the length scale of long
277     range interactions from $\frac{1}{r}$ to $\frac{1}{r^3}$, allowing us
278     to avoid the computationally expensive Ewald sum. Instead, we can use
279     neighbor-lists, reaction field, and cutoff radii for the dipolar
280     interactions.
281    
282     As an example, lipid head-groups in {\sc duff} are represented as
283     point dipole interaction sites. By placing a dipole of 20.6~Debye at
284     the head group center of mass, our model mimics the head group of
285     phosphatidylcholine.\cite{Cevc87} Additionally, a large Lennard-Jones
286     site is located at the pseudoatom's center of mass. The model is
287     illustrated by the dark grey atom in Fig.~\ref{fig:lipidModel}. The
288     water model we use to complement the dipoles of the lipids is our
289     reparameterization of the soft sticky dipole (SSD) model of Ichiye
290     \emph{et al.}\cite{liu96:new_model}
291    
292     \begin{figure}
293 mmeineke 1045 \centering
294     \includegraphics[width=\linewidth]{lipidModel.eps}
295 mmeineke 1044 \caption{A representation of the lipid model. $\phi$ is the torsion angle, $\theta$ %
296     is the bend angle, $\mu$ is the dipole moment of the head group, and n
297     is the chain length.}
298 mmeineke 1045 \label{oopseFig:lipidModel}
299 mmeineke 1044 \end{figure}
300    
301     We have used a set of scalable parameters to model the alkyl groups
302     with Lennard-Jones sites. For this, we have borrowed parameters from
303     the TraPPE force field of Siepmann
304     \emph{et al}.\cite{Siepmann1998} TraPPE is a unified-atom
305     representation of n-alkanes, which is parametrized against phase
306     equilibria using Gibbs ensemble Monte Carlo simulation
307     techniques.\cite{Siepmann1998} One of the advantages of TraPPE is that
308     it generalizes the types of atoms in an alkyl chain to keep the number
309     of pseudoatoms to a minimum; the parameters for an atom such as
310     $\text{CH}_2$ do not change depending on what species are bonded to
311     it.
312    
313     TraPPE also constrains all bonds to be of fixed length. Typically,
314     bond vibrations are the fastest motions in a molecular dynamic
315     simulation. Small time steps between force evaluations must be used to
316     ensure adequate sampling of the bond potential to ensure conservation
317     of energy. By constraining the bond lengths, larger time steps may be
318     used when integrating the equations of motion. A simulation using {\sc
319     duff} is illustrated in Scheme \ref{sch:DUFF}.
320    
321 mmeineke 1045 \begin{lstlisting}[float,caption={[Invocation of {\sc duff}]Sample \texttt{.bass} file showing a simulation utilizing {\sc duff}},label={sch:DUFF}]
322 mmeineke 1044
323     #include "water.mdl"
324     #include "lipid.mdl"
325    
326     nComponents = 2;
327     component{
328     type = "simpleLipid_16";
329     nMol = 60;
330     }
331    
332     component{
333     type = "SSD_water";
334     nMol = 1936;
335     }
336    
337     initialConfig = "bilayer.init";
338    
339     forceField = "DUFF";
340    
341     \end{lstlisting}
342    
343 mmeineke 1051 \subsection{\label{oopseSec:energyFunctions}{\sc duff} Energy Functions}
344 mmeineke 1044
345     The total potential energy function in {\sc duff} is
346     \begin{equation}
347     V = \sum^{N}_{I=1} V^{I}_{\text{Internal}}
348     + \sum^{N}_{I=1} \sum_{J>I} V^{IJ}_{\text{Cross}}
349     \label{eq:totalPotential}
350     \end{equation}
351     Where $V^{I}_{\text{Internal}}$ is the internal potential of molecule $I$:
352     \begin{equation}
353     V^{I}_{\text{Internal}} =
354     \sum_{\theta_{ijk} \in I} V_{\text{bend}}(\theta_{ijk})
355     + \sum_{\phi_{ijkl} \in I} V_{\text{torsion}}(\phi_{ijkl})
356     + \sum_{i \in I} \sum_{(j>i+4) \in I}
357     \biggl[ V_{\text{LJ}}(r_{ij}) + V_{\text{dipole}}
358     (\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j})
359     \biggr]
360     \label{eq:internalPotential}
361     \end{equation}
362     Here $V_{\text{bend}}$ is the bend potential for all 1, 3 bonded pairs
363     within the molecule $I$, and $V_{\text{torsion}}$ is the torsion potential
364     for all 1, 4 bonded pairs. The pairwise portions of the internal
365     potential are excluded for pairs that are closer than three bonds,
366     i.e.~atom pairs farther away than a torsion are included in the
367     pair-wise loop.
368    
369    
370     The bend potential of a molecule is represented by the following function:
371     \begin{equation}
372     V_{\text{bend}}(\theta_{ijk}) = k_{\theta}( \theta_{ijk} - \theta_0 )^2 \label{eq:bendPot}
373     \end{equation}
374     Where $\theta_{ijk}$ is the angle defined by atoms $i$, $j$, and $k$
375     (see Fig.~\ref{fig:lipidModel}), $\theta_0$ is the equilibrium
376     bond angle, and $k_{\theta}$ is the force constant which determines the
377     strength of the harmonic bend. The parameters for $k_{\theta}$ and
378     $\theta_0$ are borrowed from those in TraPPE.\cite{Siepmann1998}
379    
380     The torsion potential and parameters are also borrowed from TraPPE. It is
381     of the form:
382     \begin{equation}
383     V_{\text{torsion}}(\phi) = c_1[1 + \cos \phi]
384     + c_2[1 + \cos(2\phi)]
385     + c_3[1 + \cos(3\phi)]
386     \label{eq:origTorsionPot}
387     \end{equation}
388     Here $\phi$ is the angle defined by four bonded neighbors $i$,
389     $j$, $k$, and $l$ (again, see Fig.~\ref{fig:lipidModel}). For
390     computational efficiency, the torsion potential has been recast after
391     the method of CHARMM,\cite{charmm1983} in which the angle series is
392     converted to a power series of the form:
393     \begin{equation}
394     V_{\text{torsion}}(\phi) =
395     k_3 \cos^3 \phi + k_2 \cos^2 \phi + k_1 \cos \phi + k_0
396     \label{eq:torsionPot}
397     \end{equation}
398     Where:
399     \begin{align*}
400     k_0 &= c_1 + c_3 \\
401     k_1 &= c_1 - 3c_3 \\
402     k_2 &= 2 c_2 \\
403     k_3 &= 4c_3
404     \end{align*}
405     By recasting the potential as a power series, repeated trigonometric
406     evaluations are avoided during the calculation of the potential energy.
407    
408    
409     The cross potential between molecules $I$ and $J$, $V^{IJ}_{\text{Cross}}$, is
410     as follows:
411     \begin{equation}
412     V^{IJ}_{\text{Cross}} =
413     \sum_{i \in I} \sum_{j \in J}
414     \biggl[ V_{\text{LJ}}(r_{ij}) + V_{\text{dipole}}
415     (\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j})
416     + V_{\text{sticky}}
417     (\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},\boldsymbol{\Omega}_{j})
418     \biggr]
419     \label{eq:crossPotentail}
420     \end{equation}
421     Where $V_{\text{LJ}}$ is the Lennard Jones potential,
422     $V_{\text{dipole}}$ is the dipole dipole potential, and
423     $V_{\text{sticky}}$ is the sticky potential defined by the SSD model
424     (Sec.~\ref{sec:SSD}). Note that not all atom types include all
425     interactions.
426    
427     The dipole-dipole potential has the following form:
428     \begin{equation}
429     V_{\text{dipole}}(\mathbf{r}_{ij},\boldsymbol{\Omega}_{i},
430     \boldsymbol{\Omega}_{j}) = \frac{|\mu_i||\mu_j|}{4\pi\epsilon_{0}r_{ij}^{3}} \biggl[
431     \boldsymbol{\hat{u}}_{i} \cdot \boldsymbol{\hat{u}}_{j}
432     -
433     \frac{3(\boldsymbol{\hat{u}}_i \cdot \mathbf{r}_{ij}) %
434     (\boldsymbol{\hat{u}}_j \cdot \mathbf{r}_{ij}) }
435     {r^{2}_{ij}} \biggr]
436     \label{eq:dipolePot}
437     \end{equation}
438     Here $\mathbf{r}_{ij}$ is the vector starting at atom $i$ pointing
439     towards $j$, and $\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$
440     are the orientational degrees of freedom for atoms $i$ and $j$
441     respectively. $|\mu_i|$ is the magnitude of the dipole moment of atom
442     $i$, $\boldsymbol{\hat{u}}_i$ is the standard unit orientation
443     vector of $\boldsymbol{\Omega}_i$, and $\boldsymbol{\hat{r}}_{ij}$ is
444     the unit vector pointing along $\mathbf{r}_{ij}$.
445    
446    
447     \subsubsection{\label{sec:SSD}The {\sc duff} Water Models: SSD/E and SSD/RF}
448    
449     In the interest of computational efficiency, the default solvent used
450     by {\sc oopse} is the extended Soft Sticky Dipole (SSD/E) water
451     model.\cite{Gezelter04} The original SSD was developed by Ichiye
452     \emph{et al.}\cite{liu96:new_model} as a modified form of the hard-sphere
453     water model proposed by Bratko, Blum, and
454     Luzar.\cite{Bratko85,Bratko95} It consists of a single point dipole
455     with a Lennard-Jones core and a sticky potential that directs the
456     particles to assume the proper hydrogen bond orientation in the first
457     solvation shell. Thus, the interaction between two SSD water molecules
458     \emph{i} and \emph{j} is given by the potential
459     \begin{equation}
460     V_{ij} =
461     V_{ij}^{LJ} (r_{ij})\ + V_{ij}^{dp}
462     (\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)\ +
463     V_{ij}^{sp}
464     (\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j),
465     \label{eq:ssdPot}
466     \end{equation}
467     where the $\mathbf{r}_{ij}$ is the position vector between molecules
468     \emph{i} and \emph{j} with magnitude equal to the distance $r_{ij}$, and
469     $\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$ represent the
470     orientations of the respective molecules. The Lennard-Jones and dipole
471     parts of the potential are given by equations \ref{eq:lennardJonesPot}
472     and \ref{eq:dipolePot} respectively. The sticky part is described by
473     the following,
474     \begin{equation}
475     u_{ij}^{sp}(\mathbf{r}_{ij},\boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)=
476     \frac{\nu_0}{2}[s(r_{ij})w(\mathbf{r}_{ij},
477     \boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j) +
478     s^\prime(r_{ij})w^\prime(\mathbf{r}_{ij},
479     \boldsymbol{\Omega}_i,\boldsymbol{\Omega}_j)]\ ,
480     \label{eq:stickyPot}
481     \end{equation}
482     where $\nu_0$ is a strength parameter for the sticky potential, and
483     $s$ and $s^\prime$ are cubic switching functions which turn off the
484     sticky interaction beyond the first solvation shell. The $w$ function
485     can be thought of as an attractive potential with tetrahedral
486     geometry:
487     \begin{equation}
488     w({\bf r}_{ij},{\bf \Omega}_i,{\bf \Omega}_j)=
489     \sin\theta_{ij}\sin2\theta_{ij}\cos2\phi_{ij},
490     \label{eq:stickyW}
491     \end{equation}
492     while the $w^\prime$ function counters the normal aligned and
493     anti-aligned structures favored by point dipoles:
494     \begin{equation}
495     w^\prime({\bf r}_{ij},{\bf \Omega}_i,{\bf \Omega}_j)=
496     (\cos\theta_{ij}-0.6)^2(\cos\theta_{ij}+0.8)^2-w^0,
497     \label{eq:stickyWprime}
498     \end{equation}
499     It should be noted that $w$ is proportional to the sum of the $Y_3^2$
500     and $Y_3^{-2}$ spherical harmonics (a linear combination which
501     enhances the tetrahedral geometry for hydrogen bonded structures),
502     while $w^\prime$ is a purely empirical function. A more detailed
503     description of the functional parts and variables in this potential
504     can be found in the original SSD
505     articles.\cite{liu96:new_model,liu96:monte_carlo,chandra99:ssd_md,Ichiye03}
506    
507     Since SSD is a single-point {\it dipolar} model, the force
508     calculations are simplified significantly relative to the standard
509     {\it charged} multi-point models. In the original Monte Carlo
510     simulations using this model, Ichiye {\it et al.} reported that using
511     SSD decreased computer time by a factor of 6-7 compared to other
512     models.\cite{liu96:new_model} What is most impressive is that these savings
513     did not come at the expense of accurate depiction of the liquid state
514     properties. Indeed, SSD maintains reasonable agreement with the Soper
515     diffraction data for the structural features of liquid
516     water.\cite{Soper86,liu96:new_model} Additionally, the dynamical properties
517     exhibited by SSD agree with experiment better than those of more
518     computationally expensive models (like TIP3P and
519     SPC/E).\cite{chandra99:ssd_md} The combination of speed and accurate depiction
520     of solvent properties makes SSD a very attractive model for the
521     simulation of large scale biochemical simulations.
522    
523     Recent constant pressure simulations revealed issues in the original
524     SSD model that led to lower than expected densities at all target
525     pressures.\cite{Ichiye03,Gezelter04} The default model in {\sc oopse}
526     is therefore SSD/E, a density corrected derivative of SSD that
527     exhibits improved liquid structure and transport behavior. If the use
528     of a reaction field long-range interaction correction is desired, it
529     is recommended that the parameters be modified to those of the SSD/RF
530     model. Solvent parameters can be easily modified in an accompanying
531     {\sc BASS} file as illustrated in the scheme below. A table of the
532     parameter values and the drawbacks and benefits of the different
533     density corrected SSD models can be found in reference
534     \ref{Gezelter04}.
535    
536 mmeineke 1045 \begin{lstlisting}[float,caption={[A simulation of {\sc ssd} water]An example file showing a simulation including {\sc ssd} water.},label={sch:ssd}]
537 mmeineke 1044
538     #include "water.mdl"
539    
540     nComponents = 1;
541     component{
542     type = "SSD_water";
543     nMol = 864;
544     }
545    
546     initialConfig = "liquidWater.init";
547    
548     forceField = "DUFF";
549    
550     /*
551     * The reactionField flag toggles reaction
552     * field corrections.
553     */
554    
555     reactionField = false; // defaults to false
556     dielectric = 80.0; // dielectric for reaction field
557    
558     /*
559     * The following two flags set the cutoff
560     * radius for the electrostatic forces
561     * as well as the skin thickness of the switching
562     * function.
563     */
564    
565     electrostaticCutoffRadius = 9.2;
566     electrostaticSkinThickness = 1.38;
567    
568     \end{lstlisting}
569    
570    
571 mmeineke 1051 \subsection{\label{oopseSec:eam}Embedded Atom Method}
572 mmeineke 1044
573     Several other molecular dynamics packages\cite{dynamo86} exist which have the
574     capacity to simulate metallic systems, including some that have
575     parallel computational abilities\cite{plimpton93}. Potentials that
576     describe bonding transition metal
577     systems\cite{Finnis84,Ercolessi88,Chen90,Qi99,Ercolessi02} have a
578     attractive interaction which models ``Embedding''
579     a positively charged metal ion in the electron density due to the
580     free valance ``sea'' of electrons created by the surrounding atoms in
581     the system. A mostly repulsive pairwise part of the potential
582     describes the interaction of the positively charged metal core ions
583     with one another. A particular potential description called the
584     Embedded Atom Method\cite{Daw84,FBD86,johnson89,Lu97}({\sc eam}) that has
585     particularly wide adoption has been selected for inclusion in {\sc oopse}. A
586     good review of {\sc eam} and other metallic potential formulations was done
587     by Voter.\cite{voter}
588    
589     The {\sc eam} potential has the form:
590     \begin{eqnarray}
591     V & = & \sum_{i} F_{i}\left[\rho_{i}\right] + \sum_{i} \sum_{j \neq i}
592     \phi_{ij}({\bf r}_{ij}) \\
593     \rho_{i} & = & \sum_{j \neq i} f_{j}({\bf r}_{ij})
594     \end{eqnarray}S
595    
596     where $F_{i} $ is the embedding function that equates the energy required to embed a
597     positively-charged core ion $i$ into a linear superposition of
598     spherically averaged atomic electron densities given by
599     $\rho_{i}$. $\phi_{ij}$ is a primarily repulsive pairwise interaction
600     between atoms $i$ and $j$. In the original formulation of
601     {\sc eam} cite{Daw84}, $\phi_{ij}$ was an entirely repulsive term, however
602     in later refinements to EAM have shown that non-uniqueness between $F$
603     and $\phi$ allow for more general forms for $\phi$.\cite{Daw89}
604     There is a cutoff distance, $r_{cut}$, which limits the
605     summations in the {\sc eam} equation to the few dozen atoms
606     surrounding atom $i$ for both the density $\rho$ and pairwise $\phi$
607     interactions. Foiles et al. fit EAM potentials for fcc metals Cu, Ag, Au, Ni, Pd, Pt and alloys of these metals\cite{FDB86}. These potential fits are in the DYNAMO 86 format and are included with {\sc oopse}.
608    
609    
610 mmeineke 1051 \subsection{\label{oopseSec:pbc}Periodic Boundary Conditions}
611 mmeineke 1044
612     \newcommand{\roundme}{\operatorname{round}}
613    
614     \textit{Periodic boundary conditions} are widely used to simulate truly
615     macroscopic systems with a relatively small number of particles. The
616     simulation box is replicated throughout space to form an infinite lattice.
617     During the simulation, when a particle moves in the primary cell, its image in
618     other boxes move in exactly the same direction with exactly the same
619     orientation.Thus, as a particle leaves the primary cell, one of its images
620     will enter through the opposite face.If the simulation box is large enough to
621     avoid \textquotedblleft feeling\textquotedblright\ the symmetries of the
622     periodic lattice, surface effects can be ignored. Cubic, orthorhombic and
623     parallelepiped are the available periodic cells In OOPSE. We use a matrix to
624     describe the property of the simulation box. Therefore, both the size and
625     shape of the simulation box can be changed during the simulation. The
626     transformation from box space vector $\mathbf{s}$ to its corresponding real
627     space vector $\mathbf{r}$ is defined by
628     \begin{equation}
629     \mathbf{r}=\underline{\mathbf{H}}\cdot\mathbf{s}%
630     \end{equation}
631    
632    
633     where $H=(h_{x},h_{y},h_{z})$ is a transformation matrix made up of the three
634     box axis vectors. $h_{x},h_{y}$ and $h_{z}$ represent the three sides of the
635     simulation box respectively.
636    
637     To find the minimum image of a vector $\mathbf{r}$, we convert the real vector
638     to its corresponding vector in box space first, \bigskip%
639     \begin{equation}
640     \mathbf{s}=\underline{\mathbf{H}}^{-1}\cdot\mathbf{r}%
641     \end{equation}
642     And then, each element of $\mathbf{s}$ is wrapped to lie between -0.5 to 0.5,
643     \begin{equation}
644     s_{i}^{\prime}=s_{i}-\roundme(s_{i})
645     \end{equation}
646     where
647    
648     %
649    
650     \begin{equation}
651     \roundme(x)=\left\{
652     \begin{array}{cc}%
653 mmeineke 1045 \lfloor{x+0.5}\rfloor & \text{if \ }x\geqslant 0 \\
654 mmeineke 1044 \lceil{x-0.5}\rceil & \text{otherwise}%
655     \end{array}
656     \right.
657     \end{equation}
658    
659    
660     For example, $\roundme(3.6)=4$,$\roundme(3.1)=3$, $\roundme(-3.6)=-4$, $\roundme(-3.1)=-3$.
661    
662     Finally, we obtain the minimum image coordinates $\mathbf{r}^{\prime}$ by
663     transforming back to real space,%
664    
665     \begin{equation}
666     \mathbf{r}^{\prime}=\underline{\mathbf{H}}^{-1}\cdot\mathbf{s}^{\prime}%
667     \end{equation}
668    
669    
670 mmeineke 1051 \section{\label{oopseSec:IOfiles}Input and Output Files}
671 mmeineke 1044
672     \subsection{{\sc bass} and Model Files}
673    
674     Every {\sc oopse} simuation begins with a {\sc bass} file. {\sc bass}
675     (\underline{B}izarre \underline{A}tom \underline{S}imulation
676     \underline{S}yntax) is a script syntax that is parsed by {\sc oopse} at
677     runtime. The {\sc bass} file allows for the user to completely describe the
678     system they are to simulate, as well as tailor {\sc oopse}'s behavior during
679     the simulation. {\sc bass} files are denoted with the extension
680     \texttt{.bass}, an example file is shown in
681     Fig.~\ref{fig:bassExample}.
682    
683     \begin{figure}
684     \centering
685     \framebox[\linewidth]{\rule{0cm}{0.75\linewidth}I'm a {\sc bass} file!}
686     \caption{Here is an example \texttt{.bass} file}
687     \label{fig:bassExample}
688     \end{figure}
689    
690     Within the \texttt{.bass} file it is neccassary to provide a complete
691     description of the molecule before it is actually placed in the
692     simulation. The {\sc bass} syntax was originally developed with this goal in
693     mind, and allows for the specification of all the atoms in a molecular
694     prototype, as well as any bonds, bends, or torsions. These
695     descriptions can become lengthy for complex molecules, and it would be
696     inconvient to duplicate the simulation at the begining of each {\sc bass}
697     script. Addressing this issue {\sc bass} allows for the inclusion of model
698     files at the top of a \texttt{.bass} file. These model files, denoted
699     with the \texttt{.mdl} extension, allow the user to describe a
700     molecular prototype once, then simply include it into each simulation
701     containing that molecule.
702    
703 mmeineke 1051 \subsection{\label{oopseSec:coordFiles}Coordinate Files}
704 mmeineke 1044
705     The standard format for storage of a systems coordinates is a modified
706     xyz-file syntax, the exact details of which can be seen in
707     App.~\ref{appCoordFormat}. As all bonding and molecular information is
708     stored in the \texttt{.bass} and \texttt{.mdl} files, the coordinate
709     files are simply the complete set of coordinates for each atom at a
710     given simulation time.
711    
712     There are three major files used by {\sc oopse} written in the coordinate
713     format, they are as follows: the initialization file, the simulation
714     trajectory file, and the final coordinates of the simulation. The
715     initialization file is neccassary for {\sc oopse} to start the simulation
716     with the proper coordinates. It is typically denoted with the
717     extension \texttt{.init}. The trajectory file is created at the
718     beginning of the simulation, and is used to store snapshots of the
719     simulation at regular intervals. The first frame is a duplication of
720     the \texttt{.init} file, and each subsequent frame is appended to the
721     file at an interval specified in the \texttt{.bass} file. The
722     trajectory file is given the extension \texttt{.dump}. The final
723     coordinate file is the end of run or \texttt{.eor} file. The
724     \texttt{.eor} file stores the final configuration of teh system for a
725     given simulation. The file is updated at the same time as the
726     \texttt{.dump} file. However, it only contains the most recent
727     frame. In this way, an \texttt{.eor} file may be used as the
728     initialization file to a second simulation in order to continue or
729     recover the previous simulation.
730    
731     \subsection{Generation of Initial Coordinates}
732    
733     As was stated in Sec.~\ref{subSec:coordFiles}, an initialization file
734     is needed to provide the starting coordinates for a simulation. The
735     {\sc oopse} package provides a program called \texttt{sysBuilder} to aid in
736     the creation of the \texttt{.init} file. \texttt{sysBuilder} is {\sc bass}
737     aware, and will recognize arguments and parameters in the
738     \texttt{.bass} file that would otherwise be ignored by the
739     simulation. The program itself is under contiunual development, and is
740     offered here as a helper tool only.
741    
742     \subsection{The Statistics File}
743    
744     The last output file generated by {\sc oopse} is the statistics file. This
745     file records such statistical quantities as the instantaneous
746     temperature, volume, pressure, etc. It is written out with the
747     frequency specified in the \texttt{.bass} file. The file allows the
748     user to observe the system variables as a function od simulation time
749     while the simulation is in progress. One useful function the
750     statistics file serves is to monitor the conserved quantity of a given
751     simulation ensemble, this allows the user to observe the stability of
752     the integrator. The statistics file is denoted with the \texttt{.stat}
753     file extension.
754    
755 mmeineke 1051 \section{\label{oopseSec:mechanics}Mechanics}
756 mmeineke 1044
757     \subsection{\label{integrate}Integrating the Equations of Motion: the Symplectic Step Integrator}
758    
759     Integration of the equations of motion was carried out using the
760     symplectic splitting method proposed by Dullweber \emph{et
761     al.}.\cite{Dullweber1997} The reason for this integrator selection
762     deals with poor energy conservation of rigid body systems using
763     quaternions. While quaternions work well for orientational motion in
764     alternate ensembles, the microcanonical ensemble has a constant energy
765     requirement that is quite sensitive to errors in the equations of
766     motion. The original implementation of this code utilized quaternions
767     for rotational motion propagation; however, a detailed investigation
768     showed that they resulted in a steady drift in the total energy,
769     something that has been observed by others.\cite{Laird97}
770    
771     The key difference in the integration method proposed by Dullweber
772     \emph{et al.} is that the entire rotation matrix is propagated from
773     one time step to the next. In the past, this would not have been as
774     feasible a option, being that the rotation matrix for a single body is
775     nine elements long as opposed to 3 or 4 elements for Euler angles and
776     quaternions respectively. System memory has become much less of an
777     issue in recent times, and this has resulted in substantial benefits
778     in energy conservation. There is still the issue of 5 or 6 additional
779     elements for describing the orientation of each particle, which will
780     increase dump files substantially. Simply translating the rotation
781     matrix into its component Euler angles or quaternions for storage
782     purposes relieves this burden.
783    
784     The symplectic splitting method allows for Verlet style integration of
785     both linear and angular motion of rigid bodies. In the integration
786     method, the orientational propagation involves a sequence of matrix
787     evaluations to update the rotation matrix.\cite{Dullweber1997} These
788     matrix rotations end up being more costly computationally than the
789     simpler arithmetic quaternion propagation. With the same time step, a
790     1000 SSD particle simulation shows an average 7\% increase in
791     computation time using the symplectic step method in place of
792     quaternions. This cost is more than justified when comparing the
793     energy conservation of the two methods as illustrated in figure
794     \ref{timestep}.
795    
796     \begin{figure}
797 mmeineke 1045 \centering
798     \includegraphics[width=\linewidth]{timeStep.eps}
799 mmeineke 1044 \caption{Energy conservation using quaternion based integration versus
800     the symplectic step method proposed by Dullweber \emph{et al.} with
801     increasing time step. For each time step, the dotted line is total
802     energy using the symplectic step integrator, and the solid line comes
803     from the quaternion integrator. The larger time step plots are shifted
804     up from the true energy baseline for clarity.}
805     \label{timestep}
806     \end{figure}
807    
808     In figure \ref{timestep}, the resulting energy drift at various time
809     steps for both the symplectic step and quaternion integration schemes
810     is compared. All of the 1000 SSD particle simulations started with the
811     same configuration, and the only difference was the method for
812     handling rotational motion. At time steps of 0.1 and 0.5 fs, both
813     methods for propagating particle rotation conserve energy fairly well,
814     with the quaternion method showing a slight energy drift over time in
815     the 0.5 fs time step simulation. At time steps of 1 and 2 fs, the
816     energy conservation benefits of the symplectic step method are clearly
817     demonstrated. Thus, while maintaining the same degree of energy
818     conservation, one can take considerably longer time steps, leading to
819     an overall reduction in computation time.
820    
821     Energy drift in these SSD particle simulations was unnoticeable for
822     time steps up to three femtoseconds. A slight energy drift on the
823     order of 0.012 kcal/mol per nanosecond was observed at a time step of
824     four femtoseconds, and as expected, this drift increases dramatically
825     with increasing time step. To insure accuracy in the constant energy
826     simulations, time steps were set at 2 fs and kept at this value for
827     constant pressure simulations as well.
828    
829    
830     \subsection{\label{sec:extended}Extended Systems for other Ensembles}
831    
832    
833     {\sc oopse} implements a
834    
835    
836     \subsubsection{\label{sec:noseHooverThermo}Nose-Hoover Thermostatting}
837    
838     To mimic the effects of being in a constant temperature ({\sc nvt})
839     ensemble, {\sc oopse} uses the Nose-Hoover extended system
840     approach.\cite{Hoover85} In this method, the equations of motion for
841     the particle positions and velocities are
842     \begin{eqnarray}
843     \dot{{\bf r}} & = & {\bf v} \\
844     \dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v}
845     \label{eq:nosehoovereom}
846     \end{eqnarray}
847    
848     $\chi$ is an ``extra'' variable included in the extended system, and
849     it is propagated using the first order equation of motion
850     \begin{equation}
851     \dot{\chi} = \frac{1}{\tau_{T}} \left( \frac{T}{T_{target}} - 1 \right)
852     \label{eq:nosehooverext}
853     \end{equation}
854     where $T_{target}$ is the target temperature for the simulation, and
855     $\tau_{T}$ is a time constant for the thermostat.
856    
857     To select the Nose-Hoover {\sc nvt} ensemble, the {\tt ensemble = NVT;}
858     command would be used in the simulation's {\sc bass} file. There is
859     some subtlety in choosing values for $\tau_{T}$, and it is usually set
860     to values of a few ps. Within a {\sc bass} file, $\tau_{T}$ could be
861     set to 1 ps using the {\tt tauThermostat = 1000; } command.
862    
863    
864     \subsection{\label{Sec:zcons}Z-Constraint Method}
865    
866     Based on fluctuatin-dissipation theorem,\bigskip\ force auto-correlation
867     method was developed to investigate the dynamics of ions inside the ion
868     channels.\cite{Roux91} Time-dependent friction coefficient can be calculated
869     from the deviation of the instaneous force from its mean force.
870    
871     %
872    
873     \begin{equation}
874     \xi(z,t)=\langle\delta F(z,t)\delta F(z,0)\rangle/k_{B}T
875     \end{equation}
876     where%
877     \begin{equation}
878     \delta F(z,t)=F(z,t)-\langle F(z,t)\rangle
879     \end{equation}
880    
881    
882     If the time-dependent friction decay rapidly, static friction coefficient can
883     be approximated by%
884    
885     \begin{equation}
886     \xi^{static}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt
887     \end{equation}
888    
889    
890     Hence, diffusion constant can be estimated by
891     \begin{equation}
892     D(z)=\frac{k_{B}T}{\xi^{static}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty
893     }\langle\delta F(z,t)\delta F(z,0)\rangle dt}%
894     \end{equation}
895    
896    
897     \bigskip Z-Constraint method, which fixed the z coordinates of the molecules
898     with respect to the center of the mass of the system, was proposed to obtain
899     the forces required in force auto-correlation method.\cite{Marrink94} However,
900     simply resetting the coordinate will move the center of the mass of the whole
901     system. To avoid this problem, a new method was used at {\sc oopse}. Instead of
902     resetting the coordinate, we reset the forces of z-constraint molecules as
903     well as subtract the total constraint forces from the rest of the system after
904     force calculation at each time step.
905     \begin{verbatim}
906     $F_{\alpha i}=0$
907     $V_{\alpha i}=V_{\alpha i}-\frac{\sum\limits_{i}M_{_{\alpha i}}V_{\alpha i}}{\sum\limits_{i}M_{_{\alpha i}}}$
908     $F_{\alpha i}=F_{\alpha i}-\frac{M_{_{\alpha i}}}{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}}\sum\limits_{\beta}F_{\beta}$
909     $V_{\alpha i}=V_{\alpha i}-\frac{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}V_{\alpha i}}{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}}$
910     \end{verbatim}
911    
912     At the very beginning of the simulation, the molecules may not be at its
913     constraint position. To move the z-constraint molecule to the specified
914     position, a simple harmonic potential is used%
915    
916     \begin{equation}
917     U(t)=\frac{1}{2}k_{Harmonic}(z(t)-z_{cons})^{2}%
918     \end{equation}
919     where $k_{Harmonic}$\bigskip\ is the harmonic force constant, $z(t)$ is
920     current z coordinate of the center of mass of the z-constraint molecule, and
921     $z_{cons}$ is the restraint position. Therefore, the harmonic force operated
922     on the z-constraint molecule at time $t$ can be calculated by%
923     \begin{equation}
924     F_{z_{Harmonic}}(t)=-\frac{\partial U(t)}{\partial z(t)}=-k_{Harmonic}%
925     (z(t)-z_{cons})
926     \end{equation}
927     Worthy of mention, other kinds of potential functions can also be used to
928     drive the z-constraint molecule.
929    
930 mmeineke 1051 \section{\label{oopseSec:props}Trajectory Analysis}
931 mmeineke 1044
932 mmeineke 1051 \subsection{\label{oopseSec:staticProps}Static Property Analysis}
933 mmeineke 1044
934     The static properties of the trajectories are analyzed with the
935     program \texttt{staticProps}. The code is capable of calculating the following
936     pair correlations between species A and B:
937     \begin{itemize}
938     \item $g_{\text{AB}}(r)$: Eq.~\ref{eq:gofr}
939     \item $g_{\text{AB}}(r, \cos \theta)$: Eq.~\ref{eq:gofrCosTheta}
940     \item $g_{\text{AB}}(r, \cos \omega)$: Eq.~\ref{eq:gofrCosOmega}
941     \item $g_{\text{AB}}(x, y, z)$: Eq.~\ref{eq:gofrXYZ}
942     \item $\langle \cos \omega \rangle_{\text{AB}}(r)$:
943     Eq.~\ref{eq:cosOmegaOfR}
944     \end{itemize}
945    
946     The first pair correlation, $g_{\text{AB}}(r)$, is defined as follows:
947     \begin{equation}
948     g_{\text{AB}}(r) = \frac{V}{N_{\text{A}}N_{\text{B}}}\langle %%
949     \sum_{i \in \text{A}} \sum_{j \in \text{B}} %%
950     \delta( r - |\mathbf{r}_{ij}|) \rangle \label{eq:gofr}
951     \end{equation}
952     Where $\mathbf{r}_{ij}$ is the vector
953     \begin{equation*}
954     \mathbf{r}_{ij} = \mathbf{r}_j - \mathbf{r}_i \notag
955     \end{equation*}
956     and $\frac{V}{N_{\text{A}}N_{\text{B}}}$ normalizes the average over
957     the expected pair density at a given $r$.
958    
959     The next two pair correlations, $g_{\text{AB}}(r, \cos \theta)$ and
960     $g_{\text{AB}}(r, \cos \omega)$, are similar in that they are both two
961     dimensional histograms. Both use $r$ for the primary axis then a
962     $\cos$ for the secondary axis ($\cos \theta$ for
963     Eq.~\ref{eq:gofrCosTheta} and $\cos \omega$ for
964     Eq.~\ref{eq:gofrCosOmega}). This allows for the investigator to
965     correlate alignment on directional entities. $g_{\text{AB}}(r, \cos
966     \theta)$ is defined as follows:
967     \begin{equation}
968     g_{\text{AB}}(r, \cos \theta) = \frac{V}{N_{\text{A}}N_{\text{B}}}\langle
969     \sum_{i \in \text{A}} \sum_{j \in \text{B}}
970     \delta( \cos \theta - \cos \theta_{ij})
971     \delta( r - |\mathbf{r}_{ij}|) \rangle
972     \label{eq:gofrCosTheta}
973     \end{equation}
974     Where
975     \begin{equation*}
976     \cos \theta_{ij} = \mathbf{\hat{i}} \cdot \mathbf{\hat{r}}_{ij}
977     \end{equation*}
978     Here $\mathbf{\hat{i}}$ is the unit directional vector of species $i$
979     and $\mathbf{\hat{r}}_{ij}$ is the unit vector associated with vector
980     $\mathbf{r}_{ij}$.
981    
982     The second two dimensional histogram is of the form:
983     \begin{equation}
984     g_{\text{AB}}(r, \cos \omega) =
985     \frac{V}{N_{\text{A}}N_{\text{B}}}\langle
986     \sum_{i \in \text{A}} \sum_{j \in \text{B}}
987     \delta( \cos \omega - \cos \omega_{ij})
988     \delta( r - |\mathbf{r}_{ij}|) \rangle \label{eq:gofrCosOmega}
989     \end{equation}
990     Here
991     \begin{equation*}
992     \cos \omega_{ij} = \mathbf{\hat{i}} \cdot \mathbf{\hat{j}}
993     \end{equation*}
994     Again, $\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$ are the unit
995     directional vectors of species $i$ and $j$.
996    
997     The static analysis code is also cable of calculating a three
998     dimensional pair correlation of the form:
999     \begin{equation}\label{eq:gofrXYZ}
1000     g_{\text{AB}}(x, y, z) =
1001     \frac{V}{N_{\text{A}}N_{\text{B}}}\langle
1002     \sum_{i \in \text{A}} \sum_{j \in \text{B}}
1003     \delta( x - x_{ij})
1004     \delta( y - y_{ij})
1005     \delta( z - z_{ij}) \rangle
1006     \end{equation}
1007     Where $x_{ij}$, $y_{ij}$, and $z_{ij}$ are the $x$, $y$, and $z$
1008     components respectively of vector $\mathbf{r}_{ij}$.
1009    
1010     The final pair correlation is similar to
1011     Eq.~\ref{eq:gofrCosOmega}. $\langle \cos \omega
1012     \rangle_{\text{AB}}(r)$ is calculated in the following way:
1013     \begin{equation}\label{eq:cosOmegaOfR}
1014     \langle \cos \omega \rangle_{\text{AB}}(r) =
1015     \langle \sum_{i \in \text{A}} \sum_{j \in \text{B}}
1016     (\cos \omega_{ij}) \delta( r - |\mathbf{r}_{ij}|) \rangle
1017     \end{equation}
1018     Here $\cos \omega_{ij}$ is defined in the same way as in
1019     Eq.~\ref{eq:gofrCosOmega}. This equation is a single dimensional pair
1020     correlation that gives the average correlation of two directional
1021     entities as a function of their distance from each other.
1022    
1023     All static properties are calculated on a frame by frame basis. The
1024     trajectory is read a single frame at a time, and the appropriate
1025     calculations are done on each frame. Once one frame is finished, the
1026     next frame is read in, and a running average of the property being
1027     calculated is accumulated in each frame. The program allows for the
1028     user to specify more than one property be calculated in single run,
1029     preventing the need to read a file multiple times.
1030    
1031     \subsection{\label{dynamicProps}Dynamic Property Analysis}
1032    
1033     The dynamic properties of a trajectory are calculated with the program
1034     \texttt{dynamicProps}. The program will calculate the following properties:
1035     \begin{gather}
1036     \langle | \mathbf{r}(t) - \mathbf{r}(0) |^2 \rangle \label{eq:rms}\\
1037     \langle \mathbf{v}(t) \cdot \mathbf{v}(0) \rangle \label{eq:velCorr} \\
1038     \langle \mathbf{j}(t) \cdot \mathbf{j}(0) \rangle \label{eq:angularVelCorr}
1039     \end{gather}
1040    
1041     Eq.~\ref{eq:rms} is the root mean square displacement
1042     function. Eq.~\ref{eq:velCorr} and Eq.~\ref{eq:angularVelCorr} are the
1043     velocity and angular velocity correlation functions respectively. The
1044     latter is only applicable to directional species in the simulation.
1045    
1046     The \texttt{dynamicProps} program handles he file in a manner different from
1047     \texttt{staticProps}. As the properties calculated by this program are time
1048     dependent, multiple frames must be read in simultaneously by the
1049     program. For small trajectories this is no problem, and the entire
1050     trajectory is read into memory. However, for long trajectories of
1051     large systems, the files can be quite large. In order to accommodate
1052     large files, \texttt{dynamicProps} adopts a scheme whereby two blocks of memory
1053     are allocated to read in several frames each.
1054    
1055     In this two block scheme, the correlation functions are first
1056     calculated within each memory block, then the cross correlations
1057     between the frames contained within the two blocks are
1058     calculated. Once completed, the memory blocks are incremented, and the
1059     process is repeated. A diagram illustrating the process is shown in
1060     Fig.~\ref{fig:dynamicPropsMemory}. As was the case with \texttt{staticProps},
1061     multiple properties may be calculated in a single run to avoid
1062     multiple reads on the same file.
1063    
1064     \begin{figure}
1065 mmeineke 1045 \centering
1066     \includegraphics[width=\linewidth]{dynamicPropsMem.eps}
1067 mmeineke 1044 \caption{This diagram illustrates the dynamic memory allocation used by \texttt{dynamicProps}, which follows the scheme: $\sum^{N_{\text{memory blocks}}}_{i=1}[ \operatorname{self}(i) + \sum^{N_{\text{memory blocks}}}_{j>i} \operatorname{cross}(i,j)]$. The shaded region represents the self correlation of the memory block, and the open blocks are read one at a time and the cross correlations between blocks are calculated.}
1068     \label{fig:dynamicPropsMemory}
1069     \end{figure}
1070    
1071 mmeineke 1051 \section{\label{oopseSec:design}Program Design}
1072 mmeineke 1044
1073     \subsection{\label{sec:architecture} OOPSE Architecture}
1074    
1075     The core of OOPSE is divided into two main object libraries: {\texttt
1076     libBASS} and {\texttt libmdtools}. {\texttt libBASS} is the library
1077     developed around the parseing engine and {\texttt libmdtools} is the
1078     software library developed around the simulation engine.
1079    
1080     \subsection{\label{sec:parallelization} Parallelization of OOPSE}
1081    
1082     Although processor power is doubling roughly every 18 months according
1083     to the famous Moore's Law\cite{moore}, it is still unreasonable to
1084     simulate systems of more then a 1000 atoms on a single processor. To
1085     facilitate study of larger system sizes or smaller systems on long
1086     time scales in a reasonable period of time, parallel methods were
1087     developed allowing multiple CPU's to share the simulation
1088     workload. Three general categories of parallel decomposition method's
1089     have been developed including atomic, spatial and force decomposition
1090     methods.
1091    
1092     Algorithmically simplest of the three method's is atomic decomposition
1093     where N particles in a simulation are split among P processors for the
1094     duration of the simulation. Computational cost scales as an optimal
1095     $O(N/P)$ for atomic decomposition. Unfortunately all processors must
1096     communicate positions and forces with all other processors leading
1097     communication to scale as an unfavorable $O(N)$ independent of the
1098     number of processors. This communication bottleneck led to the
1099     development of spatial and force decomposition methods in which
1100     communication among processors scales much more favorably. Spatial or
1101     domain decomposition divides the physical spatial domain into 3D boxes
1102     in which each processor is responsible for calculation of forces and
1103     positions of particles located in its box. Particles are reassigned to
1104     different processors as they move through simulation space. To
1105     calculate forces on a given particle, a processor must know the
1106     positions of particles within some cutoff radius located on nearby
1107     processors instead of the positions of particles on all
1108     processors. Both communication between processors and computation
1109     scale as $O(N/P)$ in the spatial method. However, spatial
1110     decomposition adds algorithmic complexity to the simulation code and
1111     is not very efficient for small N since the overall communication
1112     scales as the surface to volume ratio $(N/P)^{2/3}$ in three
1113     dimensions.
1114    
1115     Force decomposition assigns particles to processors based on a block
1116     decomposition of the force matrix. Processors are split into a
1117     optimally square grid forming row and column processor groups. Forces
1118     are calculated on particles in a given row by particles located in
1119     that processors column assignment. Force decomposition is less complex
1120     to implement then the spatial method but still scales computationally
1121     as $O(N/P)$ and scales as $(N/\sqrt{p})$ in communication
1122     cost. Plimpton also found that force decompositions scales more
1123     favorably then spatial decomposition up to 10,000 atoms and favorably
1124     competes with spatial methods for up to 100,000 atoms.
1125    
1126     \subsection{\label{openSource}Open Source and Distribution License}
1127    
1128    
1129 mmeineke 1051 \section{\label{oopseSec:conclusion}Conclusion}
1130 mmeineke 1044
1131     \begin{itemize}
1132    
1133     \item Restate capabilities
1134    
1135     \item recap major structure / design choices
1136    
1137     \begin{itemize}
1138    
1139     \item parallel
1140     \item symplectic integration
1141     \item languages
1142    
1143     \end{itemize}
1144    
1145     \item How well does it meet the primary goal
1146    
1147     \end{itemize}