--- trunk/oopsePaper/oopsePaper.tex 2004/04/19 21:25:23 1123 +++ trunk/oopsePaper/oopsePaper.tex 2004/07/28 15:44:21 1425 @@ -2,8 +2,8 @@ \usepackage{amsmath} \usepackage{amssymb} \usepackage{endfloat} -%\usepackage{berkeley} \usepackage{listings} +\usepackage{palatino} \usepackage{graphicx} \usepackage[ref]{overcite} \usepackage{setspace} @@ -25,7 +25,8 @@ Engine for Molecular Dynamics} \title{{\sc oopse}: An Open Source Object-Oriented Parallel Simulation Engine for Molecular Dynamics} -\author{Matthew A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher J. Fennell and J. Daniel Gezelter\\ +\author{Matthew A. Meineke, Charles F. Vardeman II, Teng Lin,\\ + Christopher J. Fennell and J. Daniel Gezelter\\ Department of Chemistry and Biochemistry\\ University of Notre Dame\\ Notre Dame, Indiana 46556} @@ -34,75 +35,136 @@ We detail the capabilities of a new open-source parall \maketitle \begin{abstract} -We detail the capabilities of a new open-source parallel simulation -package ({\sc oopse}) that can perform molecular dynamics simulations -on atom types that are missing from other popular packages. In -particular, {\sc oopse} is capable of performing orientational -dynamics on dipolar systems, and it can handle simulations of metallic -systems using the embedded atom method ({\sc eam}). +Need an abstract. \end{abstract} \section{\label{sec:intro}Introduction} -When choosing to simulate a chemical system with molecular dynamics, -there are a variety of options available. For simple systems, one -might consider writing one's own programming code. However, as systems -grow larger and more complex, building and maintaining code for the -simulations becomes a time consuming task. In such cases it is usually -more convenient for a researcher to turn to pre-existing simulation -packages. These packages, such as {\sc amber}\cite{pearlman:1995} and -{\sc charmm}\cite{Brooks83}, provide powerful tools for researchers to -conduct simulations of their systems without spending their time -developing a code base to conduct their research. This then frees them -to perhaps explore experimental analogues to their models. +UNDERWAY -Despite their utility, problems with these packages arise when -researchers try to develop techniques or energetic models that the -code was not originally designed to simulate. Examples of techniques -and energetics not commonly implemented include; dipole-dipole -interactions, rigid body dynamics, and metallic potentials. When faced -with these obstacles, a researcher must either develop their own code -or license and extend one of the commercial packages. What we have -elected to do is develop a body of simulation code capable of -implementing the types of models upon which our research is based. -In developing {\sc oopse}, we have adhered to the precepts of Open -Source development, and are releasing our source code with a -permissive license. It is our intent that by doing so, other -researchers might benefit from our work, and add their own -contributions to the package. The license under which {\sc oopse} is -distributed allows any researcher to download and modify the source -code for their own use. In this way further development of {\sc oopse} -is not limited to only the models of interest to ourselves, but also -those of the community of scientists who contribute back to the -project. +We have structured this paper to first discuss the underlying concepts +in this simulation package (Sec. \ref{oopseSec:IOfiles}). The +empirical energy functions implemented are discussed in +Sec.~\ref{oopseSec:empiricalEnergy}. Sec.~\ref{oopseSec:mechanics} +describes the various Molecular Dynamics algorithms {\sc oopse} +implements in the integration of the Newtonian equations of motion. +Program design considerations for parallel computing are presented in +Sec.~\ref{oopseSec:parallelization}. Concluding remarks are presented +in Sec.~\ref{oopseSec:conclusion}. -We have structured this chapter to first discuss the empirical energy -functions that {\sc oopse } implements in -Sec.~\ref{oopseSec:empiricalEnergy}. Following that is a discussion of -the various input and output files associated with the package -(Sec.~\ref{oopseSec:IOfiles}). Sec.~\ref{oopseSec:mechanics} -elucidates the various Molecular Dynamics algorithms {\sc oopse} -implements in the integration of the Newtonian equations of -motion. Basic analysis of the trajectories obtained from the -simulation is discussed in Sec.~\ref{oopseSec:props}. Program design -considerations are presented in Sec.~\ref{oopseSec:design}. And -lastly, Sec.~\ref{oopseSec:conclusion} concludes the chapter. +\section{\label{oopseSec:IOfiles}Concepts \& Files} -\section{\label{oopseSec:empiricalEnergy}The Empirical Energy Functions} +A simulation in {\sc oopse} is built using a few fundamental +conceptual building blocks most of which are chemically intuitive. +The basic unit of a simulation is an {\tt atom}. The parameters +describing an {\tt atom} have been generalized to make it as flexible +as possible; this means that in addition to translational degrees of +freedom, {\tt Atoms} may also have {\it orientational} degrees of freedom. -\subsection{\label{oopseSec:atomsMolecules}Atoms, Molecules and Rigid Bodies} +The fundamental (static) properties of {\tt atoms} are defined by the +{\tt forceField} chosen for the simulation. The atomic properties +specified by a {\tt forceField} might include (but are not limited to) +charge, $\sigma$ and $\epsilon$ values for Lennard-Jones interactions, +the strength of the dipole moment ($\mu$), the mass, and the moments +of inertia. Other more complicated properties of atoms might also be +specified by the {\tt forceField}. -The basic unit of an {\sc oopse} simulation is the atom. The -parameters describing the atom are generalized to make the atom as -flexible a representation as possible. They may represent specific -atoms of an element, or be used for collections of atoms such as -methyl and carbonyl groups. The atoms are also capable of having -directional components associated with them (\emph{e.g.}~permanent -dipoles). Charges, permanent dipoles, and Lennard-Jones parameters for -a given atom type are set in the force field parameter files. +{\tt Atoms} can be grouped together in many ways. A {\tt rigidBody} +contains atoms that exert no forces on one another and which move as a +single rigid unit. A {\tt cutoffGroup} may contain atoms which +function together as a (rigid {\it or} non-rigid) unit for potential +energy calculations, +\begin{equation} +V_{ab} = s(r_{ab}) \sum_{i \in a} \sum_{j \in b} V_{ij}(r_{ij}) +\end{equation} +Here, $a$ and $b$ are two {\tt cutoffGroups} containing multiple atoms +($a = \left\{i\right\}$ and $b = \left\{j\right\}$). $s(r_{ab})$ is a +generalized switching function which insures that the atoms in the two +{\tt cutoffGroups} are treated identically as the two groups enter or +leave an interaction region. -\begin{lstlisting}[float,caption={[Specifier for molecules and atoms] A sample specification of an Ar molecule},label=sch:AtmMole] +{\tt Atoms} may also be grouped in more traditional ways into {\tt +bonds}, {\tt bends}, and {\tt torsions}. These groupings allow the +correct choice of interaction parameters for short-range interactions +to be chosen from the definitions in the {\tt forceField}. + +All of these groups of {\tt atoms} are brought together in the {\tt +molecule}, which is the fundamental structure for setting up and {\sc +oopse} simulation. {\tt Molecules} contain lists of {\tt atoms} +followed by listings of the other atomic groupings ({\tt bonds}, {\tt +bends}, {\tt torsions}, {\tt rigidBodies}, and {\tt cutoffGroups}) +which relate the atoms to one another. + +Simulations often involve heterogeneous collections of molecules. To +specify a mixture of {\tt molecule} types, {\sc oopse} uses {\tt +components}. Even simulations containing only one type of molecule +must specify a single {\tt component}. + +Starting a simulation requires two types of information: {\it +meta-data}, which describes the types of objects present in the +simulation, and {\it configuration} information, which describes the +initial state of these objects. The meta-data is given to {\sc oopse} +using a C-based syntax that is parsed at the beginning of the +simulation. Configuration information is specified using an extended +XYZ file format. Both the meta-data and configuration file formats +are described in the following sections. + +\subsection{Meta-data Files} + +{\sc oopse} uses a C-based script syntax to parse the meta-data files +at run time. These files allow the user to completely describe the +system they wish to simulate, as well as tailor {\sc oopse}'s behavior +during the simulation. Meta-data files are typically denoted with the +extension {\tt .md} (which can stand for Meta-Data or Molecular +Dynamics or Molecule Definition depending on the user's mood). An +example meta-data file is shown in Scheme~\ref{sch:mdExample}. + +\begin{lstlisting}[float,caption={[An example of a complete meta-data +file] An example showing a complete meta-data +file.},label={sch:mdExample}] + +molecule{ + name = "Ar"; + nAtoms = 1; + atom[0]{ + type="Ar"; + position( 0.0, 0.0, 0.0 ); + } +} + +nComponents = 1; +component{ + type = "Ar"; + nMol = 108; +} + +initialConfig = "./argon.in"; + +forceField = "LJ"; +ensemble = "NVE"; // specify the simulation ensemble +dt = 1.0; // the time step for integration +runTime = 1e3; // the total simulation run time +sampleTime = 100; // trajectory file frequency +statusTime = 50; // statistics file frequency + +\end{lstlisting} + +Within the meta-data file it is necessary to provide a complete +description of the molecule before it is actually placed in the +simulation. {\sc oopse}'s meta-data syntax was originally developed +with this goal in mind, and allows for the use of {\it include files} +to specify all atoms in a molecular prototype, as well as any bonds, +bends, or torsions. Include files allow the user to describe a +molecular prototype once, then simply include it into each simulation +containing that molecule. Returning to the example in +Scheme~\ref{sch:mdExample}, the include file's contents would be +Scheme~\ref{sch:mdIncludeExample}, and the new meta-data file would +become Scheme~\ref{sch:mdExPrime}. + +\begin{lstlisting}[float,caption={An example molecule definition in an +include file.},label={sch:mdIncludeExample}] + molecule{ name = "Ar"; nAtoms = 1; @@ -111,30 +173,56 @@ molecule{ position( 0.0, 0.0, 0.0 ); } } + \end{lstlisting} +\begin{lstlisting}[float,caption={Revised meta-data example.},label={sch:mdExPrime}] -Atoms can be collected into secondary structures such as rigid bodies -or molecules. The molecule is a way for {\sc oopse} to keep track of -the atoms in a simulation in logical manner. Molecular units store the -identities of all the atoms and rigid bodies associated with -themselves, and are responsible for the evaluation of their own -internal interactions (\emph{i.e.}~bonds, bends, and torsions). Scheme -\ref{sch:AtmMole} shows how one creates a molecule in a ``model'' or -\texttt{.mdl} file. The position of the atoms given in the -declaration are relative to the origin of the molecule, and is used -when creating a system containing the molecule. +#include "argon.md" -As stated previously, one of the features that sets {\sc oopse} apart -from most of the current molecular simulation packages is the ability -to handle rigid body dynamics. Rigid bodies are non-spherical -particles or collections of particles that have a constant internal +nComponents = 1; +component{ + type = "Ar"; + nMol = 108; +} + +initialConfig = "./argon.in"; + +forceField = "LJ"; +ensemble = "NVE"; +dt = 1.0; +runTime = 1e3; +sampleTime = 100; +statusTime = 50; + +\end{lstlisting} + +\subsection{\label{oopseSec:atomsMolecules}Atoms, Molecules, and other +ways of grouping atoms} + +As mentioned above, the fundamental unit for an {\sc oopse} simulation +is the {\tt atom}. Atoms can be collected into secondary structures +such as {\tt rigidBodies}, {\tt cutoffGroups}, or {\tt molecules}. The +{\tt molecule} is a way for {\sc oopse} to keep track of the atoms in +a simulation in logical manner. Molecular units store the identities +of all the atoms and rigid bodies associated with themselves, and they +are responsible for the evaluation of their own internal interactions +(\emph{i.e.}~bonds, bends, and torsions). Scheme +\ref{sch:mdIncludeExample} shows how one creates a molecule in an +included meta-data file. The positions of the atoms given in the +declaration are relative to the origin of the molecule, and the origin +is used when creating a system containing the molecule. + +One of the features that sets {\sc oopse} apart from most of the +current molecular simulation packages is the ability to handle rigid +body dynamics. Rigid bodies are non-spherical particles or collections +of particles (e.g. $\mbox{C}_{60}$) that have a constant internal potential and move collectively.\cite{Goldstein01} They are not included in most simulation packages because of the algorithmic -complexity involved in propagating orientational degrees of -freedom. Until recently, integrators which propagate orientational -motion have been much worse than those available for translational -motion. +complexity involved in propagating orientational degrees of freedom. +Integrators which propagate orientational motion with an acceptable +level of energy conservation for molecular dynamics are relatively +new inventions. Moving a rigid body involves determination of both the force and torque applied by the surroundings, which directly affect the @@ -144,7 +232,7 @@ the rigid body. The torque on rigid body $i$ is the rigid body is simply the sum of these external forces. Accumulation of the total torque on the rigid body is more complex than the force because the torque is applied to the center of mass of -the rigid body. The torque on rigid body $i$ is +the rigid body. The space-fixed torque on rigid body $i$ is \begin{equation} \boldsymbol{\tau}_i= \sum_{a}\biggl[(\mathbf{r}_{ia}-\mathbf{r}_i)\times \mathbf{f}_{ia} @@ -171,15 +259,16 @@ systems.\cite{Evans77} performance enhancements, particularly for very small systems.\cite{Evans77} -{\sc oopse} utilizes a relatively new scheme that propagates the -entire nine parameter rotation matrix. Further discussion -on this choice can be found in Sec.~\ref{oopseSec:integrate}. An example -definition of a rigid body can be seen in Scheme -\ref{sch:rigidBody}. The positions in the atom definitions are the -placements of the atoms relative to the origin of the rigid body, -which itself has a position relative to the origin of the molecule. +Rather than use one of the previously stated methods, {\sc oopse} +utilizes a relatively new scheme that propagates the entire nine +parameter rotation matrix. Further discussion on this choice can be +found in Sec.~\ref{oopseSec:integrate}. An example definition of a +rigid body can be seen in Scheme +\ref{sch:rigidBody}. -\begin{lstlisting}[float,caption={[Defining rigid bodies]A sample definition of a rigid body},label={sch:rigidBody}] +\begin{lstlisting}[float,caption={[Defining rigid bodies]A sample +definition of a molecule containing a rigid body and a cutoff +group},label={sch:rigidBody}] molecule{ name = "TIP3P"; nAtoms = 3; @@ -201,14 +290,422 @@ molecule{ nMembers = 3; members(0, 1, 2); } + + nCutoffGroups = 1; + cutoffGroup[0]{ + nMembers = 3; + members(0, 1, 2); + } } \end{lstlisting} + +\subsection{\label{sec:miscConcepts}Creating a Metadata File} + +The actual creation of a metadata file requires several key +components. The first part of the file needs to be the declaration of +all of the molecule prototypes used in the simulation. This is +typically done through included meta-data files. Only the molecules +actually present in the simulation need to be declared; however, {\sc +oopse} allows for the declaration of more molecules than are +needed. This gives the user the ability to build up a library of +commonly used molecules into a single include file. + +Once all prototypes are declared, the ordering of the rest of the +script is less stringent. The molecular composition of the simulation +is specified with {\tt component} statements. Each different type of +molecule present in the simulation is considered a separate +component. The number of components must be declared before the first +component block statement (an example is shown in +Sch.~\ref{sch:mdExPrime}). The component blocks tell {\sc oopse} the +number of molecules that will be in the simulation, and the order in +which the components blocks are declared sets the ordering of the real +atoms in the configuration file as well as in the output files. The +remainder of the script then sets the various simulation parameters +for the system of interest. + +The required set of parameters that must be present in all simulations +is given in Table~\ref{table:reqParams}. Since the user can use {\sc +oopse} to perform energy minimizations as well as molecular dynamics +simulations, one of the {\tt minimizer} or {\tt ensemble} keywords +must be present. The {\tt ensemble} keyword is responsible for +selecting the integration method used for the calculation of the +equations of motion. An in depth discussion of the various methods +available in {\sc oopse} can be found in +Sec.~\ref{oopseSec:mechanics}. The {\tt minimizer} keyword selects +which minimization method to use, and more details on the choices of +minimizer parameters can be found in +Sec.~\ref{oopseSec:minimizer}. The {\tt forceField} statement is +important for the selection of which forces will be used in the course +of the simulation. {\sc oopse} supports several force fields, as +outlined in Sec.~\ref{oopseSec:empericalEnergy}. The force fields are +interchangeable between simulations, with the only requirement being +that all atoms needed by the simulation are defined within the +selected force field. + +For molecular dynamics simulations, the time step between force +evaluations is set with the {\tt dt} parameter, and {\tt runTime} will +set the time length of the simulation. Note, that {\tt runTime} is an +absolute time, meaning if the simulation is started at t = 10.0~ns +with a {\tt runTime} of 25.0~ns, the simulation will only run for an +additional 15.0~ns. + +For energy minimizations, it is not necessary to specify {\tt dt} or +{\tt runTime}. + +The final required parameter is the {\tt initialConfig} +statement. This will set the initial coordinates for the system, as +well as the initial time if the {\tt useInitalTime} flag is set to +{\tt true}. The format of the file specified in {\tt initialConfig}, +is given in Sec.~\ref{oopseSec:coordFiles}. Additional parameters are +summarized in Table~\ref{table:genParams}. + +It is important to note the fundamental units in all files which are +read and written by {\sc oopse}. Energies are in $\mbox{kcal +mol}^{-1}$, distances are in $\mbox{\AA}$, times are in $\mbox{fs}$, +translational velocities are in $\mbox{\AA fs}^{-1}$, and masses are +in $\mbox{amu}$. Orientational degrees of freedom are described using +quaternions (unitless, but $q_w^2 + q_x^2 + q_y^2 + q_z^2 = 1$), +body-fixed angular momenta ($\mbox{amu \AA}^{2} \mbox{radians +fs}^{-1}$), and body-fixed moments of inertia ($\mbox{amu \AA}^{2}$). + +\begin{table} +\caption{Meta-data Keywords: Required Parameters} +\label{table:reqParams} +\begin{center} +% Note when adding or removing columns, the \hsize numbers must add up to the total number +% of columns. +\begin{tabularx}{\linewidth}% + {>{\setlength{\hsize}{1.00\hsize}}X% + >{\setlength{\hsize}{0.4\hsize}}X% + >{\setlength{\hsize}{1.2\hsize}}X% + >{\setlength{\hsize}{1.4\hsize}}X} + +{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline + +{\tt forceField} & string & Sets the force field. & Possible force fields are "DUFF", "LJ", and "EAM". \\ +{\tt nComponents} & integer & Sets the number of components. & Needs to appear before the first {\tt Component} block. \\ +{\tt initialConfig} & string & Sets the file containing the initial configuration. & Can point to any file containing the configuration in the correct order. \\ +{\tt minimizer}& string & Chooses a minimizer & Possible minimizers +are "SD" and "CG". Either {\tt ensemble} or {\tt minimizer} must be specified. \\ +{\tt ensemble} & string & Sets the ensemble. & Possible ensembles are +"NVE", "NVT", "NPTi", "NPTf", and "NPTxyz". Either {\tt ensemble} +or {\tt minimizer} must be specified. \\ +{\tt dt} & fs & Sets the time step. & Selection of {\tt dt} should be +small enough to sample the fastest motion of the simulation. (required +for molecular dynamics simulations)\\ +{\tt runTime} & fs & Sets the time at which the simulation should +end. & This is an absolute time, and will end the simulation when the +current time meets or exceeds the {\tt runTime}. (required for +molecular dynamics simulations)\\ + +\end{tabularx} +\end{center} +\end{table} + +\begin{table} +\caption{Meta-data Keywords: General Parameters} +\label{table:genParams} +\begin{center} +% Note when adding or removing columns, the \hsize numbers must add up to the total number +% of columns. +\begin{tabularx}{\linewidth}% + {>{\setlength{\hsize}{1.00\hsize}}X% + >{\setlength{\hsize}{0.4\hsize}}X% + >{\setlength{\hsize}{1.2\hsize}}X% + >{\setlength{\hsize}{1.4\hsize}}X} + +{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline + +{\tt finalConfig} & string & Sets the name of the final +output file. & Useful when stringing simulations together. Defaults to +the root name of the initial meta-data file but with an {\tt .eor} +extension. \\ +{\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. \\ +{\tt sampleTime} & fs & Sets the frequency at which the {\tt .dump} file is written. & Default sets the frequency to the {\tt runTime}. \\ +{\tt statusTime} & fs & Sets the frequency at which the {\tt .stat} file is written. & Defaults set the frequency to the {\tt sampleTime}. \\ +{\tt cutoffRadius} & $\mbox{\AA}$ & Manually sets the cutoffRadius & Defaults to +$15\mbox{\AA}$ for systems containing charges or dipoles or to $2.5 +\sigma_{L}$, where $\sigma_{L}$ is the largest LJ $\sigma$ in the +simulation. \\ +{\tt switchingRadius} & $\mbox{\AA}$ & Manually sets the inner radius for the switching function. & Defaults to 95~\% of the {\tt cutoffRadius}. \\ +{\tt useReactionField} & logical & Turns the reaction field correction on/off. & Default is "false". \\ +{\tt dielectric} & unitless & Sets the dielectric constant for reaction field. & If {\tt useReactionField} is true, then {\tt dielectric} must be set. \\ +{\tt usePeriodicBoundaryConditions} & & & \\ + & logical & Turns periodic boundary conditions on/off. & Default is "true". \\ +{\tt seed } & integer & Sets the seed value for the random number +generator. & The seed needs to be at least 9 digits long. The default +is to take the seed from the CPU clock. \\ +{\tt forceFieldVariant} & string & Sets the name of the variant of the +force field. ({\sc eam} has three variants: {\tt u3}, {\tt u6}, and +{\tt VC}. + +\end{tabularx} +\end{center} +\end{table} + + +\subsection{\label{oopseSec:coordFiles}Coordinate Files} + +The standard format for storage of a systems coordinates is a modified +xyz-file syntax, the exact details of which can be seen in +Scheme~\ref{sch:dumpFormat}. As all bonding and molecular information +is stored in the meta-data files, the coordinate files contain only +the coordinates of the objects which move independently during the +simulation. It is important to note that {\it not all atoms} are +capable of independent motion. Atoms which are part of rigid bodies +are not ``integrable objects'' in the equations of motion; the rigid +bodies themselves are the integrable objects. Therefore, the +coordinate file contains coordinates of all the {\tt +integrableObjects} in the system. For systems without rigid bodies, +this is simply the coordinates of all the atoms. + +It is important to note that although the simulation propagates the +complete rotation matrix, directional entities are written out using +quaternions to save space in the output files. All objects (atoms, +orientational atoms, and rigid bodies) are given quaternions and +angular momenta in coordinate files which are output by OOPSE, but it +is not necessary for the user to specify the quaternions or angular +momenta for atoms without orientational degrees of freedom. + +\begin{lstlisting}[float,caption={[The format of the coordinate +files] An example of the format of the coordinate files. The fist line +is the number of {\tt integrableObjects} (freely-moving atoms and +rigid bodies). The second line begins with the time stamp followed by +the three $\mathsf{H}$ column vectors. It is important to note that +for extended system ensembles, additional information pertinent to the +integrators may be stored on this line as well. The next lines are the +coordinates for all integrable objects in the system. The name of the +integrable object is followed by position, velocity, quaternions, and +lastly, body fixed angular momentum.},label=sch:dumpFormat] + +nIntegrable +time; Hxx Hyx Hzx; Hxy Hyy Hzy; Hxz Hyz Hzz; +Name1 x y z vx vy vz qw qx qy qz jx jy jz +Name2 x y z vx vy vz qw qx qy qz jx jy jz +etc... + +\end{lstlisting} + +The {\tt name} field for atoms is simply the atom type as specified in +the meta-data file. The {\tt name} field for a rigid body is +specified as {\tt MOLTYPE\_RB\_N}, to specify that this is {\tt +rigidBody} N in a molecule of type MOLTYPE. In simulations with rigid +body models of water, a sample coordinate line might be: + +\begin{tt} +TIP3P\_RB\_0 x y z vx vy vz qw qx qy qz jx jy jz +\end{tt} + +which tells the program that the rigid body representing a TIP3P +molecule (rigid body \# 0) is listed on that line. + +There are three files used by {\sc oopse} which are written in the +coordinate format. They are: the initial coordinate file +(\texttt{.in}), the simulation trajectory file (\texttt{.dump}), and +the final coordinates or ``end-of-run'' for the simulation +(\texttt{.eor}). The initial coordinate file is necessary for {\sc +oopse} to start the simulation with the proper coordinates, and this +file must be generated by the user before the simulation run. The +trajectory (or ``dump'') file is updated during simulation and is used +to store snapshots of the coordinates at regular intervals. The first +frame is a duplication of the +\texttt{.in} file, and each subsequent frame is appended to the file +at an interval specified in the meta-data file with the +\texttt{sampleTime} flag. The final coordinate file is the +``end-of-run'' file. The \texttt{.eor} file stores the final +configuration of the system for a given simulation. The file is +updated at the same time as the \texttt{.dump} file, but it only +contains the most recent frame. In this way, an \texttt{.eor} file may +be used to initialize a second simulation should it be necessary to +recover from a crash or power outage. + +\subsection{\label{oopseSec:initCoords}Generation of Initial Coordinates} + +As was stated in Sec.~\ref{oopseSec:coordFiles}, an initial coordinate +file is needed to provide the starting coordinates for a simulation. +Since each simulation is different, system creation is left to the end +user; however, we have included a few sample programs which make some +specialized structures. The {\tt .in} file must list the integrable +objects in the correct order. The ordering of the integrable objects +relies on the ordering of molecules within the meta-data file. {\sc +oopse} expects the order to comply with the following guidelines: +\begin{enumerate} +\item All of the molecules of the first declared component are given +before proceeding to the molecules of the second component, and so on +for all subsequently declared components. +\item The ordering of the atoms for each molecule follows the order +declared in the molecule's declaration within the model file. +\item Only atoms which are not members of a {\tt rigidBody} are +included +\item Rigid Body coordinates for a molecule are listed immediately +after the the other atoms in a molecule. Some molecules may be +entirely rigid, in which case, only the rigid body coordinates are +given. +\end{enumerate} +An example is given in the meta-data file in Scheme~\ref{sch:initEx1} +which results in the {\tt .in} file shown in Scheme~\ref{sch:initEx2}. + +\begin{lstlisting}[float,caption={Example declaration of the +$\text{I}_2$ molecule and the HCl molecule. The two molecules are then +included into a simulation.}, label=sch:initEx1] + +molecule{ + name = "I2"; + nAtoms = 2; + atom[0]{ + type = "I"; + } + atom[1]{ + type = "I"; + } + nBonds = 1; + bond[0]{ + members( 0, 1); + } +} + +molecule{ + name = "HCl" + nAtoms = 2; + atom[0]{ + type = "H"; + } + atom[1]{ + type = "Cl"; + } + nBonds = 1; + bond[0]{ + members( 0, 1); + } +} + +nComponents = 2; +component{ + type = "HCl"; + nMol = 4; +} +component{ + type = "I2"; + nMol = 1; +} + +initialConfig = "mixture.in"; + +\end{lstlisting} + +\begin{lstlisting}[float,caption={The contents of the {\tt +mixture.in} file matching the declarations in +Scheme~\ref{sch:initEx1}. Note that even though $\text{I}_2$ is +declared before HCl, the {\tt .in} file follows the order {\it in +which the components were included}.},label=sch:initEx2] + +10 +0.0; 10.0 0.0 0.0; 0.0 10.0 0.0; 0.0 0.0 10.0; +H ... +Cl ... +H ... +Cl ... +H ... +Cl ... +H ... +Cl ... +I ... +I ... + +\end{lstlisting} + + +\subsection{The Statistics File} + +The last output file generated by {\sc oopse} is the statistics +file. This file records such statistical quantities as the +instantaneous temperature (in $K$), volume (in $\mbox{\AA}^{3}$), +pressure (in $\mbox{atm}$), etc. It is written out with the frequency +specified in the meta-data file with the +\texttt{statusTime} keyword. The file allows the user to observe the +system variables as a function of simulation time while the simulation +is in progress. One useful function the statistics file serves is to +monitor the conserved quantity of a given simulation ensemble, +allowing the user to gauge the stability of the integrator. The +statistics file is denoted with the \texttt{.stat} file extension. + +\section{\label{oopseSec:empiricalEnergy}The Empirical Energy +Functions} + +Like many simulation packages, {\sc oopse} splits the potential energy +into the short-ranged (bonded) portion and a long-range (non-bonded) +potential, +\begin{equation} +V = V_{\mathrm{short-range}} + V_{\mathrm{long-range}}. +\end{equation} +The short-ranged portion includes explicit bonds, bends and torsions, +which have been defined in the meta-data file for the molecules which +present in the simulation. The functional forms and parameters for +these interactions are defined by the force field which is chosen. +Calculating long-range (non-bonded) potential involves a sum over all +pairs of atoms (except for those atoms which are involved in a bond, +bend, or torsion with each other). If done poorly, calculating the +the long-range interactions for $N$ atoms would involve $N^2$ +evaluations of atomic distance. To reduce the number of distance +evaluations between pairs of atoms, {\sc oopse} uses a switched cutoff +with Verlet neighbor lists.\cite{allen87:csl} It is well known that +neutral groups which contain charges will exhibit pathological forces +unless the cutoff is applied to the neutral groups evenly instead of +to the individual atoms.\cite{leach01:mm} {\sc oopse} allows users to +specify cutoff groups which may contain an arbitrary number of atoms +in the molecule. Atoms in a cutoff group are treated as a single unit +for the evaluation of the switching function: +\begin{equation} +V_{\mathrm{long-range}} = \sum_{a} \sum_{b>a} s(r_{ab}) \sum_{i \in a} \sum_{j \in b} V_{ij}(r_{ij}), +\end{equation} +where $r_{ab}$ is the distance between the centers of mass of the two +cutoff groups ($a$ and $b$). + +The sums over $a$ and $b$ are over the cutoffGroups that are present +in the simulation. Atoms which are not explicitly defined as members +of a {\tt cutoffGroup} are treated as a group consisting of only one +atom. The switching function, $s(r)$ is the standard cubic switching +function, +\begin{equation} +S(r) = + \begin{cases} + 1 & \text{if $r \le r_{\text{sw}}$},\\ + \frac{(r_{\text{cut}} + 2r - 3r_{\text{sw}})(r_{\text{cut}} - r)^2} + {(r_{\text{cut}} - r_{\text{sw}})^2} + & \text{if $r_{\text{sw}} < r \le r_{\text{cut}}$}, \\ + 0 & \text{if $r > r_{\text{cut}}$.} + \end{cases} +\label{eq:dipoleSwitching} +\end{equation} +Here, $r_{\text{sw}}$ is the {\tt switchingRadius}, or the distance +beyond which interactions are reduced, and $r_{\text{cut}}$ is the +{\tt cutoffRadius}, or the distance at which interactions are +truncated. + +Users of {\sc oopse} do not need to specify the {\tt cutoffRadius} or +{\tt switchingRadius}. In simulations containing only Lennard-Jones +atoms, the cutoff radius has a default value of $2.5\sigma_{ii}$, +where $\sigma_{ii}$ is the largest Lennard-Jones length parameter +present in the simulation. In simulations containing charged or +dipolar atoms, the default cutoff Radius is $15 \mbox{\AA}$. + +The {\tt switchingRadius} is set to a default value of 95\% of the +{\tt cutoffRadius}. In the special case of a simulation containing +{\it only} Lennard-Jones atoms, the default switching radius takes the +same value as the cutoff radius, and {\sc oopse} will use a shifted +potential to remove discontinuities in the potential at the cutoff. +Both radii may be specified in the meta-data file. + +Force fields can easily be added to {\sc oopse}, although it comes +with a few simple examples (Lennard-Jones, {\sc duff}, {\sc water}, +and {\sc eam}) which are explained in the following sections. + \subsection{\label{sec:LJPot}The Lennard Jones Force Field} The most basic force field implemented in {\sc oopse} is the -Lennard-Jones force field, which mimics the van der Waals interaction at -long distances, and uses an empirical repulsion at short +Lennard-Jones force field, which mimics the van der Waals interaction +at long distances and uses an empirical repulsion at short distances. The Lennard-Jones potential is given by: \begin{equation} V_{\text{LJ}}(r_{ij}) = @@ -221,13 +718,15 @@ $\epsilon_{ij}$ scales the well depth of the potential where $r_{ij}$ is the distance between particles $i$ and $j$, $\sigma_{ij}$ scales the length of the interaction, and $\epsilon_{ij}$ scales the well depth of the potential. Scheme -\ref{sch:LJFF} gives an example \texttt{.bass} file that +\ref{sch:LJFF} gives an example meta-data file that sets up a system of 108 Ar particles to be simulated using the Lennard-Jones force field. -\begin{lstlisting}[float,caption={[Invocation of the Lennard-Jones force field] A sample system using the Lennard-Jones force field.},label={sch:LJFF}] +\begin{lstlisting}[float,caption={[Invocation of the Lennard-Jones +force field] A sample meta-data file for a small Lennard-Jones +simulation.},label={sch:LJFF}] -#include "argon.mdl" +#include "argon.md" nComponents = 1; component{ @@ -235,28 +734,14 @@ initialConfig = "./argon.init"; nMol = 108; } -initialConfig = "./argon.init"; +initialConfig = "./argon.in"; forceField = "LJ"; \end{lstlisting} -Because this potential is calculated between all pairs, the force -evaluation can become computationally expensive for large systems. To -keep the pair evaluations to a manageable number, {\sc oopse} employs -a cut-off radius.\cite{allen87:csl} The cutoff radius can either be -specified in the \texttt{.bass} file, or left as its default value of -$2.5\sigma_{ii}$, where $\sigma_{ii}$ is the largest Lennard-Jones -length parameter present in the simulation. Truncating the calculation -at $r_{\text{cut}}$ introduces a discontinuity into the potential -energy and the force. To offset this discontinuity in the potential, -the energy value at $r_{\text{cut}}$ is subtracted from the -potential. This causes the potential to go to zero smoothly at the -cut-off radius, and preserves conservation of energy in integrating -the equations of motion. There still remains a discontinuity in the derivative (the forces), however, this does not significantly affect the dynamics. - Interactions between dissimilar particles requires the generation of -cross term parameters for $\sigma$ and $\epsilon$. These are -calculated through the Lorentz-Berthelot mixing +cross term parameters for $\sigma$ and $\epsilon$. These parameters +are determined using the Lorentz-Berthelot mixing rules:\cite{allen87:csl} \begin{equation} \sigma_{ij} = \frac{1}{2}[\sigma_{ii} + \sigma_{jj}], @@ -271,64 +756,68 @@ simulate lipid bilayers. The simulations require a mod \subsection{\label{oopseSec:DUFF}Dipolar Unified-Atom Force Field} The dipolar unified-atom force field ({\sc duff}) was developed to -simulate lipid bilayers. The simulations require a model capable of -forming bilayers, while still being sufficiently computationally -efficient to allow large systems ($\sim$100's of phospholipids, -$\sim$1000's of waters) to be simulated for long times -($\sim$10's of nanoseconds). +simulate lipid bilayers. These types of simulations require a model +capable of forming bilayers, while still being sufficiently +computationally efficient to allow large systems ($\sim$100's of +phospholipids, $\sim$1000's of waters) to be simulated for long times +($\sim$10's of nanoseconds). With this goal in mind, {\sc duff} has no +point charges. Charge-neutral distributions are replaced with dipoles, +while most atoms and groups of atoms are reduced to Lennard-Jones +interaction sites. This simplification reduces the length scale of +long range interactions from $\frac{1}{r}$ to $\frac{1}{r^3}$, +removing the need for the computationally expensive Ewald +sum. Instead, Verlet neighbor-lists and cutoff radii are used for the +dipolar interactions, and, if desired, a reaction field may be added +to mimic longer range interactions. -With this goal in mind, {\sc duff} has no point -charges. Charge-neutral distributions were replaced with dipoles, -while most atoms and groups of atoms were reduced to Lennard-Jones -interaction sites. This simplification cuts the length scale of long -range interactions from $\frac{1}{r}$ to $\frac{1}{r^3}$, and allows -us to avoid the computationally expensive Ewald sum. Instead, we can -use neighbor-lists and cutoff radii for the dipolar interactions, or -include a reaction field to mimic larger range interactions. - As an example, lipid head-groups in {\sc duff} are represented as -point dipole interaction sites. By placing a dipole at the head -group's center of mass, our model mimics the charge separation found -in common phospholipid head groups such as -phosphatidylcholine.\cite{Cevc87} Additionally, a large Lennard-Jones -site is located at the pseudoatom's center of mass. The model is -illustrated by the red atom in Fig.~\ref{oopseFig:lipidModel}. The -water model we use to complement the dipoles of the lipids is our -reparameterization of the soft sticky dipole (SSD) model of Ichiye +point dipole interaction sites. Placing a dipole at the head group's +center of mass mimics the charge separation found in common +phospholipid head groups such as phosphatidylcholine.\cite{Cevc87} +Additionally, a large Lennard-Jones site is located at the +pseudoatom's center of mass. The model is illustrated by the red atom +in Fig.~\ref{oopseFig:lipidModel}. The water model we use to +complement the dipoles of the lipids is a +reparameterization\cite{fennell04} of the soft sticky dipole (SSD) +model of Ichiye \emph{et al.}\cite{liu96:new_model} \begin{figure} \centering -\includegraphics[width=\linewidth]{twoChainFig.pdf} -\caption[A representation of a lipid model in {\sc duff}]{A representation of the lipid model. $\phi$ is the torsion angle, $\theta$ % -is the bend angle, and $\mu$ is the dipole moment of the head group.} +\includegraphics[width=\linewidth]{lipidModel.eps} +\caption[A representation of a lipid model in {\sc duff}]{A +representation of the lipid model. $\phi$ is the torsion angle, +$\theta$ is the bend angle, and $\mu$ is the dipole moment of the head +group.} \label{oopseFig:lipidModel} \end{figure} -We have used a set of scalable parameters to model the alkyl groups -with Lennard-Jones sites. For this, we have borrowed parameters from -the TraPPE force field of Siepmann -\emph{et al}.\cite{Siepmann1998} TraPPE is a unified-atom -representation of n-alkanes, which is parametrized against phase -equilibria using Gibbs ensemble Monte Carlo simulation -techniques.\cite{Siepmann1998} One of the advantages of TraPPE is that -it generalizes the types of atoms in an alkyl chain to keep the number -of pseudoatoms to a minimum; the parameters for a unified atom such as -$\text{CH}_2$ do not change depending on what species are bonded to -it. +A set of scalable parameters has been used to model the alkyl groups +with Lennard-Jones sites. For this, parameters from the TraPPE force +field of Siepmann \emph{et al.}\cite{Siepmann1998} have been +utilized. TraPPE is a unified-atom representation of n-alkanes which +is parametrized against phase equilibria using Gibbs ensemble Monte +Carlo simulation techniques.\cite{Siepmann1998} One of the advantages +of TraPPE is that it generalizes the types of atoms in an alkyl chain +to keep the number of pseudoatoms to a minimum; thus, the parameters +for a unified atom such as $\text{CH}_2$ do not change depending on +what species are bonded to it. -TraPPE also constrains all bonds to be of fixed length. Typically, -bond vibrations are the fastest motions in a molecular dynamic -simulation. Small time steps between force evaluations must be used to -ensure adequate energy conservation in the bond degrees of freedom. By -constraining the bond lengths, larger time steps may be used when -integrating the equations of motion. A simulation using {\sc duff} is -illustrated in Scheme \ref{sch:DUFF}. +As is required by TraPPE, {\sc duff} also constrains all bonds to be +of fixed length. Typically, bond vibrations are the fastest motions in +a molecular dynamic simulation. With these vibrations present, small +time steps between force evaluations must be used to ensure adequate +energy conservation in the bond degrees of freedom. By constraining +the bond lengths, larger time steps may be used when integrating the +equations of motion. A simulation using {\sc duff} is illustrated in +Scheme \ref{sch:DUFF}. -\begin{lstlisting}[float,caption={[Invocation of {\sc duff}]A portion of a \texttt{.bass} file showing a simulation utilizing {\sc duff}},label={sch:DUFF}] +\begin{lstlisting}[float,caption={[Invocation of {\sc duff}]A portion +of a meta-data file showing a simulation utilizing {\sc +duff}},label={sch:DUFF}] -#include "water.mdl" -#include "lipid.mdl" +#include "water.md" +#include "lipid.md" nComponents = 2; component{ @@ -341,13 +830,13 @@ initialConfig = "bilayer.init"; nMol = 1936; } -initialConfig = "bilayer.init"; +initialConfig = "bilayer.in"; forceField = "DUFF"; \end{lstlisting} -\subsection{\label{oopseSec:energyFunctions}{\sc duff} Energy Functions} +\subsubsection{\label{oopseSec:energyFunctions}{\sc duff} Energy Functions} The total potential energy function in {\sc duff} is \begin{equation} @@ -367,14 +856,16 @@ within the molecule $I$, and $V_{\text{torsion}}$ is t \label{eq:internalPotential} \end{equation} Here $V_{\text{bend}}$ is the bend potential for all 1, 3 bonded pairs -within the molecule $I$, and $V_{\text{torsion}}$ is the torsion potential -for all 1, 4 bonded pairs. The pairwise portions of the internal -potential are excluded for atom pairs that are involved in the same bond, bend, or torsion. All other atom pairs within the molecule are subject to the LJ pair potential. +within the molecule $I$, and $V_{\text{torsion}}$ is the torsion +potential for all 1, 4 bonded pairs. The pairwise portions of the +non-bonded interactions are excluded for atom pairs that are involved +in the smae bond, bend, or torsion. All other atom pairs within a +molecule are subject to the LJ pair potential. - The bend potential of a molecule is represented by the following function: \begin{equation} -V_{\text{bend}}(\theta_{ijk}) = k_{\theta}( \theta_{ijk} - \theta_0 )^2, \label{eq:bendPot} +V_{\text{bend}}(\theta_{ijk}) = k_{\theta}( \theta_{ijk} - \theta_0 +)^2, \label{eq:bendPot} \end{equation} where $\theta_{ijk}$ is the angle defined by atoms $i$, $j$, and $k$ (see Fig.~\ref{oopseFig:lipidModel}), $\theta_0$ is the equilibrium @@ -414,11 +905,12 @@ evaluations are avoided during the calculation of the k_3 &= 4c_3. \end{align*} By recasting the potential as a power series, repeated trigonometric -evaluations are avoided during the calculation of the potential energy. +evaluations are avoided during the calculation of the potential +energy. -The cross potential between molecules $I$ and $J$, $V^{IJ}_{\text{Cross}}$, is -as follows: +The cross potential between molecules $I$ and $J$, +$V^{IJ}_{\text{Cross}}$, is as follows: \begin{equation} V^{IJ}_{\text{Cross}} = \sum_{i \in I} \sum_{j \in J} @@ -448,36 +940,15 @@ respectively. $|\mu_i|$ is the magnitude of the dipole Here $\mathbf{r}_{ij}$ is the vector starting at atom $i$ pointing towards $j$, and $\boldsymbol{\Omega}_i$ and $\boldsymbol{\Omega}_j$ are the orientational degrees of freedom for atoms $i$ and $j$ -respectively. $|\mu_i|$ is the magnitude of the dipole moment of atom -$i$, $\boldsymbol{\hat{u}}_i$ is the standard unit orientation vector -of $\boldsymbol{\Omega}_i$, and $\boldsymbol{\hat{r}}_{ij}$ is the -unit vector pointing along $\mathbf{r}_{ij}$ +respectively. The magnitude of the dipole moment of atom $i$ is +$|\mu_i|$, $\boldsymbol{\hat{u}}_i$ is the standard unit orientation +vector of $\boldsymbol{\Omega}_i$, and $\boldsymbol{\hat{r}}_{ij}$ is +the unit vector pointing along $\mathbf{r}_{ij}$ ($\boldsymbol{\hat{r}}_{ij}=\mathbf{r}_{ij}/|\mathbf{r}_{ij}|$). -To improve computational efficiency of the dipole-dipole interactions, -{\sc oopse} employs an electrostatic cutoff radius. This parameter can -be set in the \texttt{.bass} file, and controls the length scale over -which dipole interactions are felt. To compensate for the -discontinuity in the potential and the forces at the cutoff radius, we -have implemented a switching function to smoothly scale the -dipole-dipole interaction at the cutoff. -\begin{equation} -S(r_{ij}) = - \begin{cases} - 1 & \text{if $r_{ij} \le r_t$},\\ - \frac{(r_{\text{cut}} + 2r_{ij} - 3r_t)(r_{\text{cut}} - r_{ij})^2} - {(r_{\text{cut}} - r_t)^2} - & \text{if $r_t < r_{ij} \le r_{\text{cut}}$}, \\ - 0 & \text{if $r_{ij} > r_{\text{cut}}$.} - \end{cases} -\label{eq:dipoleSwitching} -\end{equation} -Here $S(r_{ij})$ scales the potential at a given $r_{ij}$, and $r_t$ -is the taper radius some given thickness less than the electrostatic -cutoff. The switching thickness can be set in the \texttt{.bass} file. +\subsubsection{\label{oopseSec:SSD}The {\sc duff} Water Models: SSD/E +and SSD/RF} -\subsection{\label{oopseSec:SSD}The {\sc duff} Water Models: SSD/E and SSD/RF} - In the interest of computational efficiency, the default solvent used by {\sc oopse} is the extended Soft Sticky Dipole (SSD/E) water model.\cite{fennell04} The original SSD was developed by Ichiye @@ -536,21 +1007,33 @@ Since SSD/E is a single-point {\it dipolar} model, the can be found in the original SSD articles.\cite{liu96:new_model,liu96:monte_carlo,chandra99:ssd_md,Ichiye03} +\begin{figure} +\centering +\includegraphics[width=\linewidth]{waterAngle.eps} +\caption[Coordinate definition for the SSD/E water model]{Coordinates +for the interaction between two SSD/E water molecules. $\theta_{ij}$ +is the angle that $r_{ij}$ makes with the $\hat{z}$ vector in the +body-fixed frame for molecule $i$. The $\hat{z}$ vector bisects the +HOH angle in each water molecule. } +\label{oopseFig:ssd} +\end{figure} + + Since SSD/E is a single-point {\it dipolar} model, the force calculations are simplified significantly relative to the standard {\it charged} multi-point models. In the original Monte Carlo simulations using this model, Ichiye {\it et al.} reported that using SSD decreased computer time by a factor of 6-7 compared to other -models.\cite{liu96:new_model} What is most impressive is that these savings -did not come at the expense of accurate depiction of the liquid state -properties. Indeed, SSD/E maintains reasonable agreement with the Head-Gordon -diffraction data for the structural features of liquid -water.\cite{hura00,liu96:new_model} Additionally, the dynamical properties -exhibited by SSD/E agree with experiment better than those of more -computationally expensive models (like TIP3P and -SPC/E).\cite{chandra99:ssd_md} The combination of speed and accurate depiction -of solvent properties makes SSD/E a very attractive model for the -simulation of large scale biochemical simulations. +models.\cite{liu96:new_model} What is most impressive is that these +savings did not come at the expense of accurate depiction of the +liquid state properties. Indeed, SSD/E maintains reasonable agreement +with the Head-Gordon diffraction data for the structural features of +liquid water.\cite{hura00,liu96:new_model} Additionally, the dynamical +properties exhibited by SSD/E agree with experiment better than those +of more computationally expensive models (like TIP3P and +SPC/E).\cite{chandra99:ssd_md} The combination of speed and accurate +depiction of solvent properties makes SSD/E a very attractive model +for the simulation of large scale biochemical simulations. Recent constant pressure simulations revealed issues in the original SSD model that led to lower than expected densities at all target @@ -559,296 +1042,154 @@ model (an SSD variant parameterized for reaction fiel exhibits improved liquid structure and transport behavior. If the use of a reaction field long-range interaction correction is desired, it is recommended that the parameters be modified to those of the SSD/RF -model (an SSD variant parameterized for reaction field). Solvent parameters can be easily modified in an accompanying -\texttt{.bass} file as illustrated in the scheme below. A table of the -parameter values and the drawbacks and benefits of the different -density corrected SSD models can be found in -reference~\cite{fennell04}. - -\begin{lstlisting}[float,caption={[A simulation of {\sc ssd} water]A portion of a \texttt{.bass} file showing a simulation including {\sc ssd} water.},label={sch:ssd}] - -#include "water.mdl" - -nComponents = 1; -component{ - type = "SSD_water"; - nMol = 864; -} - -initialConfig = "liquidWater.init"; +model (an SSD variant parameterized for reaction field). These solvent +parameters are listed and can be easily modified in the {\sc duff} +force field file ({\tt DUFF.frc}). A table of the parameter values +and the drawbacks and benefits of the different density corrected SSD +models can be found in reference~\citen{fennell04}. -forceField = "DUFF"; - -/* - * The following two flags set the cutoff - * radius for the electrostatic forces - * as well as the skin thickness of the switching - * function. - */ - -electrostaticCutoffRadius = 9.2; -electrostaticSkinThickness = 1.38; - -\end{lstlisting} - - \subsection{\label{oopseSec:eam}Embedded Atom Method} -There are Molecular Dynamics packages which have the -capacity to simulate metallic systems, including some that have -parallel computational abilities\cite{plimpton93}. Potentials that -describe bonding transition metal -systems\cite{Finnis84,Ercolessi88,Chen90,Qi99,Ercolessi02} have an -attractive interaction which models ``Embedding'' -a positively charged metal ion in the electron density due to the +{\sc oopse} implements a potential that describes bonding in +transition metal +systems.~\cite{Finnis84,Ercolessi88,Chen90,Qi99,Ercolessi02} This +potential has an attractive interaction which models ``Embedding'' a +positively charged pseudo-atom core in the electron density due to the free valance ``sea'' of electrons created by the surrounding atoms in -the system. A mostly-repulsive pairwise part of the potential -describes the interaction of the positively charged metal core ions -with one another. A particular potential description called the -Embedded Atom Method\cite{Daw84,FBD86,johnson89,Lu97}({\sc eam}) that has -particularly wide adoption has been selected for inclusion in {\sc oopse}. A -good review of {\sc eam} and other metallic potential formulations was written -by Voter.\cite{voter} +the system. A pairwise part of the potential (which is primarily +repulsive) describes the interaction of the positively charged metal +core ions with one another. The Embedded Atom Method ({\sc +eam})~\cite{Daw84,FBD86,johnson89,Lu97} has been widely adopted in the +materials science community and has been included in {\sc oopse}. A +good review of {\sc eam} and other formulations of metallic potentials +was given by Voter.\cite{Voter:95} The {\sc eam} potential has the form: -\begin{eqnarray} -V & = & \sum_{i} F_{i}\left[\rho_{i}\right] + \sum_{i} \sum_{j \neq i} -\phi_{ij}({\bf r}_{ij}), \\ -\rho_{i} & = & \sum_{j \neq i} f_{j}({\bf r}_{ij}), -\end{eqnarray} -where $F_{i} $ is the embedding function that equates the energy +\begin{equation} +V = \sum_{i} F_{i}\left[\rho_{i}\right] + \sum_{i} \sum_{j \neq i} +\phi_{ij}({\bf r}_{ij}) +\end{equation} +where $F_{i} $ is an embedding functional that approximates the energy required to embed a positively-charged core ion $i$ into a linear superposition of spherically averaged atomic electron densities given -by $\rho_{i}$. $\phi_{ij}$ is a primarily repulsive pairwise -interaction between atoms $i$ and $j$. In the original formulation of -{\sc eam}\cite{Daw84}, $\phi_{ij}$ was an entirely repulsive term, -however in later refinements to {\sc eam} have shown that non-uniqueness -between $F$ and $\phi$ allow for more general forms for -$\phi$.\cite{Daw89} There is a cutoff distance, $r_{cut}$, which -limits the summations in the {\sc eam} equation to the few dozen atoms -surrounding atom $i$ for both the density $\rho$ and pairwise $\phi$ -interactions. Foiles \emph{et al}.~fit {\sc eam} potentials for the fcc -metals Cu, Ag, Au, Ni, Pd, Pt and alloys of these metals.\cite{FBD86} -These fits are included in {\sc oopse}. - -\subsection{\label{oopseSec:pbc}Periodic Boundary Conditions} - -\newcommand{\roundme}{\operatorname{round}} - -\textit{Periodic boundary conditions} are widely used to simulate bulk properties with a relatively small number of particles. The -simulation box is replicated throughout space to form an infinite -lattice. During the simulation, when a particle moves in the primary -cell, its image in other cells move in exactly the same direction with -exactly the same orientation. Thus, as a particle leaves the primary -cell, one of its images will enter through the opposite face. If the -simulation box is large enough to avoid ``feeling'' the symmetries of -the periodic lattice, surface effects can be ignored. The available -periodic cells in OOPSE are cubic, orthorhombic and parallelepiped. We -use a $3 \times 3$ matrix, $\mathsf{H}$, to describe the shape and -size of the simulation box. $\mathsf{H}$ is defined: +by $\rho_{i}$, \begin{equation} -\mathsf{H} = ( \mathbf{h}_x, \mathbf{h}_y, \mathbf{h}_z ), +\rho_{i} = \sum_{j \neq i} f_{j}({\bf r}_{ij}), \end{equation} -where $\mathbf{h}_{\alpha}$ is the column vector of the $\alpha$ axis of the -box. During the course of the simulation both the size and shape of -the box can be changed to allow volume fluctuations when constraining -the pressure. +Since the density at site $i$ ($\rho_i$) must be computed before the +embedding functional can be evaluated, {\sc eam} and the related +transition metal potentials require two loops through the atom pairs +to compute the inter-atomic forces. -A real space vector, $\mathbf{r}$ can be transformed in to a box space -vector, $\mathbf{s}$, and back through the following transformations: -\begin{align} -\mathbf{s} &= \mathsf{H}^{-1} \mathbf{r}, \\ -\mathbf{r} &= \mathsf{H} \mathbf{s}. -\end{align} -The vector $\mathbf{s}$ is now a vector expressed as the number of box -lengths in the $\mathbf{h}_x$, $\mathbf{h}_y$, and $\mathbf{h}_z$ -directions. To find the minimum image of a vector $\mathbf{r}$, we -first convert it to its corresponding vector in box space, and then, -cast each element to lie in the range $[-0.5,0.5]$: -\begin{equation} -s_{i}^{\prime}=s_{i}-\roundme(s_{i}), -\end{equation} -where $s_i$ is the $i$th element of $\mathbf{s}$, and -$\roundme(s_i)$ is given by -\begin{equation} -\roundme(x) = - \begin{cases} - \lfloor x+0.5 \rfloor & \text{if $x \ge 0$,} \\ - \lceil x-0.5 \rceil & \text{if $x < 0$.} - \end{cases} -\end{equation} -Here $\lfloor x \rfloor$ is the floor operator, and gives the largest -integer value that is not greater than $x$, and $\lceil x \rceil$ is -the ceiling operator, and gives the smallest integer that is not less -than $x$. For example, $\roundme(3.6)=4$, $\roundme(3.1)=3$, -$\roundme(-3.6)=-4$, $\roundme(-3.1)=-3$. +The pairwise portion of the potential, $\phi_{ij}$, is a primarily +repulsive interaction between atoms $i$ and $j$. In the original +formulation of {\sc eam}\cite{Daw84}, $\phi_{ij}$ was an entirely +repulsive term; however later refinements to {\sc eam} allowed for +more general forms for $\phi$.\cite{Daw89} The effective cutoff +distance, $r_{{\text cut}}$ is the distance at which the values of +$f(r)$ and $\phi(r)$ drop to zero for all atoms present in the +simulation. In practice, this distance is fairly small, limiting the +summations in the {\sc eam} equation to the few dozen atoms +surrounding atom $i$ for both the density $\rho$ and pairwise $\phi$ +interactions. -Finally, we obtain the minimum image coordinates $\mathbf{r}^{\prime}$ by -transforming back to real space, -\begin{equation} -\mathbf{r}^{\prime}=\mathsf{H}^{-1}\mathbf{s}^{\prime}.% -\end{equation} -In this way, particles are allowed to diffuse freely in $\mathbf{r}$, -but their minimum images, $\mathbf{r}^{\prime}$ are used to compute -the inter-atomic forces. +In computing forces for alloys, mixing rules as outlined by +Johnson~\cite{johnson89} are used to compute the heterogenous pair +potential, +\begin{eqnarray} +\label{eq:johnson} +\phi_{ab}(r)=\frac{1}{2}\left( +\frac{f_{b}(r)}{f_{a}(r)}\phi_{aa}(r)+ +\frac{f_{a}(r)}{f_{b}(r)}\phi_{bb}(r) +\right). +\end{eqnarray} +No mixing rule is needed for the densities, since the density at site +$i$ is simply the linear sum of density contributions of all the other +atoms. +The {\sc eam} force field illustrates an additional feature of {\sc +oopse}. Foiles, Baskes and Daw fit {\sc eam} potentials for Cu, Ag, +Au, Ni, Pd, Pt and alloys of these metals.\cite{FBD86} These fits are +included in {\sc oopse} as the {\tt u3} variant of the {\sc eam} force +field. Voter and Chen reparamaterized a set of {\sc eam} functions +which do a better job of predicting melting points.\cite{Voter:87} +These functions are included in {\sc oopse} as the {\tt VC} variant of +the {\sc eam} force field. An additional set of functions (the +``Universal 6'' functions) are included in {\sc oopse} as the {\tt u6} +variant of {\sc eam}. For example, to specify the Voter-Chen variant +of the {\sc eam} force field, the user would add the {\tt +forceFieldVariant = "VC";} line to the meta-data file. -\section{\label{oopseSec:IOfiles}Input and Output Files} +The potential files used by the {\sc eam} force field are in the +standard {\tt funcfl} format, which is the format utilized by a number +of other codes (e.g. ParaDyn~\cite{Paradyn}, {\sc dynamo 86}). It +should be noted that the energy units in these files are in eV, not +$\mbox{kcal mol}^{-1}$ as in the rest of the {\sc oopse} force field +files. -\subsection{{\sc bass} and Model Files} +\subsection{\label{oopseSec:pbc}Periodic Boundary Conditions} -Every {\sc oopse} simulation begins with a Bizarre Atom Simulation -Syntax ({\sc bass}) file. {\sc bass} is a script syntax that is parsed -by {\sc oopse} at runtime. The {\sc bass} file allows for the user to -completely describe the system they wish to simulate, as well as tailor -{\sc oopse}'s behavior during the simulation. {\sc bass} files are -denoted with the extension -\texttt{.bass}, an example file is shown in -Scheme~\ref{sch:bassExample}. +\newcommand{\roundme}{\operatorname{round}} -\begin{lstlisting}[float,caption={[An example of a complete {\sc bass} file] An example showing a complete {\sc bass} file.},label={sch:bassExample}] - -molecule{ - name = "Ar"; - nAtoms = 1; - atom[0]{ - type="Ar"; - position( 0.0, 0.0, 0.0 ); - } -} - -nComponents = 1; -component{ - type = "Ar"; - nMol = 108; -} - -initialConfig = "./argon.init"; - -forceField = "LJ"; -ensemble = "NVE"; // specify the simulation ensemble -dt = 1.0; // the time step for integration -runTime = 1e3; // the total simulation run time -sampleTime = 100; // trajectory file frequency -statusTime = 50; // statistics file frequency - -\end{lstlisting} - -Within the \texttt{.bass} file it is necessary to provide a complete -description of the molecule before it is actually placed in the -simulation. The {\sc bass} syntax was originally developed with this -goal in mind, and allows for the specification of all the atoms in a -molecular prototype, as well as any bonds, bends, or torsions. These -descriptions can become lengthy for complex molecules, and it would be -inconvenient to duplicate the simulation at the beginning of each {\sc -bass} script. Addressing this issue {\sc bass} allows for the -inclusion of model files at the top of a \texttt{.bass} file. These -model files, denoted with the \texttt{.mdl} extension, allow the user -to describe a molecular prototype once, then simply include it into -each simulation containing that molecule. Returning to the example in -Scheme~\ref{sch:bassExample}, the \texttt{.mdl} file's contents would -be Scheme~\ref{sch:mdlExample}, and the new \texttt{.bass} file would -become Scheme~\ref{sch:bassExPrime}. - -\begin{lstlisting}[float,caption={An example \texttt{.mdl} file.},label={sch:mdlExample}] - -molecule{ - name = "Ar"; - nAtoms = 1; - atom[0]{ - type="Ar"; - position( 0.0, 0.0, 0.0 ); - } -} - -\end{lstlisting} - -\begin{lstlisting}[float,caption={Revised {\sc bass} example.},label={sch:bassExPrime}] - -#include "argon.mdl" - -nComponents = 1; -component{ - type = "Ar"; - nMol = 108; -} - -initialConfig = "./argon.init"; - -forceField = "LJ"; -ensemble = "NVE"; -dt = 1.0; -runTime = 1e3; -sampleTime = 100; -statusTime = 50; - -\end{lstlisting} - -\subsection{\label{oopseSec:coordFiles}Coordinate Files} - -The standard format for storage of a systems coordinates is a modified -xyz-file syntax, the exact details of which can be seen in -Scheme~\ref{sch:dumpFormat}. As all bonding and molecular information -is stored in the \texttt{.bass} and \texttt{.mdl} files, the -coordinate files are simply the complete set of coordinates for each -atom at a given simulation time. One important note, although the -simulation propagates the complete rotation matrix, directional -entities are written out using quanternions, to save space in the -output files. - -\begin{lstlisting}[float,caption={[The format of the coordinate files]Shows the format of the coordinate files. The fist line is the number of atoms. The second line begins with the time stamp followed by the three $\mathsf{H}$ column vectors. It is important to note, that for extended system ensembles, additional information pertinent to the integrators may be stored on this line as well. The next lines are the atomic coordinates for all atoms in the system. First is the name followed by position, velocity, quanternions, and lastly angular velocities.},label=sch:dumpFormat] - -nAtoms -time; Hxx Hyx Hzx; Hxy Hyy Hzy; Hxz Hyz Hzz; -Name1 x y z vx vy vz q0 q1 q2 q3 jx jy jz -Name2 x y z vx vy vz q0 q1 q2 q3 jx jy jz -etc... - -\end{lstlisting} +\textit{Periodic boundary conditions} are widely used to simulate bulk +properties with a relatively small number of particles. In this method +the simulation box is replicated throughout space to form an infinite +lattice. During the simulation, when a particle moves in the primary +cell, its image in other cells move in exactly the same direction with +exactly the same orientation. Thus, as a particle leaves the primary +cell, one of its images will enter through the opposite face. If the +simulation box is large enough to avoid ``feeling'' the symmetries of +the periodic lattice, surface effects can be ignored. The available +periodic cells in {\sc oopse} are cubic, orthorhombic and +parallelepiped. {\sc oopse} use a $3 \times 3$ matrix, $\mathsf{H}$, +to describe the shape and size of the simulation box. $\mathsf{H}$ is +defined: +\begin{equation} +\mathsf{H} = ( \mathbf{h}_x, \mathbf{h}_y, \mathbf{h}_z ), +\end{equation} +where $\mathbf{h}_{\alpha}$ is the column vector of the $\alpha$ axis of the +box. During the course of the simulation both the size and shape of +the box can be changed to allow volume fluctuations when constraining +the pressure. - -There are three major files used by {\sc oopse} written in the -coordinate format, they are as follows: the initialization file -(\texttt{.init}), the simulation trajectory file (\texttt{.dump}), and -the final coordinates of the simulation. The initialization file is -necessary for {\sc oopse} to start the simulation with the proper -coordinates, and is generated before the simulation run. The -trajectory file is created at the beginning of the simulation, and is -used to store snapshots of the simulation at regular intervals. The -first frame is a duplication of the -\texttt{.init} file, and each subsequent frame is appended to the file -at an interval specified in the \texttt{.bass} file with the -\texttt{sampleTime} flag. The final coordinate file is the end of run file. The -\texttt{.eor} file stores the final configuration of the system for a -given simulation. The file is updated at the same time as the -\texttt{.dump} file, however, it only contains the most recent -frame. In this way, an \texttt{.eor} file may be used as the -initialization file to a second simulation in order to continue a -simulation or recover one from a processor that has crashed during the -course of the run. - -\subsection{\label{oopseSec:initCoords}Generation of Initial Coordinates} +A real space vector, $\mathbf{r}$ can be transformed in to a box space +vector, $\mathbf{s}$, and back through the following transformations: +\begin{align} +\mathbf{s} &= \mathsf{H}^{-1} \mathbf{r}, \\ +\mathbf{r} &= \mathsf{H} \mathbf{s}. +\end{align} +The vector $\mathbf{s}$ is now a vector expressed as the number of box +lengths in the $\mathbf{h}_x$, $\mathbf{h}_y$, and $\mathbf{h}_z$ +directions. To find the minimum image of a vector $\mathbf{r}$, {\sc +oopse} first converts it to its corresponding vector in box space, and +then casts each element to lie in the range $[-0.5,0.5]$: +\begin{equation} +s_{i}^{\prime}=s_{i}-\roundme(s_{i}), +\end{equation} +where $s_i$ is the $i$th element of $\mathbf{s}$, and +$\roundme(s_i)$ is given by +\begin{equation} +\roundme(x) = + \begin{cases} + \lfloor x+0.5 \rfloor & \text{if $x \ge 0$,} \\ + \lceil x-0.5 \rceil & \text{if $x < 0$.} + \end{cases} +\end{equation} +Here $\lfloor x \rfloor$ is the floor operator, and gives the largest +integer value that is not greater than $x$, and $\lceil x \rceil$ is +the ceiling operator, and gives the smallest integer that is not less +than $x$. -As was stated in Sec.~\ref{oopseSec:coordFiles}, an initialization -file is needed to provide the starting coordinates for a -simulation. The {\sc oopse} package provides several system building -programs to aid in the creation of the \texttt{.init} -file. The programs use {\sc bass}, and will recognize -arguments and parameters in the \texttt{.bass} file that would -otherwise be ignored by the simulation. +Finally, the minimum image coordinates $\mathbf{r}^{\prime}$ are +obtained by transforming back to real space, +\begin{equation} +\mathbf{r}^{\prime}=\mathsf{H}^{-1}\mathbf{s}^{\prime}.% +\end{equation} +In this way, particles are allowed to diffuse freely in $\mathbf{r}$, +but their minimum images, or $\mathbf{r}^{\prime}$, are used to compute +the inter-atomic forces. -\subsection{The Statistics File} -The last output file generated by {\sc oopse} is the statistics -file. This file records such statistical quantities as the -instantaneous temperature, volume, pressure, etc. It is written out -with the frequency specified in the \texttt{.bass} file with the -\texttt{statusTime} keyword. The file allows the user to observe the -system variables as a function of simulation time while the simulation -is in progress. One useful function the statistics file serves is to -monitor the conserved quantity of a given simulation ensemble, this -allows the user to observe the stability of the integrator. The -statistics file is denoted with the \texttt{.stat} file extension. \section{\label{oopseSec:mechanics}Mechanics} @@ -866,18 +1207,16 @@ motion for $\phi$ and $\psi$,\cite{allen87:csl} leadin Previous integration methods for orientational motion have problems that are avoided in the DLM method. Direct propagation of the Euler angles has a known $1/\sin\theta$ divergence in the equations of -motion for $\phi$ and $\psi$,\cite{allen87:csl} leading to -numerical instabilities any time one of the directional atoms or rigid -bodies has an orientation near $\theta=0$ or $\theta=\pi$. More -modern quaternion-based integration methods have relatively poor -energy conservation. While quaternions work well for orientational -motion in other ensembles, the microcanonical ensemble has a -constant energy requirement that is quite sensitive to errors in the -equations of motion. An earlier implementation of {\sc oopse} -utilized quaternions for propagation of rotational motion; however, a -detailed investigation showed that they resulted in a steady drift in -the total energy, something that has been observed by -Laird {\it et al.}\cite{Laird97} +motion for $\phi$ and $\psi$,\cite{allen87:csl} leading to numerical +instabilities any time one of the directional atoms or rigid bodies +has an orientation near $\theta=0$ or $\theta=\pi$. Quaternion-based +integration methods work well for propagating orientational motion; +however, energy conservation concerns arise when using the +microcanonical (NVE) ensemble. An earlier implementation of {\sc +oopse} utilized quaternions for propagation of rotational motion; +however, a detailed investigation showed that they resulted in a +steady drift in the total energy, something that has been observed by +Laird {\it et al.}\cite{Laird97} The key difference in the integration method proposed by Dullweber \emph{et al.} is that the entire $3 \times 3$ rotation matrix is @@ -951,12 +1290,12 @@ is equivalent to the more familiar body-fixed forms, represented by ${\bf j}$. This equation of motion for angular momenta is equivalent to the more familiar body-fixed forms, \begin{eqnarray} -\dot{j_{x}} & = & \tau^b_x(t) + -\left(\overleftrightarrow{\mathsf{I}}_{yy} - \overleftrightarrow{\mathsf{I}}_{zz} \right) j_y j_z, \\ -\dot{j_{y}} & = & \tau^b_y(t) + -\left(\overleftrightarrow{\mathsf{I}}_{zz} - \overleftrightarrow{\mathsf{I}}_{xx} \right) j_z j_x,\\ -\dot{j_{z}} & = & \tau^b_z(t) + -\left(\overleftrightarrow{\mathsf{I}}_{xx} - \overleftrightarrow{\mathsf{I}}_{yy} \right) j_x j_y, +\dot{j_{x}} & = & \tau^b_x(t) - +\left(\overleftrightarrow{\mathsf{I}}_{yy}^{-1} - \overleftrightarrow{\mathsf{I}}_{zz}^{-1} \right) j_y j_z, \\ +\dot{j_{y}} & = & \tau^b_y(t) - +\left(\overleftrightarrow{\mathsf{I}}_{zz}^{-1} - \overleftrightarrow{\mathsf{I}}_{xx}^{-1} \right) j_z j_x,\\ +\dot{j_{z}} & = & \tau^b_z(t) - +\left(\overleftrightarrow{\mathsf{I}}_{xx}^{-1} - \overleftrightarrow{\mathsf{I}}_{yy}^{-1} \right) j_x j_y, \end{eqnarray} which utilize the body-fixed torques, ${\bf \tau}^b$. Torques are most easily derived in the space-fixed frame, @@ -1078,7 +1417,7 @@ Fig.~\ref{timestep}. \begin{figure} \centering -\includegraphics[width=\linewidth]{timeStep.pdf} +\includegraphics[width=\linewidth]{timeStep.eps} \caption[Energy conservation for quaternion versus DLM dynamics]{Energy conservation using quaternion based integration versus the method proposed by Dullweber \emph{et al.} with increasing time step. For each time step, the dotted line is total energy using the @@ -1106,7 +1445,7 @@ and that is the time step for integrating the equation \begin{center} \begin{tabular}{llll} -{\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf +{\bf variable} & {\bf Meta-data keyword} & {\bf units} & {\bf default value} \\ $h$ & {\tt dt = 2.0;} & fs & none \end{tabular} @@ -1116,12 +1455,12 @@ integrator can selected with the {\tt ensemble} keywor {\sc oopse} implements a number of extended system integrators for sampling from other ensembles relevant to chemical physics. The -integrator can selected with the {\tt ensemble} keyword in the -{\tt .bass} file: +integrator can be selected with the {\tt ensemble} keyword in the +meta-data file: \begin{center} \begin{tabular}{lll} -{\bf Integrator} & {\bf Ensemble} & {\bf {\tt .bass} line} \\ +{\bf Integrator} & {\bf Ensemble} & {\bf Meta-data instruction} \\ NVE & microcanonical & {\tt ensemble = NVE; } \\ NVT & canonical & {\tt ensemble = NVT; } \\ NPTi & isobaric-isothermal & {\tt ensemble = NPTi;} \\ @@ -1136,8 +1475,8 @@ system, and has been shown to sample the canonical dis The relatively well-known Nos\'e-Hoover thermostat\cite{Hoover85} is implemented in {\sc oopse}'s NVT integrator. This method couples an extra degree of freedom (the thermostat) to the kinetic energy of the -system, and has been shown to sample the canonical distribution in the -system degrees of freedom while conserving a quantity that is, to +system and it has been shown to sample the canonical distribution in +the system degrees of freedom while conserving a quantity that is, to within a constant, the Helmholtz free energy.\cite{melchionna93} NPT algorithms attempt to maintain constant pressure in the system by @@ -1161,7 +1500,7 @@ variables. \begin{center} \begin{tabular}{llll} -{\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf +{\bf variable} & {\bf Meta-data instruction} & {\bf units} & {\bf default value} \\ $T_{\mathrm{target}}$ & {\tt targetTemperature = 300;} & K & none \\ $P_{\mathrm{target}}$ & {\tt targetPressure = 1;} & atm & none \\ @@ -1219,10 +1558,10 @@ $\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one In eq.(\ref{eq:nosehooverext}), $\tau_T$ is the time constant for relaxation of the temperature to the target value. To set values for $\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one would use the -{\tt tauThermostat} and {\tt targetTemperature} keywords in the {\tt -.bass} file. The units for {\tt tauThermostat} are fs, and the units -for the {\tt targetTemperature} are degrees K. The integration of -the equations of motion is carried out in a velocity-Verlet style 2 +{\tt tauThermostat} and {\tt targetTemperature} keywords in the +meta-data file. The units for {\tt tauThermostat} are fs, and the +units for the {\tt targetTemperature} are degrees K. The integration +of the equations of motion is carried out in a velocity-Verlet style 2 part algorithm: {\tt moveA:} @@ -1284,7 +1623,7 @@ Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are requir \chi(t + h) \right) . \end{align*} -Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required to caclculate +Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required to calculate $T(t + h)$ as well as $\chi(t + h)$, they indirectly depend on their own values at time $t + h$. {\tt moveB} is therefore done in an iterative fashion until $\chi(t + h)$ becomes self-consistent. The @@ -1312,20 +1651,14 @@ To carry out isobaric-isothermal ensemble calculations \subsection{\label{sec:NPTi}Constant-pressure integration with isotropic box deformations (NPTi)} -To carry out isobaric-isothermal ensemble calculations {\sc oopse} +To carry out isobaric-isothermal ensemble calculations, {\sc oopse} implements the Melchionna modifications to the Nos\'e-Hoover-Andersen -equations of motion,\cite{melchionna93} +equations of motion.\cite{melchionna93} The equations of motion are +the same as NVT with the following exceptions: \begin{eqnarray} \dot{{\bf r}} & = & {\bf v} + \eta \left( {\bf r} - {\bf R}_0 \right), \\ \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\eta + \chi) {\bf v}, \\ -\dot{\mathsf{A}} & = & \mathsf{A} \cdot -\mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right),\\ -\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{I}^{-1} -\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial -V}{\partial \mathsf{A}} \right) - \chi {\bf j}, \\ -\dot{\chi} & = & \frac{1}{\tau_{T}^2} \left( -\frac{T}{T_{\mathrm{target}}} - 1 \right) ,\\ \dot{\eta} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V \left( P - P_{\mathrm{target}} \right), \\ \dot{\mathcal{V}} & = & 3 \mathcal{V} \eta . @@ -1352,7 +1685,7 @@ outer} product of the velocities denoted by the $\otim \overleftrightarrow{\mathsf{W}}(t). \end{equation} The kinetic contribution to the pressure tensor utilizes the {\it -outer} product of the velocities denoted by the $\otimes$ symbol. The +outer} product of the velocities, denoted by the $\otimes$ symbol. The stress tensor is calculated from another outer product of the inter-atomic separation vectors (${\bf r}_{ij} = {\bf r}_j - {\bf r}_i$) with the forces between the same two atoms, @@ -1360,8 +1693,21 @@ The instantaneous pressure is then simply obtained fro \overleftrightarrow{\mathsf{W}}(t) = \sum_{i} \sum_{j>i} {\bf r}_{ij}(t) \otimes {\bf f}_{ij}(t). \end{equation} +In systems containing cutoff groups, the stress tensor is computed +between the centers-of-mass of the cutoff groups: +\begin{equation} +\overleftrightarrow{\mathsf{W}}(t) = \sum_{a} \sum_{b} {\bf r}_{ab}(t) +\otimes {\bf f}_{ab}(t). +\end{equation} +where ${\bf r}_{ab}$ is the distance between the centers of mass, and +\begin{equation} +{\bf f}_{ab} = s(r_{ab}) \sum_{i \in a} \sum_{j \in b} {\bf f}_{ij} + +s\prime(r_{ab}) \frac{{\bf r}_{ab}}{|r_{ab}|} \sum_{i \in a} \sum_{j +\in b} V_{ij}({\bf r}_{ij}). +\end{equation} + The instantaneous pressure is then simply obtained from the trace of -the Pressure tensor, +the pressure tensor, \begin{equation} P(t) = \frac{1}{3} \mathrm{Tr} \left( \overleftrightarrow{\mathsf{P}}(t). \right) @@ -1370,34 +1716,20 @@ $\tau_B$ or $P_{\mathrm{target}}$ in a simulation, one In eq.(\ref{eq:melchionna1}), $\tau_B$ is the time constant for relaxation of the pressure to the target value. To set values for $\tau_B$ or $P_{\mathrm{target}}$ in a simulation, one would use the -{\tt tauBarostat} and {\tt targetPressure} keywords in the {\tt .bass} +{\tt tauBarostat} and {\tt targetPressure} keywords in the meta-data file. The units for {\tt tauBarostat} are fs, and the units for the {\tt targetPressure} are atmospheres. Like in the NVT integrator, the integration of the equations of motion is carried out in a -velocity-Verlet style 2 part algorithm: +velocity-Verlet style 2 part algorithm with only the following differences: {\tt moveA:} \begin{align*} -T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\ -% P(t) &\leftarrow \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\} ,\\ % {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) \left(\chi(t) + \eta(t) \right) \right), \\ % -{\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t) - + \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) - \chi(t) \right), \\ -% -\mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left(h * - {\bf j}(t + h / 2) \overleftrightarrow{\mathsf{I}}^{-1} - \right) ,\\ -% -\chi\left(t + h / 2 \right) &\leftarrow \chi(t) + - \frac{h}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 - \right) ,\\ -% \eta(t + h / 2) &\leftarrow \eta(t) + \frac{h \mathcal{V}(t)}{2 N k_B T(t) \tau_B^2} \left( P(t) - P_{\mathrm{target}} \right), \\ @@ -1411,8 +1743,7 @@ Most of these equations are identical to their counter \mathsf{H}(t). \end{align*} -Most of these equations are identical to their counterparts in the NVT -integrator, but the propagation of positions to time $t + h$ +The propagation of positions to time $t + h$ depends on the positions at the same time. {\sc oopse} carries out this step iteratively (with a limit of 5 passes through the iterative loop). Also, the simulation box $\mathsf{H}$ is scaled uniformly for @@ -1421,7 +1752,7 @@ the box by h / 2$. Reshaping the box uniformly also scales the volume of the box by \begin{equation} -\mathcal{V}(t + h) \leftarrow e^{ - 3 h \eta(t + h /2)}. +\mathcal{V}(t + h) \leftarrow e^{ - 3 h \eta(t + h /2)} \times \mathcal{V}(t) \end{equation} @@ -1432,16 +1763,9 @@ T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, {\tt moveB:} \begin{align*} -T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, - \left\{{\bf j}(t + h)\right\} ,\\ -% P(t + h) &\leftarrow \left\{{\bf r}(t + h)\right\}, \left\{{\bf v}(t + h)\right\}, \\ % -\chi\left(t + h \right) &\leftarrow \chi\left(t + h / - 2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+h)} - {T_{\mathrm{target}}} - 1 \right), \\ -% \eta(t + h) &\leftarrow \eta(t + h / 2) + \frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h) \tau_B^2} \left( P(t + h) - P_{\mathrm{target}} \right), \\ @@ -1458,7 +1782,7 @@ to caclculate $T(t + h)$, $P(t + h)$, $\chi(t + h)$, a \end{align*} Once again, since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required -to caclculate $T(t + h)$, $P(t + h)$, $\chi(t + h)$, and $\eta(t + +to calculate $T(t + h)$, $P(t + h)$, $\chi(t + h)$, and $\eta(t + h)$, they indirectly depend on their own values at time $t + h$. {\tt moveB} is therefore done in an iterative fashion until $\chi(t + h)$ and $\eta(t + h)$ become self-consistent. The relative tolerance for @@ -1498,18 +1822,12 @@ the box shape. The equations of motion for this metho {\it shape} as well as in the volume of the box. This method utilizes the full $3 \times 3$ pressure tensor and introduces a tensor of extended variables ($\overleftrightarrow{\eta}$) to control changes to -the box shape. The equations of motion for this method are +the box shape. The equations of motion for this method differ from +those of NPTi as follows: \begin{eqnarray} \dot{{\bf r}} & = & {\bf v} + \overleftrightarrow{\eta} \cdot \left( {\bf r} - {\bf R}_0 \right), \\ \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\overleftrightarrow{\eta} + \chi \cdot \mathsf{1}) {\bf v}, \\ -\dot{\mathsf{A}} & = & \mathsf{A} \cdot -\mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right) ,\\ -\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{I}^{-1} -\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial -V}{\partial \mathsf{A}} \right) - \chi {\bf j} ,\\ -\dot{\chi} & = & \frac{1}{\tau_{T}^2} \left( -\frac{T}{T_{\mathrm{target}}} - 1 \right) ,\\ \dot{\overleftrightarrow{\eta}} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V \left( \overleftrightarrow{\mathsf{P}} - P_{\mathrm{target}}\mathsf{1} \right) ,\\ \dot{\mathsf{H}} & = & \overleftrightarrow{\eta} \cdot \mathsf{H} . @@ -1525,8 +1843,6 @@ T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\b {\tt moveA:} \begin{align*} -T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\ -% \overleftrightarrow{\mathsf{P}}(t) &\leftarrow \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\} ,\\ % @@ -1535,18 +1851,6 @@ T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\b \left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot {\bf v}(t) \right), \\ % -{\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t) - + \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) - \chi(t) \right), \\ -% -\mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left(h * - {\bf j}(t + h / 2) \overleftrightarrow{\mathsf{I}}^{-1} - \right), \\ -% -\chi\left(t + h / 2 \right) &\leftarrow \chi(t) + - \frac{h}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - - 1 \right), \\ -% \overleftrightarrow{\eta}(t + h / 2) &\leftarrow \overleftrightarrow{\eta}(t) + \frac{h \mathcal{V}(t)}{2 N k_B T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t) @@ -1568,17 +1872,10 @@ T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, {\tt moveB:} \begin{align*} -T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, - \left\{{\bf j}(t + h)\right\}, \\ -% \overleftrightarrow{\mathsf{P}}(t + h) &\leftarrow \left\{{\bf r} (t + h)\right\}, \left\{{\bf v}(t + h)\right\}, \left\{{\bf f}(t + h)\right\} ,\\ % -\chi\left(t + h \right) &\leftarrow \chi\left(t + h / - 2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+ - h)}{T_{\mathrm{target}}} - 1 \right), \\ -% \overleftrightarrow{\eta}(t + h) &\leftarrow \overleftrightarrow{\eta}(t + h / 2) + \frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h) @@ -1590,10 +1887,6 @@ T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, \frac{{\bf f}(t + h)}{m} - (\chi(t + h)\mathsf{1} + \overleftrightarrow{\eta}(t + h)) \right) \cdot {\bf v}(t + h), \\ -% -{\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t - + h / 2 \right) + \frac{h}{2} \left( {\bf \tau}^b(t - + h) - {\bf j}(t + h) \chi(t + h) \right) . \end{align*} The iterative schemes for both {\tt moveA} and {\tt moveB} are @@ -1611,10 +1904,9 @@ elongated and sheared geometries which become smaller This integrator must be used with care, particularly in liquid simulations. Liquids have very small restoring forces in the off-diagonal directions, and the simulation box can very quickly form -elongated and sheared geometries which become smaller than the -electrostatic or Lennard-Jones cutoff radii. The NPTf integrator -finds most use in simulating crystals or liquid crystals which assume -non-orthorhombic geometries. +elongated and sheared geometries which become smaller than the cutoff +radius. The NPTf integrator finds most use in simulating crystals or +liquid crystals which assume non-orthorhombic geometries. \subsection{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)} @@ -1637,249 +1929,27 @@ simulations). orientational anisotropy in the system (i.e. in lipid bilayer simulations). -\subsection{\label{oopseSec:rattle}The {\sc rattle} Method for Bond +\subsection{\label{sec:constraints}Constraint Methods} + +\subsubsection{\label{oopseSec:rattle}The {\sc rattle} Method for Bond Constraints} In order to satisfy the constraints of fixed bond lengths within {\sc oopse}, we have implemented the {\sc rattle} algorithm of -Andersen.\cite{andersen83} The algorithm is a velocity verlet -formulation of the {\sc shake} method\cite{ryckaert77} of iteratively -solving the Lagrange multipliers of constraint. The system of Lagrange -multipliers allows one to reformulate the equations of motion with -explicit constraint forces.\cite{fowles99:lagrange} +Andersen.\cite{andersen83} {\sc rattle} is a velocity-Verlet +formulation of the {\sc shake} method\cite{ryckaert77} for iteratively +solving the Lagrange multipliers which maintain the holonomic +constraints. Both methods are covered in depth in the +literature,\cite{leach01:mm,allen87:csl} and a detailed description of +this method would be redundant. -Consider a system described by coordinates $q_1$ and $q_2$ subject to an -equation of constraint: -\begin{equation} -\sigma(q_1, q_2,t) = 0 -\label{oopseEq:lm1} -\end{equation} -The Lagrange formulation of the equations of motion can be written: -\begin{equation} -\delta\int_{t_1}^{t_2}L\, dt = - \int_{t_1}^{t_2} \sum_i \biggl [ \frac{\partial L}{\partial q_i} - - \frac{d}{dt}\biggl(\frac{\partial L}{\partial \dot{q}_i} - \biggr ) \biggr] \delta q_i \, dt = 0. -\label{oopseEq:lm2} -\end{equation} -Here, $\delta q_i$ is not independent for each $q$, as $q_1$ and $q_2$ -are linked by $\sigma$. However, $\sigma$ is fixed at any given -instant of time, giving: -\begin{align} -\delta\sigma &= \biggl( \frac{\partial\sigma}{\partial q_1} \delta q_1 % - + \frac{\partial\sigma}{\partial q_2} \delta q_2 \biggr) = 0 ,\\ -% -\frac{\partial\sigma}{\partial q_1} \delta q_1 &= % - - \frac{\partial\sigma}{\partial q_2} \delta q_2, \\ -% -\delta q_2 &= - \biggl(\frac{\partial\sigma}{\partial q_1} \bigg / % - \frac{\partial\sigma}{\partial q_2} \biggr) \delta q_1. -\end{align} -Substituted back into Eq.~\ref{oopseEq:lm2}, -\begin{equation} -\int_{t_1}^{t_2}\biggl [ \biggl(\frac{\partial L}{\partial q_1} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_1} - \biggr) - - \biggl( \frac{\partial L}{\partial q_1} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_1} - \biggr) \biggl(\frac{\partial\sigma}{\partial q_1} \bigg / % - \frac{\partial\sigma}{\partial q_2} \biggr)\biggr] \delta q_1 \, dt = 0. -\label{oopseEq:lm3} -\end{equation} -Leading to, -\begin{equation} -\frac{\biggl(\frac{\partial L}{\partial q_1} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_1} - \biggr)}{\frac{\partial\sigma}{\partial q_1}} = -\frac{\biggl(\frac{\partial L}{\partial q_2} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_2} - \biggr)}{\frac{\partial\sigma}{\partial q_2}}. -\label{oopseEq:lm4} -\end{equation} -This relation can only be statisfied, if both are equal to a single -function $-\lambda(t)$, -\begin{align} -\frac{\biggl(\frac{\partial L}{\partial q_1} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_1} - \biggr)}{\frac{\partial\sigma}{\partial q_1}} &= -\lambda(t), \\ -% -\frac{\partial L}{\partial q_1} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_1} &= - -\lambda(t)\,\frac{\partial\sigma}{\partial q_1} ,\\ -% -\frac{\partial L}{\partial q_1} - - \frac{d}{dt}\,\frac{\partial L}{\partial \dot{q}_1} - + \mathcal{G}_i &= 0, -\end{align} -where $\mathcal{G}_i$, the force of constraint on $i$, is: -\begin{equation} -\mathcal{G}_i = \lambda(t)\,\frac{\partial\sigma}{\partial q_1}. -\label{oopseEq:lm5} -\end{equation} +\subsubsection{\label{oopseSec:zcons}The Z-Constraint Method} -In a simulation, this would involve the solution of a set of $(m + n)$ -number of equations. Where $m$ is the number of constraints, and $n$ -is the number of constrained coordinates. In practice, this is not -done, as the matrix inversion necessary to solve the system of -equations would be very time consuming to solve. Additionally, the -numerical error in the solution of the set of $\lambda$'s would be -compounded by the error inherent in propagating by the Velocity Verlet -algorithm ($\Delta t^4$). The Verlet propagation error is negligible -in an unconstrained system, as one is interested in the statistics of -the run, and not that the run be numerically exact to the ``true'' -integration. This relates back to the ergodic hypothesis that a time -integral of a valid trajectory will still give the correct ensemble -average. However, in the case of constraints, if the equations of -motion leave the ``true'' trajectory, they are departing from the -constrained surface. The method that is used, is to iteratively solve -for $\lambda(t)$ at each time step. - -In {\sc rattle} the equations of motion are modified subject to the -following two constraints: -\begin{align} -\sigma_{ij}[\mathbf{r}(t)] \equiv - [ \mathbf{r}_i(t) - \mathbf{r}_j(t)]^2 - d_{ij}^2 &= 0 % - \label{oopseEq:c1}, \\ -% -[\mathbf{\dot{r}}_i(t) - \mathbf{\dot{r}}_j(t)] \cdot - [\mathbf{r}_i(t) - \mathbf{r}_j(t)] &= 0 .\label{oopseEq:c2} -\end{align} -Eq.~\ref{oopseEq:c1} is the set of bond constraints, where $d_{ij}$ is -the constrained distance between atom $i$ and -$j$. Eq.~\ref{oopseEq:c2} constrains the velocities of $i$ and $j$ to -be perpendicular to the bond vector, so that the bond can neither grow -nor shrink. The constrained dynamics equations become: -\begin{equation} -m_i \mathbf{\ddot{r}}_i = \mathbf{F}_i + \mathbf{\mathcal{G}}_i, -\label{oopseEq:r1} -\end{equation} -where,$\mathbf{\mathcal{G}}_i$ are the forces of constraint on $i$, -and are defined: -\begin{equation} -\mathbf{\mathcal{G}}_i = - \sum_j \lambda_{ij}(t)\,\nabla \sigma_{ij}. -\label{oopseEq:r2} -\end{equation} - -In Velocity Verlet, if $\Delta t = h$, the propagation can be written: -\begin{align} -\mathbf{r}_i(t+h) &= - \mathbf{r}_i(t) + h\mathbf{\dot{r}}(t) + - \frac{h^2}{2m_i}\,\Bigl[ \mathbf{F}_i(t) + - \mathbf{\mathcal{G}}_{Ri}(t) \Bigr] \label{oopseEq:vv1}, \\ -% -\mathbf{\dot{r}}_i(t+h) &= - \mathbf{\dot{r}}_i(t) + \frac{h}{2m_i} - \Bigl[ \mathbf{F}_i(t) + \mathbf{\mathcal{G}}_{Ri}(t) + - \mathbf{F}_i(t+h) + \mathbf{\mathcal{G}}_{Vi}(t+h) \Bigr] ,% - \label{oopseEq:vv2} -\end{align} -where: -\begin{align} -\mathbf{\mathcal{G}}_{Ri}(t) &= - -2 \sum_j \lambda_{Rij}(t) \mathbf{r}_{ij}(t) ,\\ -% -\mathbf{\mathcal{G}}_{Vi}(t+h) &= - -2 \sum_j \lambda_{Vij}(t+h) \mathbf{r}(t+h). -\end{align} -Next, define: -\begin{align} -g_{ij} &= h \lambda_{Rij}(t) ,\\ -k_{ij} &= h \lambda_{Vij}(t+h), \\ -\mathbf{q}_i &= \mathbf{\dot{r}}_i(t) + \frac{h}{2m_i} \mathbf{F}_i(t) - - \frac{1}{m_i}\sum_j g_{ij}\mathbf{r}_{ij}(t). -\end{align} -Using these definitions, Eq.~\ref{oopseEq:vv1} and \ref{oopseEq:vv2} -can be rewritten as, -\begin{align} -\mathbf{r}_i(t+h) &= \mathbf{r}_i(t) + h \mathbf{q}_i ,\\ -% -\mathbf{\dot{r}}(t+h) &= \mathbf{q}_i + \frac{h}{2m_i}\mathbf{F}_i(t+h) - -\frac{1}{m_i}\sum_j k_{ij} \mathbf{r}_{ij}(t+h). -\end{align} - -To integrate the equations of motion, the {\sc rattle} algorithm first -solves for $\mathbf{r}(t+h)$. Let, -\begin{equation} -\mathbf{q}_i = \mathbf{\dot{r}}(t) + \frac{h}{2m_i}\mathbf{F}_i(t). -\end{equation} -Here $\mathbf{q}_i$ corresponds to an initial unconstrained move. Next -pick a constraint $j$, and let, -\begin{equation} -\mathbf{s} = \mathbf{r}_i(t) + h\mathbf{q}_i(t) - - \mathbf{r}_j(t) + h\mathbf{q}_j(t). -\label{oopseEq:ra1} -\end{equation} -If -\begin{equation} -\Big| |\mathbf{s}|^2 - d_{ij}^2 \Big| > \text{tolerance}, -\end{equation} -then the constraint is unsatisfied, and corrections are made to the -positions. First we define a test corrected configuration as, -\begin{align} -\mathbf{r}_i^T(t+h) = \mathbf{r}_i(t) + h\biggl[\mathbf{q}_i - - g_{ij}\,\frac{\mathbf{r}_{ij}(t)}{m_i} \biggr] ,\\ -% -\mathbf{r}_j^T(t+h) = \mathbf{r}_j(t) + h\biggl[\mathbf{q}_j + - g_{ij}\,\frac{\mathbf{r}_{ij}(t)}{m_j} \biggr]. -\end{align} -And we chose $g_{ij}$ such that, $|\mathbf{r}_i^T - \mathbf{r}_j^T|^2 -= d_{ij}^2$. Solving the quadratic for $g_{ij}$ we obtain the -approximation, -\begin{equation} -g_{ij} = \frac{(s^2 - d^2)}{2h[\mathbf{s}\cdot\mathbf{r}_{ij}(t)] - (\frac{1}{m_i} + \frac{1}{m_j})}. -\end{equation} -Although not an exact solution for $g_{ij}$, as this is an iterative -scheme overall, the eventual solution will converge. With a trial -$g_{ij}$, the new $\mathbf{q}$'s become, -\begin{align} -\mathbf{q}_i &= \mathbf{q}^{\text{old}}_i - g_{ij}\, - \frac{\mathbf{r}_{ij}(t)}{m_i} ,\\ -% -\mathbf{q}_j &= \mathbf{q}^{\text{old}}_j + g_{ij}\, - \frac{\mathbf{r}_{ij}(t)}{m_j} . -\end{align} -The whole algorithm is then repeated from Eq.~\ref{oopseEq:ra1} until -all constraints are satisfied. - -The second step of {\sc rattle}, is to then update the velocities. The -step starts with, -\begin{equation} -\mathbf{\dot{r}}_i(t+h) = \mathbf{q}_i + \frac{h}{2m_i}\mathbf{F}_i(t+h). -\end{equation} -Next we pick a constraint $j$, and calculate the dot product $\ell$. -\begin{equation} -\ell = \mathbf{r}_{ij}(t+h) \cdot \mathbf{\dot{r}}_{ij}(t+h). -\label{oopseEq:rv1} -\end{equation} -Here if constraint Eq.~\ref{oopseEq:c2} holds, $\ell$ should be -zero. Therefore if $\ell$ is greater than some tolerance, then -corrections are made to the $i$ and $j$ velocities. -\begin{align} -\mathbf{\dot{r}}_i^T &= \mathbf{\dot{r}}_i(t+h) - k_{ij} - \frac{\mathbf{\dot{r}}_{ij}(t+h)}{m_i}, \\ -% -\mathbf{\dot{r}}_j^T &= \mathbf{\dot{r}}_j(t+h) + k_{ij} - \frac{\mathbf{\dot{r}}_{ij}(t+h)}{m_j}. -\end{align} -Like in the previous step, we select a value for $k_{ij}$ such that -$\ell$ is zero. -\begin{equation} -k_{ij} = \frac{\ell}{d^2_{ij}(\frac{1}{m_i} + \frac{1}{m_j})}. -\end{equation} -The test velocities, $\mathbf{\dot{r}}^T_i$ and -$\mathbf{\dot{r}}^T_j$, then replace their respective velocities, and -the algorithm is iterated from Eq.~\ref{oopseEq:rv1} until all -constraints are satisfied. - - -\subsection{\label{oopseSec:zcons}Z-Constraint Method} - -Based on the fluctuation-dissipation theorem, a force auto-correlation -method was developed by Roux and Karplus to investigate the dynamics +A force auto-correlation method based on the fluctuation-dissipation +theorem was developed by Roux and Karplus to investigate the dynamics of ions inside ion channels.\cite{Roux91} The time-dependent friction coefficient can be calculated from the deviation of the instantaneous -force from its mean force. +force from its mean value: \begin{equation} \xi(z,t)=\langle\delta F(z,t)\delta F(z,0)\rangle/k_{B}T, \end{equation} @@ -1888,294 +1958,244 @@ where% \delta F(z,t)=F(z,t)-\langle F(z,t)\rangle. \end{equation} - If the time-dependent friction decays rapidly, the static friction coefficient can be approximated by \begin{equation} \xi_{\text{static}}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt. \end{equation} -Allowing diffusion constant to then be calculated through the + +This allows the diffusion constant to then be calculated through the Einstein relation:\cite{Marrink94} \begin{equation} D(z)=\frac{k_{B}T}{\xi_{\text{static}}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty }\langle\delta F(z,t)\delta F(z,0)\rangle dt}.% \end{equation} -The Z-Constraint method, which fixes the z coordinates of the -molecules with respect to the center of the mass of the system, has -been a method suggested to obtain the forces required for the force -auto-correlation calculation.\cite{Marrink94} However, simply resetting the -coordinate will move the center of the mass of the whole system. To -avoid this problem, a new method was used in {\sc oopse}. Instead of -resetting the coordinate, we reset the forces of z-constrained -molecules as well as subtract the total constraint forces from the -rest of the system after the force calculation at each time step. +The Z-Constraint method, which fixes the $z$ coordinates of a few +``tagged'' molecules with respect to the center of the mass of the +system is a technique that was proposed to obtain the forces required +for the force auto-correlation calculation.\cite{Marrink94} However, +simply resetting the coordinate will move the center of the mass of +the whole system. To avoid this problem, we have developed a new +method that is utilized in {\sc oopse}. Instead of resetting the +coordinates, we reset the forces of $z$-constrained molecules and +subtract the total constraint forces from the rest of the system after +the force calculation at each time step. -After the force calculation, define $G_\alpha$ as +After the force calculation, the total force on molecule $\alpha$, \begin{equation} G_{\alpha} = \sum_i F_{\alpha i}, \label{oopseEq:zc1} \end{equation} -where $F_{\alpha i}$ is the force in the z direction of atom $i$ in -z-constrained molecule $\alpha$. The forces of the z constrained -molecule are then set to: +where $F_{\alpha i}$ is the force in the $z$ direction on atom $i$ in +$z$-constrained molecule $\alpha$. The forces on the atoms in the +$z$-constrained molecule are then adjusted to remove the total force +on molecule $\alpha$: \begin{equation} F_{\alpha i} = F_{\alpha i} - \frac{m_{\alpha i} G_{\alpha}}{\sum_i m_{\alpha i}}. \end{equation} -Here, $m_{\alpha i}$ is the mass of atom $i$ in the z-constrained -molecule. Having rescaled the forces, the velocities must also be -rescaled to subtract out any center of mass velocity in the z -direction. +Here, $m_{\alpha i}$ is the mass of atom $i$ in the $z$-constrained +molecule. After the forces have been adjusted, the velocities must +also be modified to subtract out molecule $\alpha$'s center-of-mass +velocity in the $z$ direction. \begin{equation} v_{\alpha i} = v_{\alpha i} - \frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}}, \end{equation} where $v_{\alpha i}$ is the velocity of atom $i$ in the z direction. -Lastly, all of the accumulated z constrained forces must be subtracted -from the system to keep the system center of mass from drifting. +Lastly, all of the accumulated constraint forces must be subtracted +from the rest of the unconstrained system to keep the system center of +mass of the entire system from drifting. \begin{equation} F_{\beta i} = F_{\beta i} - \frac{m_{\beta i} \sum_{\alpha} G_{\alpha}} {\sum_{\beta}\sum_i m_{\beta i}}, \end{equation} -where $\beta$ are all of the unconstrained molecules in the +where $\beta$ denotes all {\it unconstrained} molecules in the system. Similarly, the velocities of the unconstrained molecules must -also be scaled. +also be scaled: \begin{equation} -v_{\beta i} = v_{\beta i} + \sum_{\alpha} - \frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}}. +v_{\beta i} = v_{\beta i} + \sum_{\alpha} \frac{\sum_i m_{\alpha i} +v_{\alpha i}}{\sum_i m_{\alpha i}}. \end{equation} -At the very beginning of the simulation, the molecules may not be at their -constrained positions. To move a z-constrained molecule to its specified -position, a simple harmonic potential is used +This method will pin down the centers-of-mass of all of the +$z$-constrained molecules, and will also keep the entire system fixed +at the original system center-of-mass location. + +At the very beginning of the simulation, the molecules may not be at +their desired positions. To steer a $z$-constrained molecule to its +specified position, a simple harmonic potential is used: \begin{equation} U(t)=\frac{1}{2}k_{\text{Harmonic}}(z(t)-z_{\text{cons}})^{2},% \end{equation} -where $k_{\text{Harmonic}}$ is the harmonic force constant, $z(t)$ is the -current $z$ coordinate of the center of mass of the constrained molecule, and -$z_{\text{cons}}$ is the constrained position. The harmonic force operating -on the z-constrained molecule at time $t$ can be calculated by +where $k_{\text{Harmonic}}$ is an harmonic force constant, $z(t)$ is +the current $z$ coordinate of the center of mass of the constrained +molecule, and $z_{\text{cons}}$ is the desired constraint +position. The harmonic force operating on the $z$-constrained molecule +at time $t$ can be calculated by \begin{equation} F_{z_{\text{Harmonic}}}(t)=-\frac{\partial U(t)}{\partial z(t)}= -k_{\text{Harmonic}}(z(t)-z_{\text{cons}}). \end{equation} -\section{\label{oopseSec:props}Trajectory Analysis} +The user may also specify the use of a constant velocity method +(steered molecular dynamics) to move the molecules to their desired +initial positions. -\subsection{\label{oopseSec:staticProps}Static Property Analysis} +To use of the $z$-constraint method in an {\sc oopse} simulation, the +molecules must be specified using the {\tt nZconstraints} keyword in +the meta-data file. The other parameters for modifying the behavior +of the $z$-constraint method are listed in table~\ref{table:zconParams}. -The static properties of the trajectories are analyzed with the -program \texttt{staticProps}. The code is capable of calculating a -number of pair correlations between species A and B. Some of which -only apply to directional entities. The summary of pair correlations -can be found in Table~\ref{oopseTb:gofrs} - \begin{table} -\caption{THE DIFFERENT PAIR CORRELATIONS IN \texttt{staticProps}} -\label{oopseTb:gofrs} +\caption{The Global Keywords: Z-Constraint Parameters} +\label{table:zconParams} \begin{center} -\begin{tabular}{|l|c|c|} -\hline -Name & Equation & Directional Atom \\ \hline -$g_{\text{AB}}(r)$ & Eq.~\ref{eq:gofr} & neither \\ \hline -$g_{\text{AB}}(r, \cos \theta)$ & Eq.~\ref{eq:gofrCosTheta} & A \\ \hline -$g_{\text{AB}}(r, \cos \omega)$ & Eq.~\ref{eq:gofrCosOmega} & both \\ \hline -$g_{\text{AB}}(x, y, z)$ & Eq.~\ref{eq:gofrXYZ} & neither \\ \hline -$\langle \cos \omega \rangle_{\text{AB}}(r)$ & Eq.~\ref{eq:cosOmegaOfR} &% - both \\ \hline -\end{tabular} -\begin{minipage}{\linewidth} -\centering -\vspace{2mm} -The third column specifies which atom, if any, need be a directional entity. -\end{minipage} -\end{center} -\end{table} +% Note when adding or removing columns, the \hsize numbers must add up to the total number +% of columns. +\begin{tabularx}{\linewidth}% + {>{\setlength{\hsize}{1.00\hsize}}X% + >{\setlength{\hsize}{0.4\hsize}}X% + >{\setlength{\hsize}{1.2\hsize}}X% + >{\setlength{\hsize}{1.4\hsize}}X} -The first pair correlation, $g_{\text{AB}}(r)$, is defined as follows: -\begin{equation} -g_{\text{AB}}(r) = \frac{V}{N_{\text{A}}N_{\text{B}}}\langle %% - \sum_{i \in \text{A}} \sum_{j \in \text{B}} %% - \delta( r - |\mathbf{r}_{ij}|) \rangle, \label{eq:gofr} -\end{equation} -where $\mathbf{r}_{ij}$ is the vector -\begin{equation*} -\mathbf{r}_{ij} = \mathbf{r}_j - \mathbf{r}_i, \notag -\end{equation*} -and $\frac{V}{N_{\text{A}}N_{\text{B}}}$ normalizes the average over -the expected pair density at a given $r$. +{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline -The next two pair correlations, $g_{\text{AB}}(r, \cos \theta)$ and -$g_{\text{AB}}(r, \cos \omega)$, are similar in that they are both two -dimensional histograms. Both use $r$ for the primary axis then a -$\cos$ for the secondary axis ($\cos \theta$ for -Eq.~\ref{eq:gofrCosTheta} and $\cos \omega$ for -Eq.~\ref{eq:gofrCosOmega}). This allows for the investigator to -correlate alignment on directional entities. $g_{\text{AB}}(r, \cos -\theta)$ is defined as follows: -\begin{equation} -g_{\text{AB}}(r, \cos \theta) = \frac{V}{N_{\text{A}}N_{\text{B}}}\langle -\sum_{i \in \text{A}} \sum_{j \in \text{B}} -\delta( \cos \theta - \cos \theta_{ij}) -\delta( r - |\mathbf{r}_{ij}|) \rangle. -\label{eq:gofrCosTheta} -\end{equation} -Here -\begin{equation*} -\cos \theta_{ij} = \mathbf{\hat{i}} \cdot \mathbf{\hat{r}}_{ij}, -\end{equation*} -where $\mathbf{\hat{i}}$ is the unit directional vector of species $i$ -and $\mathbf{\hat{r}}_{ij}$ is the unit vector associated with vector -$\mathbf{r}_{ij}$. +{\tt nZconstraints} & integer & The number of zconstraint molecules& If using zconstraint method, {\tt nZconstraints} must be set \\ +{\tt zconsTime} & fs & Sets the frequency at which the {\tt .fz} file is written & \\ +{\tt zconsForcePolicy} & string & The strategy of subtracting +zconstraint force from the unconstrained molecules & Possible +strategies are {\tt BYMASS} and {\tt BYNUMBER}. Default +strategy is set to {\tt BYMASS}\\ +{\tt zconsGap} & $\mbox{\AA}$ & Set the distance between two adjacent +constraint positions& Used mainly in moving molecules through a simulation \\ +{\tt zconsFixtime} & fs & Sets how long the zconstraint molecule is +fixed & {\tt zconsFixtime} must be set if {\tt zconsGap} is set\\ +{\tt zconsUsingSMD} &logical & Flag for using Steered Molecular +Dynamics or Harmonic Forces to move the molecule & Harmonic Forces are +used by default\\ -The second two dimensional histogram is of the form: -\begin{equation} -g_{\text{AB}}(r, \cos \omega) = - \frac{V}{N_{\text{A}}N_{\text{B}}}\langle - \sum_{i \in \text{A}} \sum_{j \in \text{B}} - \delta( \cos \omega - \cos \omega_{ij}) - \delta( r - |\mathbf{r}_{ij}|) \rangle. \label{eq:gofrCosOmega} -\end{equation} -Here -\begin{equation*} -\cos \omega_{ij} = \mathbf{\hat{i}} \cdot \mathbf{\hat{j}}. -\end{equation*} -Again, $\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$ are the unit -directional vectors of species $i$ and $j$. +\end{tabularx} +\end{center} +\end{table} -The static analysis code is also cable of calculating a three -dimensional pair correlation of the form: -\begin{equation}\label{eq:gofrXYZ} -g_{\text{AB}}(x, y, z) = - \frac{V}{N_{\text{A}}N_{\text{B}}}\langle - \sum_{i \in \text{A}} \sum_{j \in \text{B}} - \delta( x - x_{ij}) - \delta( y - y_{ij}) - \delta( z - z_{ij}) \rangle, -\end{equation} -where $x_{ij}$, $y_{ij}$, and $z_{ij}$ are the $x$, $y$, and $z$ -components respectively of vector $\mathbf{r}_{ij}$. -The final pair correlation is similar to -Eq.~\ref{eq:gofrCosOmega}. $\langle \cos \omega -\rangle_{\text{AB}}(r)$ is calculated in the following way: -\begin{equation}\label{eq:cosOmegaOfR} -\langle \cos \omega \rangle_{\text{AB}}(r) = - \langle \sum_{i \in \text{A}} \sum_{j \in \text{B}} - (\cos \omega_{ij}) \delta( r - |\mathbf{r}_{ij}|) \rangle. -\end{equation} -Here $\cos \omega_{ij}$ is defined in the same way as in -Eq.~\ref{eq:gofrCosOmega}. This equation is a single dimensional pair -correlation that gives the average correlation of two directional -entities as a function of their distance from each other. +\section{\label{sec:minimize}Energy Minimization} -\subsection{\label{dynamicProps}Dynamic Property Analysis} +As one of the basic procedures of molecular modeling, energy +minimization is used to identify local configurations that are stable +points on the potential energy surface. There is a vast literature on +energy minimization algorithms have been developed to search for the +global energy minimum as well as to find local structures which are +stable fixed points on the surface. We have included two simple +minimization algorithms: steepest descent, ({\sc sd}) and conjugate +gradient ({\sc cg}) to help users find reasonable local minima from +their initial configurations. -The dynamic properties of a trajectory are calculated with the program -\texttt{dynamicProps}. The program calculates the following properties: -\begin{gather} -\langle | \mathbf{r}(t) - \mathbf{r}(0) |^2 \rangle, \label{eq:rms}\\ -\langle \mathbf{v}(t) \cdot \mathbf{v}(0) \rangle, \label{eq:velCorr} \\ -\langle \mathbf{j}(t) \cdot \mathbf{j}(0) \rangle. \label{eq:angularVelCorr} -\end{gather} +Since {\sc oopse} handles atoms and rigid bodies which have +orientational coordinates as well as translational coordinates, there +is some subtlety to the choice of parameters for minimization +algorithms. -Eq.~\ref{eq:rms} is the root mean square displacement function. Which -allows one to observe the average displacement of an atom as a -function of time. The quantity is useful when calculating diffusion -coefficients because of the Einstein Relation, which is valid at long -times.\cite{allen87:csl} +Given a coordinate set $x_{k}$ and a search direction $d_{k}$, a line +search algorithm is performed along $d_{k}$ to produce +$x_{k+1}=x_{k}+$ $\lambda _{k}d_{k}$. + +In the steepest descent ({\sc sd}) algorithm,% \begin{equation} -2tD = \langle | \mathbf{r}(t) - \mathbf{r}(0) |^2 \rangle. -\label{oopseEq:einstein} +d_{k}=-\nabla V(x_{k}) \end{equation} - -Eq.~\ref{eq:velCorr} and \ref{eq:angularVelCorr} are the translational -velocity and angular velocity correlation functions respectively. The -latter is only applicable to directional species in the -simulation. The velocity autocorrelation functions are useful when -determining vibrational information about the system of interest. +The gradient and the direction of next step are always orthogonal. +This may cause oscillatory behavior in narrow valleys. To overcome +this problem, the Fletcher-Reeves variant~\cite{FletcherReeves} of the +conjugate gradient ({\sc cg}) algorithm is used to generate $d_{k+1}$ +via simple recursion: +\begin{align} +d_{k+1} & =-\nabla V(x_{k+1})+\gamma_{k}d_{k}\\ +\gamma_{k} & =\frac{\nabla V(x_{k+1})^{T}\nabla V(x_{k+1})}{\nabla +V(x_{k})^{T}\nabla V(x_{k})}% +\end{align} -\section{\label{oopseSec:design}Program Design} +The Polak-Ribiere variant~\cite{PolakRibiere} of the conjugate +gradient ($\gamma_{k}$) is defined as% +\begin{equation} +\gamma_{k}=\frac{[\nabla V(x_{k+1})-\nabla V(x)]^{T}\nabla V(x_{k+1})}{\nabla +V(x_{k})^{T}\nabla V(x_{k})}% +\end{equation} -\subsection{\label{sec:architecture} {\sc oopse} Architecture} +The conjugate gradient method assumes that the conformation is close +enough to a local minimum that the potential energy surface is very +nearly quadratic. When the initial structure is far from the minimum, +the steepest descent method can be superior to the conjugate gradient +method. Hence, the steepest descent method is often used for the first +10-100 steps of minimization. Another useful feature of minimization +methods in {\sc oopse} is that a modified {\sc shake} algorithm can be +applied during the minimization to constraint the bond lengths if this +is required by the force field. Meta-data parameters concerning the +minimizer are given in Table~\ref{table:minimizeParams} -The core of OOPSE is divided into two main object libraries: -\texttt{libBASS} and \texttt{libmdtools}. \texttt{libBASS} is the -library developed around the parsing engine and \texttt{libmdtools} -is the software library developed around the simulation engine. These -two libraries are designed to encompass all the basic functions and -tools that {\sc oopse} provides. Utility programs, such as the -property analyzers, need only link against the software libraries to -gain access to parsing, force evaluation, and input / output -routines. +\begin{table} +\caption{The Global Keywords: Energy Minimizer Parameters} +\label{table:minimizeParams} +\begin{center} +% Note when adding or removing columns, the \hsize numbers must add up to the total number +% of columns. +\begin{tabularx}{\linewidth}% + {>{\setlength{\hsize}{1.2\hsize}}X% + >{\setlength{\hsize}{0.6\hsize}}X% + >{\setlength{\hsize}{1.1\hsize}}X% + >{\setlength{\hsize}{1.1\hsize}}X} -Contained in \texttt{libBASS} are all the routines associated with -reading and parsing the \texttt{.bass} input files. Given a -\texttt{.bass} file, \texttt{libBASS} will open it and any associated -\texttt{.mdl} files; then create structures in memory that are -templates of all the molecules specified in the input files. In -addition, any simulation parameters set in the \texttt{.bass} file -will be placed in a structure for later query by the controlling -program. +{\bf keyword} & {\bf units} & {\bf use} & {\bf remarks} \\ \hline -Located in \texttt{libmdtools} are all other routines necessary to a -Molecular Dynamics simulation. The library uses the main data -structures returned by \texttt{libBASS} to initialize the various -parts of the simulation: the atom structures and positions, the force -field, the integrator, \emph{et cetera}. After initialization, the -library can be used to perform a variety of tasks: integrate a -Molecular Dynamics trajectory, query phase space information from a -specific frame of a completed trajectory, or even recalculate force or -energetic information about specific frames from a completed -trajectory. +{\tt minimizer} & string & selects the minimization method to be used +& either {\tt CG} (conjugate gradient) or {\tt SD} (steepest +descent) \\ +{\tt minimizerMaxIter} & steps & Sets the maximum iteration number in the energy minimization & Default value is 200\\ +{\tt minimizerWriteFreq} & steps & Sets the frequency at which the {\tt .dump} and {\tt .stat} files are writtern during energy minimization & \\ +{\tt minimizerStepSize} & $\mbox{\AA}$ & Set the step size of line search & Default value is 0.01\\ +{\tt minimizerFTol} & $\mbox{kcal mol}^{-1}$ & Sets energy tolerance & Default value is $10^{-8}$\\ +{\tt minimizerGTol} & $\mbox{kcal mol}^{-1}\mbox{\AA}^{-1}$ & Sets gradient tolerance & Default value is $10^{-8}$\\ +{\tt minimizerLSTol} & $\mbox{kcal mol}^{-1}$ & Sets line search tolerance & Default value is $10^{-8}$\\ +{\tt minimizerLSMaxIter} & steps & Sets the maximum iteration of line searching & Default value is 50\\ -With these core libraries in place, several programs have been -developed to utilize the routines provided by \texttt{libBASS} and -\texttt{libmdtools}. The main program of the package is \texttt{oopse} -and the corresponding parallel version \texttt{oopse\_MPI}. These two -programs will take the \texttt{.bass} file, and create (and integrate) -the simulation specified in the script. The two analysis programs -\texttt{staticProps} and \texttt{dynamicProps} utilize the core -libraries to initialize and read in trajectories from previously -completed simulations, in addition to the ability to use functionality -from \texttt{libmdtools} to recalculate forces and energies at key -frames in the trajectories. Lastly, the family of system building -programs (Sec.~\ref{oopseSec:initCoords}) also use the libraries to -store and output the system configurations they create. +\end{tabularx} +\end{center} +\end{table} -\subsection{\label{oopseSec:parallelization} Parallelization of {\sc oopse}} +\section{\label{oopseSec:parallelization} Parallel Simulation Implementation} -Although processor power is continually growing roughly following -Moore's Law, it is still unreasonable to simulate systems of more then -a 1000 atoms on a single processor. To facilitate study of larger -system sizes or smaller systems on long time scales in a reasonable -period of time, parallel methods were developed allowing multiple -CPU's to share the simulation workload. Three general categories of -parallel decomposition methods have been developed including atomic, -spatial and force decomposition methods. +Although processor power is continually improving, it is still +unreasonable to simulate systems of more then a 1000 atoms on a single +processor. To facilitate study of larger system sizes or smaller +systems for longer time scales, parallel methods were developed to +allow multiple CPU's to share the simulation workload. Three general +categories of parallel decomposition methods have been developed: +these are the atomic,\cite{Fox88} spatial~\cite{plimpton95} and +force~\cite{Paradyn} decomposition methods. -Algorithmically simplest of the three methods is atomic decomposition -where N particles in a simulation are split among P processors for the -duration of the simulation. Computational cost scales as an optimal -$\mathcal{O}(N/P)$ for atomic decomposition. Unfortunately all +Algorithmically simplest of the three methods is atomic decomposition, +where $N$ particles in a simulation are split among $P$ processors for +the duration of the simulation. Computational cost scales as an +optimal $\mathcal{O}(N/P)$ for atomic decomposition. Unfortunately all processors must communicate positions and forces with all other -processors at every force evaluation, leading communication costs to -scale as an unfavorable $\mathcal{O}(N)$, \emph{independent of the +processors at every force evaluation, leading the communication costs +to scale as an unfavorable $\mathcal{O}(N)$, \emph{independent of the number of processors}. This communication bottleneck led to the -development of spatial and force decomposition methods in which +development of spatial and force decomposition methods, in which communication among processors scales much more favorably. Spatial or domain decomposition divides the physical spatial domain into 3D boxes in which each processor is responsible for calculation of forces and positions of particles located in its box. Particles are reassigned to different processors as they move through simulation space. To -calculate forces on a given particle, a processor must know the +calculate forces on a given particle, a processor must simply know the positions of particles within some cutoff radius located on nearby -processors instead of the positions of particles on all +processors rather than the positions of particles on all processors. Both communication between processors and computation scale as $\mathcal{O}(N/P)$ in the spatial method. However, spatial decomposition adds algorithmic complexity to the simulation code and -is not very efficient for small N since the overall communication +is not very efficient for small $N$, since the overall communication scales as the surface to volume ratio $\mathcal{O}(N/P)^{2/3}$ in three dimensions. @@ -2184,7 +2204,7 @@ given row by particles located in that processors colu processors based on a block decomposition of the force matrix. Processors are split into an optimally square grid forming row and column processor groups. Forces are calculated on particles in a -given row by particles located in that processors column +given row by particles located in that processor's column assignment. Force decomposition is less complex to implement than the spatial method but still scales computationally as $\mathcal{O}(N/P)$ and scales as $\mathcal{O}(N/\sqrt{P})$ in communication @@ -2193,72 +2213,37 @@ atoms.\cite{plimpton95} and favorably compete with spatial methods up to 100,000 atoms.\cite{plimpton95} -\subsection{\label{oopseSec:memAlloc}Memory Issues in Trajectory Analysis} - -For large simulations, the trajectory files can sometimes reach sizes -in excess of several gigabytes. In order to effectively analyze that -amount of data, two memory management schemes have been devised for -\texttt{staticProps} and for \texttt{dynamicProps}. The first scheme, -developed for \texttt{staticProps}, is the simplest. As each frame's -statistics are calculated independent of each other, memory is -allocated for each frame, then freed once correlation calculations are -complete for the snapshot. To prevent multiple passes through a -potentially large file, \texttt{staticProps} is capable of calculating -all requested correlations per frame with only a single pair loop in -each frame and a single read of the file. - -The second, more advanced memory scheme, is used by -\texttt{dynamicProps}. Here, the program must have multiple frames in -memory to calculate time dependent correlations. In order to prevent a -situation where the program runs out of memory due to large -trajectories, the user is able to specify that the trajectory be read -in blocks. The number of frames in each block is specified by the -user, and upon reading a block of the trajectory, -\texttt{dynamicProps} will calculate all of the time correlation frame -pairs within the block. After in-block correlations are complete, a -second block of the trajectory is read, and the cross correlations are -calculated between the two blocks. This second block is then freed and -then incremented and the process repeated until the end of the -trajectory. Once the end is reached, the first block is freed then -incremented, and the again the internal time correlations are -calculated. The algorithm with the second block is then repeated with -the new origin block, until all frame pairs have been correlated in -time. This process is illustrated in -Fig.~\ref{oopseFig:dynamicPropsMemory}. - -%\begin{figure} -%\centering -%\includegraphics[width=\linewidth]{dynamicPropsMem.eps} -%\caption[A representation of the block correlations in \texttt{dynamicProps}]{This diagram illustrates the memory management 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.} -%\label{oopseFig:dynamicPropsMemory} -%\end{figure} - \section{\label{oopseSec:conclusion}Conclusion} -We have presented the design and implementation of our open source -simulation package {\sc oopse}. The package offers novel capabilities -to the field of Molecular Dynamics simulation packages in the form of -dipolar force fields, and symplectic integration of rigid body -dynamics. It is capable of scaling across multiple processors through -the use of force based decomposition using MPI. It also implements -several advanced integrators allowing the end user control over -temperature and pressure. In addition, it is capable of integrating -constrained dynamics through both the {\sc rattle} algorithm and the -z-constraint method. +We have presented a new open source parallel simulation program {\sc +oopse}. This program offers some novel capabilities, but mostly makes +available a library of modern object-oriented code for the scientific +community to use freely. Notably, {\sc oopse} can handle symplectic +integration of objects (atoms and rigid bodies) which have +orientational degrees of freedom. It can also work with transition +metal force fields and point-dipoles. It is capable of scaling across +multiple processors through the use of force based decomposition. It +also implements several advanced integrators allowing the end user +control over temperature and pressure. In addition, it is capable of +integrating constrained dynamics through both the {\sc rattle} +algorithm and the $z$-constraint method. -These features are all brought together in a single open-source -program. This allows researchers to not only benefit from -{\sc oopse}, but also contribute to {\sc oopse}'s development as -well. +We encourage other researchers to download and apply this program to +their own research problems. By making the code available, we hope to +encourage other researchers to contribute their own code and make it a +more powerful package for everyone in the molecular dynamics community +to use. All source code for {\sc oopse} is available for download at +{\tt http://oopse.org}. - \newpage \section{Acknowledgments} -The authors would like to thank espresso for fueling this work, and -would also like to send a special acknowledgement to single malt -scotch for its wonderful calming effects and its ability to make the -troubles of the world float away. +Development of {\sc oopse} was funded by a New Faculty Award from the +Camille and Henry Dreyfus Foundation and by the National Science +Foundation under grant CHE-0134881. Computation time was provided by +the Notre Dame Bunch-of-Boxes (B.o.B) computer cluster under NSF grant +DMR-0079647. + \bibliographystyle{achemso} \bibliography{oopsePaper}