--- trunk/mattDisertation/oopse.tex 2004/03/07 04:01:29 1088 +++ trunk/mattDisertation/oopse.tex 2004/03/08 22:15:54 1089 @@ -18,13 +18,13 @@ source simulation package {\sc oopse}. It is important \section{\label{oopseSec:foreword}Foreword} In this chapter, I present and detail the capabilities of the open -source simulation package {\sc oopse}. It is important to note, that a -simulation package of this size and scope would not have been possible +source simulation program {\sc oopse}. It is important to note that a +simulation program of this size and scope would not have been possible without the collaborative efforts of my colleagues: Charles F.~Vardeman II, Teng Lin, Christopher J.~Fennell and J.~Daniel Gezelter. Although my contributions to {\sc oopse} are major, consideration of my work apart from the others would not give a -complete description to the package's capabilities. As such, all +complete description to the program's capabilities. As such, all contributions to {\sc oopse} to date are presented in this chapter. Charles Vardeman is responsible for the parallelization of the long @@ -70,14 +70,13 @@ code was not originally designed to simulate. Examples 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 uncommonly -implemented techniques and energetics include; dipole-dipole -interactions, rigid body dynamics, and metallic embedded -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 package of -simulation code capable of implementing the types of models upon which -our research is based. +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 @@ -173,12 +172,12 @@ maintained for each rigid body. At a minimum, the rota each rigid body. In order to move between the space fixed and body fixed coordinate axes, parameters describing the orientation must be maintained for each rigid body. At a minimum, the rotation matrix -(\textbf{A}) can be described by the three Euler angles ($\phi, -\theta,$ and $\psi$), where the elements of \textbf{A} are composed of +($\mathsf{A}$) can be described by the three Euler angles ($\phi, +\theta,$ and $\psi$), where the elements of $\mathsf{A}$ are composed of trigonometric operations involving $\phi, \theta,$ and $\psi$.\cite{Goldstein01} In order to avoid numerical instabilities inherent in using the Euler angles, the four parameter ``quaternion'' -scheme is often used. The elements of \textbf{A} can be expressed as +scheme is often used. The elements of $\mathsf{A}$ can be expressed as arithmetic operations involving the four quaternions ($q_0, q_1, q_2,$ and $q_3$).\cite{allen87:csl} Use of quaternions also leads to performance enhancements, particularly for very small @@ -194,24 +193,25 @@ molecule{ \begin{lstlisting}[float,caption={[Defining rigid bodies]A sample definition of a rigid body},label={sch:rigidBody}] molecule{ - name = "TIP3P_water"; + name = "TIP3P"; + nAtoms = 3; + atom[0]{ + type = "O_TIP3P"; + position( 0.0, 0.0, -0.06556 ); + } + atom[1]{ + type = "H_TIP3P"; + position( 0.0, 0.75695, 0.52032 ); + } + atom[2]{ + type = "H_TIP3P"; + position( 0.0, -0.75695, 0.52032 ); + } + nRigidBodies = 1; - rigidBody[0]{ - nAtoms = 3; - atom[0]{ - type = "O_TIP3P"; - position( 0.0, 0.0, -0.06556 ); - } - atom[1]{ - type = "H_TIP3P"; - position( 0.0, 0.75695, 0.52032 ); - } - atom[2]{ - type = "H_TIP3P"; - position( 0.0, -0.75695, 0.52032 ); - } - position( 0.0, 0.0, 0.0 ); - orientation( 0.0, 0.0, 1.0 ); + rigidBody[0]{ + nMembers = 3; + members(0, 1, 2); } } \end{lstlisting} @@ -299,22 +299,21 @@ point dipole interaction sites. By placing a dipole at 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 -center of mass, our model mimics the charge separation found in common -phospholipids 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. 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 \emph{et al.}\cite{liu96:new_model} \begin{figure} \centering -\includegraphics[width=\linewidth]{lipidModel.eps} +\includegraphics[width=\linewidth]{twoChainFig.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, $\mu$ is the dipole moment of the head group, and n -is the chain length.} +is the bend angle, and $\mu$ is the dipole moment of the head group.} \label{oopseFig:lipidModel} \end{figure} @@ -338,7 +337,7 @@ illustrated in Scheme \ref{sch:DUFF}. 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}]Sample \texttt{.bass} file showing a simulation utilizing {\sc duff}},label={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}] #include "water.mdl" #include "lipid.mdl" @@ -580,7 +579,7 @@ reference~\cite{Gezelter04}. density corrected SSD models can be found in reference~\cite{Gezelter04}. -\begin{lstlisting}[float,caption={[A simulation of {\sc ssd} water]An example file showing a simulation including {\sc ssd} water.},label={sch:ssd}] +\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" @@ -644,7 +643,7 @@ These fits, are included in {\sc oopse}. 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}. +These fits are included in {\sc oopse}. \subsection{\label{oopseSec:pbc}Periodic Boundary Conditions} @@ -664,7 +663,7 @@ Where $\mathbf{h}_j$ is the column vector of the $j$th \begin{equation} \mathsf{H} = ( \mathbf{h}_x, \mathbf{h}_y, \mathbf{h}_z ) \end{equation} -Where $\mathbf{h}_j$ is the column vector of the $j$th axis of the +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. @@ -679,12 +678,12 @@ cast each element to lie on the in the range $[-0.5,0. 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 on the in the range $[-0.5,0.5]$: +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 +$\roundme(s_i)$ is given by \begin{equation} \roundme(x) = \begin{cases} @@ -811,7 +810,7 @@ output files. 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] +\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; @@ -867,9 +866,6 @@ statistics file is denoted with the \texttt{.stat} fil \section{\label{oopseSec:mechanics}Mechanics} - -\section{\label{sec:mechanics}Mechanics} - \subsection{\label{oopseSec:integrate}Integrating the Equations of Motion: the DLM method} @@ -879,7 +875,7 @@ microcanonical (NVE) ensemble.\cite{} (DLM).\cite{Dullweber1997} When there are no directional atoms or rigid bodies present in the simulation, this integrator becomes the standard velocity-Verlet integrator which is known to sample the -microcanonical (NVE) ensemble.\cite{} +microcanonical (NVE) ensemble.\cite{Frenkel1996} Previous integration methods for orientational motion have problems that are avoided in the DLM method. Direct propagation of the Euler @@ -914,10 +910,11 @@ where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian po {\bf j}_i \right) + V\left(\left\{{\bf r}\right\}, \left\{\mathsf{A}\right\}\right) \end{equation} -where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian position vector -and velocity of the center of mass of particle $i$, and ${\bf j}_i$ -and $\overleftrightarrow{\mathsf{I}}_i$ are the body-fixed angular -momentum and moment of inertia tensor, respectively. $\mathsf{A}_i$ +Where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian position vector +and velocity of the center of mass of particle $i$, and ${\bf j}_i$, +$\overleftrightarrow{\mathsf{I}}_i$ are the body-fixed angular +momentum and moment of inertia tensor respectively, and the +superscript $T$ denotes the transpose of the vector. $\mathsf{A}_i$ is the $3 \times 3$ rotation matrix describing the instantaneous orientation of the particle. $V$ is the potential energy function which may depend on both the positions $\left\{{\bf r}\right\}$ and @@ -998,30 +995,32 @@ Monte Carlo applications, and {\it symplectic}), \item the integrator is time-{\it reversible}, making it suitable for Hybrid Monte Carlo applications, and -\item the error for a single time step is of order $O\left(h^3\right)$ +\item the error for a single time step is of order $\mathcal{O}\left(h^4\right)$ for timesteps of length $h$. \end{enumerate} The integration of the equations of motion is carried out in a -velocity-Verlet style 2-part algorithm: +velocity-Verlet style 2-part algorithm, where $h= \delta t$: {\tt moveA:} -\begin{eqnarray} -{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf -v}(t) + \frac{\delta t}{2} \left( {\bf f}(t) / m \right) \\ -{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t {\bf -v}\left(t + \delta t / 2 \right) \\ -{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf -j}(t) + \frac{\delta t}{2} {\bf \tau}^b(t) \\ -\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left( \delta t -{\bf j}(t + \delta t / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} -\right) -\end{eqnarray} +\begin{align*} +{\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) + + \frac{h}{2} \left( {\bf f}(t) / m \right) \\ +% +{\bf r}(t + h) &\leftarrow {\bf r}(t) + + h {\bf v}\left(t + h / 2 \right) \\ +% +{\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t) + + \frac{h}{2} {\bf \tau}^b(t) \\ +% +\mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left( h {\bf j} + (t + h / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} \right) +\end{align*} -In this context, the $\mathrm{rot}$ function is the reversible product +In this context, the $\mathrm{rotate}$ function is the reversible product of the three body-fixed rotations, \begin{equation} -\mathrm{rot}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot +\mathrm{rotate}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot \mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_x(a_x /2) \end{equation} @@ -1058,14 +1057,16 @@ torques are calculated at the new positions and orient torques are calculated at the new positions and orientations {\tt doForces:} -\begin{eqnarray} -{\bf f}(t + \delta t) & \leftarrow & - \left(\frac{\partial V}{\partial {\bf -r}}\right)_{{\bf r}(t + \delta t)} \\ -{\bf \tau}^{s}(t + \delta t) & \leftarrow & {\bf u}(t + \delta t) -\times \frac{\partial V}{\partial {\bf u}} \\ -{\bf \tau}^{b}(t + \delta t) & \leftarrow & \mathsf{A}(t + \delta t) -\cdot {\bf \tau}^s(t + \delta t) -\end{eqnarray} +\begin{align*} +{\bf f}(t + h) &\leftarrow + - \left(\frac{\partial V}{\partial {\bf r}}\right)_{{\bf r}(t + h)} \\ +% +{\bf \tau}^{s}(t + h) &\leftarrow {\bf u}(t + h) + \times \frac{\partial V}{\partial {\bf u}} \\ +% +{\bf \tau}^{b}(t + h) &\leftarrow \mathsf{A}(t + h) + \cdot {\bf \tau}^s(t + h) +\end{align*} {\sc oopse} automatically updates ${\bf u}$ when the rotation matrix $\mathsf{A}$ is calculated in {\tt moveA}. Once the forces and @@ -1073,14 +1074,13 @@ advanced to the same time value. advanced to the same time value. {\tt moveB:} -\begin{eqnarray} -{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf -v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( -{\bf f}(t + \delta t) / m \right) \\ -{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf -j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} {\bf -\tau}^b(t + \delta t) -\end{eqnarray} +\begin{align*} +{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + h / 2 \right) + + \frac{h}{2} \left( {\bf f}(t + h) / m \right) \\ +% +{\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t + h / 2 \right) + + \frac{h}{2} {\bf \tau}^b(t + h) +\end{align*} The matrix rotations used in the DLM method end up being more costly computationally than the simpler arithmetic quaternion @@ -1088,7 +1088,7 @@ figure \ref{timestep}. shows an average 7\% increase in computation time using the DLM method in place of quaternions. This cost is more than justified when comparing the energy conservation of the two methods as illustrated in -figure \ref{timestep}. +Fig.~\ref{timestep}. \begin{figure} \centering @@ -1102,7 +1102,7 @@ In figure \ref{timestep}, the resulting energy drift a \label{timestep} \end{figure} -In figure \ref{timestep}, the resulting energy drift at various time +In Fig.~\ref{timestep}, the resulting energy drift at various time steps for both the DLM and quaternion integration schemes is compared. All of the 1000 molecule water simulations started with the same configuration, and the only difference was the method for @@ -1122,7 +1122,7 @@ $\delta t$ & {\tt dt = 2.0;} & fs & none \begin{tabular}{llll} {\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf default value} \\ -$\delta t$ & {\tt dt = 2.0;} & fs & none +$h$ & {\tt dt = 2.0;} & fs & none \end{tabular} \end{center} @@ -1136,37 +1136,36 @@ NVE & microcanonical & {\tt ensemble = ``NVE''; } \\ \begin{center} \begin{tabular}{lll} {\bf Integrator} & {\bf Ensemble} & {\bf {\tt .bass} line} \\ -NVE & microcanonical & {\tt ensemble = ``NVE''; } \\ -NVT & canonical & {\tt ensemble = ``NVT''; } \\ -NPTi & isobaric-isothermal (with isotropic volume changes) & {\tt -ensemble = ``NPTi'';} \\ -NPTf & isobaric-isothermal (with changes to box shape) & {\tt -ensemble = ``NPTf'';} \\ -NPTxyz & approximate isobaric-isothermal & {\tt ensemble = -``NPTxyz'';} \\ - & (with separate barostats on each box dimension) & +NVE & microcanonical & {\tt ensemble = NVE; } \\ +NVT & canonical & {\tt ensemble = NVT; } \\ +NPTi & isobaric-isothermal & {\tt ensemble = NPTi;} \\ + & (with isotropic volume changes) & \\ +NPTf & isobaric-isothermal & {\tt ensemble = NPTf;} \\ + & (with changes to box shape) & \\ +NPTxyz & approximate isobaric-isothermal & {\tt ensemble = NPTxyz;} \\ + & (with separate barostats on each box dimension) & \\ \end{tabular} \end{center} -The relatively well-known Nos\'e-Hoover thermostat 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 within a constant, -the Helmholtz free energy. +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 +within a constant, the Helmholtz free energy.\cite{melchionna93} NPT algorithms attempt to maintain constant pressure in the system by coupling the volume of the system to a barostat. {\sc oopse} contains three different constant pressure algorithms. The first two, NPTi and NPTf have been shown to conserve a quantity that is, to within a -constant, the Gibbs free energy. The Melchionna modification to the -Hoover barostat is implemented in both NPTi and NPTf. NPTi allows -only isotropic changes in the simulation box, while box {\it shape} -variations are allowed in NPTf. The NPTxyz integrator has {\it not} -been shown to sample from the isobaric-isothermal ensemble. It is -useful, however, in that it maintains orthogonality for the axes of -the simulation box while attempting to equalize pressure along the -three perpendicular directions in the box. +constant, the Gibbs free energy.\cite{melchionna93} The Melchionna +modification to the Hoover barostat is implemented in both NPTi and +NPTf. NPTi allows only isotropic changes in the simulation box, while +box {\it shape} variations are allowed in NPTf. The NPTxyz integrator +has {\it not} been shown to sample from the isobaric-isothermal +ensemble. It is useful, however, in that it maintains orthogonality +for the axes of the simulation box while attempting to equalize +pressure along the three perpendicular directions in the box. Each of the extended system integrators requires additional keywords to set target values for the thermodynamic state variables that are @@ -1174,6 +1173,7 @@ variables. characteristic decay times for the dynamics of the extended variables. +\begin{center} \begin{tabular}{llll} {\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf default value} \\ @@ -1182,9 +1182,10 @@ $\tau_B$ & {\tt tauBarostat = 5e3;} & fs & none \\ $\tau_T$ & {\tt tauThermostat = 1e3;} & fs & none \\ $\tau_B$ & {\tt tauBarostat = 5e3;} & fs & none \\ & {\tt resetTime = 200;} & fs & none \\ - & {\tt useInitialExtendedSystemState = ``true'';} & logical & -false + & {\tt useInitialExtendedSystemState = true;} & logical & +true \end{tabular} +\end{center} Two additional keywords can be used to either clear the extended system variables periodically ({\tt resetTime}), or to maintain the @@ -1192,7 +1193,7 @@ and their use in the integrators follows below. useInitialExtendedSystemState}). More details on these variables and their use in the integrators follows below. -\subsubsection{\label{oopseSec:noseHooverThermo}Nos\'{e}-Hoover Thermostatting} +\subsection{\label{oopseSec:noseHooverThermo}Nos\'{e}-Hoover Thermostatting} The Nos\'e-Hoover equations of motion are given by\cite{Hoover85} \begin{eqnarray} @@ -1239,24 +1240,30 @@ part algorithm: part algorithm: {\tt moveA:} -\begin{eqnarray} -T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\ -{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf -v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) -\chi(t)\right) \\ -{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t {\bf -v}\left(t + \delta t / 2 \right) \\ -{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf -j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) -\chi(t) \right) \\ -\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t * -{\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\ -\chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) + -\frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 -\right) -\end{eqnarray} +\begin{align*} +T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(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) + \chi(t)\right) \\ +% +{\bf r}(t + h) &\leftarrow {\bf r}(t) + + h {\bf v}\left(t + h / 2 \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) +\end{align*} -Here $\mathrm{rot}(\delta t * {\bf j} +Here $\mathrm{rotate}(h * {\bf j} \overleftrightarrow{\mathsf{I}}^{-1})$ is the same symplectic Trotter factorization of the three rotation operations that was discussed in the section on the DLM integrator. Note that this operation modifies @@ -1272,40 +1279,42 @@ advanced to the same time value. advanced to the same time value. {\tt moveB:} -\begin{eqnarray} -T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\}, -\left\{{\bf j}(t + \delta t)\right\} \\ -\chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t / -2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta -t)}{T_{\mathrm{target}}} - 1 \right) \\ -{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf -v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( -\frac{{\bf f}(t + \delta t)}{m} - {\bf v}(t + \delta t) -\chi(t \delta t)\right) \\ -{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf -j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf -\tau}^b(t + \delta t) - {\bf j}(t + \delta t) -\chi(t + \delta t) \right) -\end{eqnarray} +\begin{align*} +T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\}, + \left\{{\bf j}(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) \\ +% +{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + + h / 2 \right) + \frac{h}{2} \left( + \frac{{\bf f}(t + h)}{m} - {\bf v}(t + h) + \chi(t h)\right) \\ +% +{\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*} -Since ${\bf v}(t + \delta t)$ and ${\bf j}(t + \delta t)$ are required -to caclculate $T(t + \delta t)$ as well as $\chi(t + \delta t)$, they -indirectly depend on their own values at time $t + \delta t$. {\tt -moveB} is therefore done in an iterative fashion until $\chi(t + -\delta t)$ becomes self-consistent. The relative tolerance for the -self-consistency check defaults to a value of $\mbox{10}^{-6}$, but -{\sc oopse} will terminate the iteration after 4 loops even if the -consistency check has not been satisfied. +Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required to caclculate +$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 +relative tolerance for the self-consistency check defaults to a value +of $\mbox{10}^{-6}$, but {\sc oopse} will terminate the iteration +after 4 loops even if the consistency check has not been satisfied. The Nos\'e-Hoover algorithm is known to conserve a Hamiltonian for the extended system that is, to within a constant, identical to the -Helmholtz free energy, +Helmholtz free energy,\cite{melchionna93} \begin{equation} H_{\mathrm{NVT}} = V + K + f k_B T_{\mathrm{target}} \left( \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime \right) \end{equation} -Poor choices of $\delta t$ or $\tau_T$ can result in non-conservation +Poor choices of $h$ or $\tau_T$ can result in non-conservation of $H_{\mathrm{NVT}}$, so the conserved quantity is maintained in the last column of the {\tt .stat} file to allow checks on the quality of the integration. @@ -1314,7 +1323,7 @@ algorithms are given in section \ref{oopseSec:rattle}. {\tt moveB} portions of the algorithm. Details on the constraint algorithms are given in section \ref{oopseSec:rattle}. -\subsubsection{\label{sec:NPTi}Constant-pressure integration with +\subsection{\label{sec:NPTi}Constant-pressure integration with isotropic box deformations (NPTi)} To carry out isobaric-isothermal ensemble calculations {\sc oopse} @@ -1382,40 +1391,51 @@ velocity-Verlet style 2 part algorithm: velocity-Verlet style 2 part algorithm: {\tt moveA:} -\begin{eqnarray} -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\}, \left\{{\bf f}(t)\right\} \\ -{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf -v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) -\left(\chi(t) + \eta(t) \right) \right) \\ -{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf -j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) -\chi(t) \right) \\ -\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t * -{\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\ -\chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) + -\frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 -\right) \\ -\eta(t + \delta t / 2) & \leftarrow & \eta(t) + \frac{\delta t \mathcal{V}(t)}{2 N k_B -T(t) \tau_B^2} \left( P(t) - P_{\mathrm{target}} \right) \\ -{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t \left\{ {\bf -v}\left(t + \delta t / 2 \right) + \eta(t + \delta t / 2)\left[ {\bf -r}(t + \delta t) - {\bf R}_0 \right] \right\} \\ -\mathsf{H}(t + \delta t) & \leftarrow & e^{-\delta t \eta(t + \delta t -/ 2)} \mathsf{H}(t) -\end{eqnarray} +\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) \\ +% +{\bf r}(t + h) &\leftarrow {\bf r}(t) + h + \left\{ {\bf v}\left(t + h / 2 \right) + + \eta(t + h / 2)\left[ {\bf r}(t + h) + - {\bf R}_0 \right] \right\} \\ +% +\mathsf{H}(t + h) &\leftarrow e^{-h \eta(t + h / 2)} + \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 + \delta t$ +integrator, but 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 one full time step by an exponential factor that depends on the value of $\eta$ at time $t + -\delta t / 2$. Reshaping the box uniformly also scales the volume of +h / 2$. Reshaping the box uniformly also scales the volume of the box by \begin{equation} -\mathcal{V}(t + \delta t) \leftarrow e^{ - 3 \delta t \eta(t + \delta t /2)} +\mathcal{V}(t + h) \leftarrow e^{ - 3 h \eta(t + h /2)} \mathcal{V}(t) \end{equation} @@ -1425,36 +1445,39 @@ the same time value. the same time value. {\tt moveB:} -\begin{eqnarray} -T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\}, -\left\{{\bf j}(t + \delta t)\right\} \\ -P(t + \delta t) & \leftarrow & \left\{{\bf r}(t + \delta t)\right\}, -\left\{{\bf v}(t + \delta t)\right\}, \left\{{\bf f}(t + \delta t)\right\} \\ -\chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t / -2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta -t)}{T_{\mathrm{target}}} - 1 \right) \\ -\eta(t + \delta t) & \leftarrow & \eta(t + \delta t / 2) + -\frac{\delta t \mathcal{V}(t + \delta t)}{2 N k_B T(t + \delta t) \tau_B^2} -\left( P(t + \delta t) - P_{\mathrm{target}} -\right) \\ -{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf -v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( -\frac{{\bf f}(t + \delta t)}{m} - {\bf v}(t + \delta t) -(\chi(t + \delta t) + \eta(t + \delta t)) \right) \\ -{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf -j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf -\tau}^b(t + \delta t) - {\bf j}(t + \delta t) -\chi(t + \delta t) \right) -\end{eqnarray} +\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) \\ +% +{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + + h / 2 \right) + \frac{h}{2} \left( + \frac{{\bf f}(t + h)}{m} - {\bf v}(t + h) + (\chi(t + h) + \eta(t + h)) \right) \\ +% +{\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*} -Once again, since ${\bf v}(t + \delta t)$ and ${\bf j}(t + \delta t)$ -are required to caclculate $T(t + \delta t)$, $P(t + \delta t)$, $\chi(t + -\delta t)$, and $\eta(t + \delta t)$, they indirectly depend on their -own values at time $t + \delta t$. {\tt moveB} is therefore done in -an iterative fashion until $\chi(t + \delta t)$ and $\eta(t + \delta -t)$ become self-consistent. The relative tolerance for the -self-consistency check defaults to a value of $\mbox{10}^{-6}$, but -{\sc oopse} will terminate the iteration after 4 loops even if the +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 + +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 +the self-consistency check defaults to a value of $\mbox{10}^{-6}$, +but {\sc oopse} will terminate the iteration after 4 loops even if the consistency check has not been satisfied. The Melchionna modification of the Nos\'e-Hoover-Andersen algorithm is @@ -1481,7 +1504,7 @@ algorithms are given in section \ref{oopseSec:rattle}. {\tt moveB} portions of the algorithm. Details on the constraint algorithms are given in section \ref{oopseSec:rattle}. -\subsubsection{\label{sec:NPTf}Constant-pressure integration with a +\subsection{\label{sec:NPTf}Constant-pressure integration with a flexible box (NPTf)} There is a relatively simple generalization of the @@ -1493,7 +1516,7 @@ the box shape. The equations of motion for this metho \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 \mathsf{1}) {\bf v} \\ +\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} @@ -1501,7 +1524,7 @@ V}{\partial \mathsf{A}} \right) - \chi {\bf j} \\ 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 +\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} \label{eq:melchionna2} @@ -1515,30 +1538,42 @@ NPTi integration: NPTi integration: {\tt moveA:} -\begin{eqnarray} -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\}, \left\{{\bf f}(t)\right\} \\ -{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf -v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - -\left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot -{\bf v}(t) \right) \\ -{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf -j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) -\chi(t) \right) \\ -\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t * -{\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\ -\chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) + -\frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 -\right) \\ -\overleftrightarrow{\eta}(t + \delta t / 2) & \leftarrow & \overleftrightarrow{\eta}(t) + \frac{\delta t \mathcal{V}(t)}{2 N k_B -T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t) - P_{\mathrm{target}}\mathsf{1} \right) \\ -{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t \left\{ {\bf -v}\left(t + \delta t / 2 \right) + \overleftrightarrow{\eta}(t + -\delta t / 2) \cdot \left[ {\bf -r}(t + \delta t) - {\bf R}_0 \right] \right\} \\ -\mathsf{H}(t + \delta t) & \leftarrow & \mathsf{H}(t) \cdot e^{-\delta t -\overleftrightarrow{\eta}(t + \delta t / 2)} -\end{eqnarray} +\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\} \\ +% +{\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t) + + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - + \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) + - P_{\mathrm{target}}\mathsf{1} \right) \\ +% +{\bf r}(t + h) &\leftarrow {\bf r}(t) + h \left\{ {\bf v} + \left(t + h / 2 \right) + \overleftrightarrow{\eta}(t + + h / 2) \cdot \left[ {\bf r}(t + h) + - {\bf R}_0 \right] \right\} \\ +% +\mathsf{H}(t + h) &\leftarrow \mathsf{H}(t) \cdot e^{-h + \overleftrightarrow{\eta}(t + h / 2)} +\end{align*} {\sc oopse} uses a power series expansion truncated at second order for the exponential operation which scales the simulation box. @@ -1546,28 +1581,34 @@ NPTi integrator: NPTi integrator: {\tt moveB:} -\begin{eqnarray} -T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\}, -\left\{{\bf j}(t + \delta t)\right\} \\ -\overleftrightarrow{\mathsf{P}}(t + \delta t) & \leftarrow & \left\{{\bf r}(t + \delta t)\right\}, -\left\{{\bf v}(t + \delta t)\right\}, \left\{{\bf f}(t + \delta t)\right\} \\ -\chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t / -2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta -t)}{T_{\mathrm{target}}} - 1 \right) \\ -\overleftrightarrow{\eta}(t + \delta t) & \leftarrow & \overleftrightarrow{\eta}(t + \delta t / 2) + -\frac{\delta t \mathcal{V}(t + \delta t)}{2 N k_B T(t + \delta t) \tau_B^2} -\left( \overleftrightarrow{P}(t + \delta t) - P_{\mathrm{target}}\mathsf{1} -\right) \\ -{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf -v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( -\frac{{\bf f}(t + \delta t)}{m} - -(\chi(t + \delta t)\mathsf{1} + \overleftrightarrow{\eta}(t + \delta -t)) \right) \cdot {\bf v}(t + \delta t) \\ -{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf -j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf -\tau}^b(t + \delta t) - {\bf j}(t + \delta t) -\chi(t + \delta t) \right) -\end{eqnarray} +\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) + \tau_B^2} \left( \overleftrightarrow{P}(t + h) + - P_{\mathrm{target}}\mathsf{1} \right) \\ +% +{\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + + h / 2 \right) + \frac{h}{2} \left( + \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 identical to those described for the NPTi integrator. @@ -1585,11 +1626,11 @@ electrostatic or Lennard-Jones cutoff radii. It finds 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. It finds most use in -simulating crystals or liquid crystals which assume non-orthorhombic -geometries. +electrostatic or Lennard-Jones cutoff radii. The NPTf integrator +finds most use in simulating crystals or liquid crystals which assume +non-orthorhombic geometries. -\subsubsection{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)} +\subsection{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)} There is one additional extended system integrator which is somewhat simpler than the NPTf method described above. In this case, the three @@ -1911,7 +1952,13 @@ Where $\beta$ are all of the unconstrained molecules i 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 system. +Where $\beta$ are all of the unconstrained molecules in the +system. Similarly, the velocities of the unconstrained molecules must +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}} +\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 @@ -1939,7 +1986,7 @@ can be found in Table~\ref{oopseTb:gofrs} can be found in Table~\ref{oopseTb:gofrs} \begin{table} -\caption[The list of pair correlations in \texttt{staticProps}]{The different pair correlations in \texttt{staticProps} along with whether atom A or B must be directional.} +\caption[The list of pair correlations in \texttt{staticProps}]{THE DIFFERENT PAIR CORRELATIONS IN \texttt{staticProps}} \label{oopseTb:gofrs} \begin{center} \begin{tabular}{|l|c|c|} @@ -1952,6 +1999,11 @@ $\langle \cos \omega \rangle_{\text{AB}}(r)$ & Eq.~\re $\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} @@ -2120,25 +2172,26 @@ $O(N/P)$ for atomic decomposition. Unfortunately all p 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 -$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 $O(N)$, \emph{independent of the number of processors}. This -communication bottleneck led to the 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 positions of particles within some -cutoff radius located on nearby processors instead of the positions of -particles on all processors. Both communication between processors and -computation scale as $O(N/P)$ in the spatial method. However, spatial +$\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 +number of processors}. This communication bottleneck led to the +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 +positions of particles within some cutoff radius located on nearby +processors instead of 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 -scales as the surface to volume ratio $(N/P)^{2/3}$ in three -dimensions. +scales as the surface to volume ratio $\mathcal{O}(N/P)^{2/3}$ in +three dimensions. The parallelization method used in {\sc oopse} is the force decomposition method. Force decomposition assigns particles to @@ -2147,11 +2200,12 @@ spatial method but still scales computationally as $O( and column processor groups. Forces are calculated on particles in a given row by particles located in that processors column assignment. Force decomposition is less complex to implement than the -spatial method but still scales computationally as $O(N/P)$ and scales -as $O(N/\sqrt{P})$ in communication cost. Plimpton has also found that -force decompositions scale more favorably than spatial decompositions -for systems up to 10,000 atoms and favorably compete with spatial -methods up to 100,000 atoms.\cite{plimpton95} +spatial method but still scales computationally as $\mathcal{O}(N/P)$ +and scales as $\mathcal{O}(N/\sqrt{P})$ in communication +cost. Plimpton has also found that force decompositions scale more +favorably than spatial decompositions for systems up to 10,000 atoms +and favorably compete with spatial methods up to 100,000 +atoms.\cite{plimpton95} \subsection{\label{oopseSec:memAlloc}Memory Issues in Trajectory Analysis} @@ -2209,6 +2263,5 @@ well.Documentation and source code for {\sc oopse} can These features are all brought together in a single open-source program. Allowing researchers to not only benefit from {\sc oopse}, but also contribute to {\sc oopse}'s development as -well.Documentation and source code for {\sc oopse} can be downloaded -from \texttt{http://www.openscience.org/oopse/}. +well.