1 |
|
\appendix |
2 |
|
\chapter{\label{chapt:oopse}Object-Oriented Parallel Simulation Engine} |
3 |
|
|
4 |
< |
Designing object-oriented software is hard, and designing reusable |
5 |
< |
object-oriented scientific software is even harder. Absence of |
6 |
< |
applying modern software development practices is the bottleneck of |
7 |
< |
Scientific Computing community\cite{Wilson2006}. For instance, in |
8 |
< |
the last 20 years , there are quite a few MD packages that were |
9 |
< |
developed to solve common MD problems and perform robust simulations |
10 |
< |
. However, many of the codes are legacy programs that are either |
11 |
< |
poorly organized or extremely complex. Usually, these packages were |
12 |
< |
contributed by scientists without official computer science |
13 |
< |
training. The development of most MD applications are lack of strong |
14 |
< |
coordination to enforce design and programming guidelines. Moreover, |
15 |
< |
most MD programs also suffer from missing design and implement |
16 |
< |
documents which is crucial to the maintenance and extensibility. |
17 |
< |
Along the way of studying structural and dynamic processes in |
18 |
< |
condensed phase systems like biological membranes and nanoparticles, |
19 |
< |
we developed and maintained an Object-Oriented Parallel Simulation |
20 |
< |
Engine ({\sc OOPSE}). This new molecular dynamics package has some |
21 |
< |
unique features |
4 |
> |
Absence of applying modern software development practices is the |
5 |
> |
bottleneck of Scientific Computing community\cite{Wilson2006}. In |
6 |
> |
the last 20 years , there are quite a few MD |
7 |
> |
packages\cite{Brooks1983, Vincent1995, Kale1999} that were developed |
8 |
> |
to solve common MD problems and perform robust simulations . |
9 |
> |
Unfortunately, most of them are commercial programs that are either |
10 |
> |
poorly written or extremely complicate. Consequently, it prevents |
11 |
> |
the researchers to reuse or extend those packages to do cutting-edge |
12 |
> |
research effectively. Along the way of studying structural and |
13 |
> |
dynamic processes in condensed phase systems like biological |
14 |
> |
membranes and nanoparticles, we developed an open source |
15 |
> |
Object-Oriented Parallel Simulation Engine ({\sc OOPSE}). This new |
16 |
> |
molecular dynamics package has some unique features |
17 |
|
\begin{enumerate} |
18 |
|
\item {\sc OOPSE} performs Molecular Dynamics (MD) simulations on non-standard |
19 |
|
atom types (transition metals, point dipoles, sticky potentials, |
59 |
|
program of the package, \texttt{oopse} and it corresponding parallel |
60 |
|
version \texttt{oopse\_MPI}, as well as other useful utilities, such |
61 |
|
as \texttt{StatProps} (see Sec.~\ref{appendixSection:StaticProps}), |
62 |
< |
\texttt{DynamicProps} (see |
63 |
< |
Sec.~\ref{appendixSection:appendixSection:DynamicProps}), |
64 |
< |
\texttt{Dump2XYZ} (see |
70 |
< |
Sec.~\ref{appendixSection:appendixSection:Dump2XYZ}), \texttt{Hydro} |
71 |
< |
(see Sec.~\ref{appendixSection:appendixSection:hydrodynamics}) |
62 |
> |
\texttt{DynamicProps} (see Sec.~\ref{appendixSection:DynamicProps}), |
63 |
> |
\texttt{Dump2XYZ} (see Sec.~\ref{appendixSection:Dump2XYZ}), |
64 |
> |
\texttt{Hydro} (see Sec.~\ref{appendixSection:hydrodynamics}) |
65 |
|
\textit{etc}. |
66 |
|
|
67 |
|
\begin{figure} |
84 |
|
reusable. They provide a ready-made solution that can be adapted to |
85 |
|
different problems as necessary. Pattern are expressive. they |
86 |
|
provide a common vocabulary of solutions that can express large |
87 |
< |
solutions succinctly. |
87 |
> |
solutions succinctly. As one of the latest advanced techniques |
88 |
> |
emerged from object-oriented community, design patterns were applied |
89 |
> |
in some of the modern scientific software applications, such as |
90 |
> |
JMol, {\sc OOPSE}\cite{Meineke2005} and PROTOMOL\cite{Matthey2004} |
91 |
> |
\textit{etc}. The following sections enumerates some of the patterns |
92 |
> |
used in {\sc OOPSE}. |
93 |
|
|
96 |
– |
Patterns are usually described using a format that includes the |
97 |
– |
following information: |
98 |
– |
\begin{enumerate} |
99 |
– |
\item The \emph{name} that is commonly used for the pattern. Good pattern names form a vocabulary for |
100 |
– |
discussing conceptual abstractions. a pattern may have more than one commonly used or recognizable name |
101 |
– |
in the literature. In this case it is common practice to document these nicknames or synonyms under |
102 |
– |
the heading of \emph{Aliases} or \emph{Also Known As}. |
103 |
– |
\item The \emph{motivation} or \emph{context} that this pattern applies |
104 |
– |
to. Sometimes, it will include some prerequisites that should be satisfied before deciding to use a pattern |
105 |
– |
\item The \emph{solution} to the problem that the pattern |
106 |
– |
addresses. It describes how to construct the necessary work products. The description may include |
107 |
– |
pictures, diagrams and prose which identify the pattern's structure, its participants, and their |
108 |
– |
collaborations, to show how the problem is solved. |
109 |
– |
\item The \emph{consequences} of using the given solution to solve a |
110 |
– |
problem, both positive and negative. |
111 |
– |
\end{enumerate} |
112 |
– |
|
113 |
– |
As one of the latest advanced techniques emerged from |
114 |
– |
object-oriented community, design patterns were applied in some of |
115 |
– |
the modern scientific software applications, such as JMol, {\sc |
116 |
– |
OOPSE}\cite{Meineke05} and PROTOMOL\cite{Matthey05} \textit{etc}. |
117 |
– |
The following sections enumerates some of the patterns used in {\sc |
118 |
– |
OOPSE}. |
119 |
– |
|
94 |
|
\subsection{\label{appendixSection:singleton}Singleton} |
95 |
+ |
|
96 |
|
The Singleton pattern not only provides a mechanism to restrict |
97 |
|
instantiation of a class to one object, but also provides a global |
98 |
|
point of access to the object. Currently implemented as a global |
99 |
|
variable, the logging utility which reports error and warning |
100 |
|
messages to the console in {\sc OOPSE} is a good candidate for |
101 |
|
applying the Singleton pattern to avoid the global namespace |
102 |
< |
pollution.Although the singleton pattern can be implemented in |
102 |
> |
pollution. Although the singleton pattern can be implemented in |
103 |
|
various ways to account for different aspects of the software |
104 |
|
designs, such as lifespan control \textit{etc}, we only use the |
105 |
< |
static data approach in {\sc OOPSE}. {\tt IntegratorFactory} class |
106 |
< |
is declared as |
107 |
< |
\begin{lstlisting}[float,caption={[A classic Singleton design pattern implementation(I)] Declaration of {\tt IntegratorFactory} class.},label={appendixScheme:singletonDeclaration}] |
105 |
> |
static data approach in {\sc OOPSE}. The declaration and |
106 |
> |
implementation of IntegratorFactory class are given by declared in |
107 |
> |
List.~\ref{appendixScheme:singletonDeclaration} and |
108 |
> |
List.~\ref{appendixScheme:singletonImplementation} respectively. |
109 |
> |
Since constructor is declared as protected, a client can not |
110 |
> |
instantiate IntegratorFactory directly. Moreover, since the member |
111 |
> |
function getInstance serves as the only entry of access to |
112 |
> |
IntegratorFactory, this approach fulfills the basic requirement, a |
113 |
> |
single instance. Another consequence of this approach is the |
114 |
> |
automatic destruction since static data are destroyed upon program |
115 |
> |
termination. |
116 |
> |
\begin{lstlisting}[float,caption={[A classic Singleton design pattern implementation(I)] The declaration of of simple Singleton pattern.},label={appendixScheme:singletonDeclaration}] |
117 |
|
|
118 |
< |
class IntegratorFactory { |
119 |
< |
public: |
120 |
< |
static IntegratorFactory* getInstance(); |
121 |
< |
protected: |
122 |
< |
IntegratorFactory(); |
123 |
< |
private: |
124 |
< |
static IntegratorFactory* instance_; |
125 |
< |
}; |
118 |
> |
class IntegratorFactory { |
119 |
> |
public: |
120 |
> |
static IntegratorFactory* |
121 |
> |
getInstance(); |
122 |
> |
protected: |
123 |
> |
IntegratorFactory(); |
124 |
> |
private: |
125 |
> |
static IntegratorFactory* instance_; |
126 |
> |
}; |
127 |
> |
|
128 |
|
\end{lstlisting} |
143 |
– |
The corresponding implementation is |
144 |
– |
\begin{lstlisting}[float,caption={[A classic Singleton design pattern implementation(II)] Implementation of {\tt IntegratorFactory} class.},label={appendixScheme:singletonImplementation}] |
129 |
|
|
130 |
+ |
\begin{lstlisting}[float,caption={[A classic implementation of Singleton design pattern (II)] The implementation of simple Singleton pattern.},label={appendixScheme:singletonImplementation}] |
131 |
+ |
|
132 |
|
IntegratorFactory::instance_ = NULL; |
133 |
|
|
134 |
|
IntegratorFactory* getInstance() { |
137 |
|
} |
138 |
|
return instance_; |
139 |
|
} |
140 |
+ |
|
141 |
|
\end{lstlisting} |
155 |
– |
Since constructor is declared as {\tt protected}, a client can not |
156 |
– |
instantiate {\tt IntegratorFactory} directly. Moreover, since the |
157 |
– |
member function {\tt getInstance} serves as the only entry of access |
158 |
– |
to {\tt IntegratorFactory}, this approach fulfills the basic |
159 |
– |
requirement, a single instance. Another consequence of this approach |
160 |
– |
is the automatic destruction since static data are destroyed upon |
161 |
– |
program termination. |
142 |
|
|
143 |
+ |
|
144 |
|
\subsection{\label{appendixSection:factoryMethod}Factory Method} |
145 |
|
|
146 |
|
Categoried as a creational pattern, the Factory Method pattern deals |
147 |
|
with the problem of creating objects without specifying the exact |
148 |
|
class of object that will be created. Factory Method is typically |
149 |
|
implemented by delegating the creation operation to the subclasses. |
150 |
< |
\begin{lstlisting}[float,caption={[].},label={appendixScheme:factoryDeclaration}] |
151 |
< |
class IntegratorCreator; |
152 |
< |
class IntegratorFactory { |
153 |
< |
public: |
154 |
< |
typedef std::map<std::string, IntegratorCreator*> CreatorMapType; |
150 |
> |
Parameterized Factory pattern where factory method ( |
151 |
> |
createIntegrator member function) creates products based on the |
152 |
> |
identifier (see List.~\ref{appendixScheme:factoryDeclaration}). If |
153 |
> |
the identifier has been already registered, the factory method will |
154 |
> |
invoke the corresponding creator (see |
155 |
> |
List.~\ref{appendixScheme:integratorCreator}) which utilizes the |
156 |
> |
modern C++ template technique to avoid excess subclassing. |
157 |
|
|
158 |
< |
/** |
176 |
< |
* Registers a creator with a type identifier |
177 |
< |
* @return true if registration is successful, otherwise return false |
178 |
< |
* @id the identification of the concrete object |
179 |
< |
* @creator the object responsible to create the concrete object |
180 |
< |
*/ |
181 |
< |
bool registerIntegrator(IntegratorCreator* creator); |
158 |
> |
\begin{lstlisting}[float,caption={[The implementation of Parameterized Factory pattern (I)]Source code of IntegratorFactory class.},label={appendixScheme:factoryDeclaration}] |
159 |
|
|
160 |
< |
/** |
161 |
< |
* Looks up the type identifier in the internal map. If it is found, it invokes the |
162 |
< |
* corresponding creator for the type identifier and returns its result. |
186 |
< |
* @return a pointer of the concrete object, return NULL if no creator is registed for |
187 |
< |
* creating this concrete object |
188 |
< |
* @param id the identification of the concrete object |
189 |
< |
*/ |
190 |
< |
Integrator* createIntegrator(const std::string& id, SimInfo* info); |
160 |
> |
class IntegratorFactory { |
161 |
> |
public: |
162 |
> |
typedef std::map<string, IntegratorCreator*> CreatorMapType; |
163 |
|
|
164 |
< |
private: |
165 |
< |
CreatorMapType creatorMap_; |
194 |
< |
}; |
195 |
< |
\end{lstlisting} |
196 |
< |
|
197 |
< |
\begin{lstlisting}[float,caption={[].},label={appendixScheme:factoryDeclarationImplementation}] |
198 |
< |
bool IntegratorFactory::unregisterIntegrator(const std::string& id) { |
199 |
< |
return creatorMap_.erase(id) == 1; |
164 |
> |
bool registerIntegrator(IntegratorCreator* creator) { |
165 |
> |
return creatorMap_.insert(creator->getIdent(), creator).second; |
166 |
|
} |
167 |
|
|
168 |
< |
Integrator* IntegratorFactory::createIntegrator(const std::string& id, SimInfo* info) { |
168 |
> |
Integrator* createIntegrator(const string& id, SimInfo* info) { |
169 |
> |
Integrator* result = NULL; |
170 |
|
CreatorMapType::iterator i = creatorMap_.find(id); |
171 |
|
if (i != creatorMap_.end()) { |
172 |
< |
//invoke functor to create object |
206 |
< |
return (i->second)->create(info); |
207 |
< |
} else { |
208 |
< |
return NULL; |
172 |
> |
result = (i->second)->create(info); |
173 |
|
} |
174 |
+ |
return result; |
175 |
|
} |
176 |
+ |
|
177 |
+ |
private: |
178 |
+ |
CreatorMapType creatorMap_; |
179 |
+ |
}; |
180 |
|
\end{lstlisting} |
181 |
|
|
182 |
< |
\begin{lstlisting}[float,caption={[].},label={appendixScheme:integratorCreator}] |
182 |
> |
\begin{lstlisting}[float,caption={[The implementation of Parameterized Factory pattern (III)]Source code of creator classes.},label={appendixScheme:integratorCreator}] |
183 |
|
|
184 |
< |
class IntegratorCreator { |
185 |
< |
public: |
186 |
< |
IntegratorCreator(const std::string& ident) : ident_(ident) {} |
218 |
< |
virtual ~IntegratorCreator() {} |
219 |
< |
const std::string& getIdent() const { return ident_; } |
184 |
> |
class IntegratorCreator { |
185 |
> |
public: |
186 |
> |
IntegratorCreator(const string& ident) : ident_(ident) {} |
187 |
|
|
188 |
+ |
const string& getIdent() const { return ident_; } |
189 |
+ |
|
190 |
|
virtual Integrator* create(SimInfo* info) const = 0; |
191 |
|
|
192 |
< |
private: |
193 |
< |
std::string ident_; |
194 |
< |
}; |
192 |
> |
private: |
193 |
> |
string ident_; |
194 |
> |
}; |
195 |
|
|
196 |
< |
template<class ConcreteIntegrator> |
197 |
< |
class IntegratorBuilder : public IntegratorCreator { |
198 |
< |
public: |
199 |
< |
IntegratorBuilder(const std::string& ident) : IntegratorCreator(ident) {} |
200 |
< |
virtual Integrator* create(SimInfo* info) const {return new ConcreteIntegrator(info);} |
201 |
< |
}; |
196 |
> |
template<class ConcreteIntegrator> |
197 |
> |
class IntegratorBuilder : public IntegratorCreator { |
198 |
> |
public: |
199 |
> |
IntegratorBuilder(const string& ident) |
200 |
> |
: IntegratorCreator(ident) {} |
201 |
> |
virtual Integrator* create(SimInfo* info) const { |
202 |
> |
return new ConcreteIntegrator(info); |
203 |
> |
} |
204 |
> |
}; |
205 |
|
\end{lstlisting} |
206 |
|
|
207 |
|
\subsection{\label{appendixSection:visitorPattern}Visitor} |
208 |
|
|
209 |
< |
The purpose of the Visitor Pattern is to encapsulate an operation |
210 |
< |
that you want to perform on the elements of a data structure. In |
211 |
< |
this way, you can change the operation being performed on a |
212 |
< |
structure without the need of changing the class heirarchy of the |
213 |
< |
elements that you are operating on. |
209 |
> |
The visitor pattern is designed to decouple the data structure and |
210 |
> |
algorithms used upon them by collecting related operation from |
211 |
> |
element classes into other visitor classes, which is equivalent to |
212 |
> |
adding virtual functions into a set of classes without modifying |
213 |
> |
their interfaces. Fig.~\ref{appendixFig:visitorUML} demonstrates the |
214 |
> |
structure of Visitor pattern which is used extensively in {\tt |
215 |
> |
Dump2XYZ}. In order to convert an OOPSE dump file, a series of |
216 |
> |
distinct operations are performed on different StuntDoubles (See the |
217 |
> |
class hierarchy in Fig.~\ref{oopseFig:hierarchy} and the declaration |
218 |
> |
in List.~\ref{appendixScheme:element}). Since the hierarchies |
219 |
> |
remains stable, it is easy to define a visit operation (see |
220 |
> |
List.~\ref{appendixScheme:visitor}) for each class of StuntDouble. |
221 |
> |
Note that using Composite pattern\cite{Gamma1994}, CompositVisitor |
222 |
> |
manages a priority visitor list and handles the execution of every |
223 |
> |
visitor in the priority list on different StuntDoubles. |
224 |
|
|
225 |
< |
\begin{lstlisting}[float,caption={[].},label={appendixScheme:visitor}] |
226 |
< |
class BaseVisitor{ |
227 |
< |
public: |
228 |
< |
virtual void visit(Atom* atom); |
229 |
< |
virtual void visit(DirectionalAtom* datom); |
230 |
< |
virtual void visit(RigidBody* rb); |
231 |
< |
}; |
225 |
> |
\begin{figure} |
226 |
> |
\centering |
227 |
> |
\includegraphics[width=\linewidth]{visitor.eps} |
228 |
> |
\caption[The UML class diagram of Visitor patten] {The UML class |
229 |
> |
diagram of Visitor patten.} \label{appendixFig:visitorUML} |
230 |
> |
\end{figure} |
231 |
> |
|
232 |
> |
\begin{figure} |
233 |
> |
\centering |
234 |
> |
\includegraphics[width=\linewidth]{hierarchy.eps} |
235 |
> |
\caption[Class hierarchy for ojects in {\sc OOPSE}]{ A diagram of |
236 |
> |
the class hierarchy. } \label{oopseFig:hierarchy} |
237 |
> |
\end{figure} |
238 |
> |
|
239 |
> |
\begin{lstlisting}[float,caption={[The implementation of Visitor pattern (II)]Source code of the element classes.},label={appendixScheme:element}] |
240 |
> |
|
241 |
> |
class StuntDouble { public: |
242 |
> |
virtual void accept(BaseVisitor* v) = 0; |
243 |
> |
}; |
244 |
> |
|
245 |
> |
class Atom: public StuntDouble { public: |
246 |
> |
virtual void accept{BaseVisitor* v*} { |
247 |
> |
v->visit(this); |
248 |
> |
} |
249 |
> |
}; |
250 |
> |
|
251 |
> |
class DirectionalAtom: public Atom { public: |
252 |
> |
virtual void accept{BaseVisitor* v*} { |
253 |
> |
v->visit(this); |
254 |
> |
} |
255 |
> |
}; |
256 |
> |
|
257 |
> |
class RigidBody: public StuntDouble { public: |
258 |
> |
virtual void accept{BaseVisitor* v*} { |
259 |
> |
v->visit(this); |
260 |
> |
} |
261 |
> |
}; |
262 |
> |
|
263 |
|
\end{lstlisting} |
251 |
– |
\begin{lstlisting}[float,caption={[].},label={appendixScheme:element}] |
252 |
– |
class StuntDouble { |
253 |
– |
public: |
254 |
– |
virtual void accept(BaseVisitor* v) = 0; |
255 |
– |
}; |
264 |
|
|
265 |
< |
class Atom: public StuntDouble { |
258 |
< |
public: |
259 |
< |
virtual void accept{BaseVisitor* v*} {v->visit(this);} |
260 |
< |
}; |
265 |
> |
\begin{lstlisting}[float,caption={[The implementation of Visitor pattern (I)]Source code of the visitor classes.},label={appendixScheme:visitor}] |
266 |
|
|
267 |
< |
class DirectionalAtom: public Atom { |
268 |
< |
public: |
269 |
< |
virtual void accept{BaseVisitor* v*} {v->visit(this);} |
270 |
< |
}; |
267 |
> |
class BaseVisitor{ |
268 |
> |
public: |
269 |
> |
virtual void visit(Atom* atom); |
270 |
> |
virtual void visit(DirectionalAtom* datom); |
271 |
> |
virtual void visit(RigidBody* rb); |
272 |
> |
}; |
273 |
|
|
274 |
< |
class RigidBody: public StuntDouble { |
275 |
< |
public: |
276 |
< |
virtual void accept{BaseVisitor* v*} {v->visit(this);} |
277 |
< |
}; |
274 |
> |
class BaseAtomVisitor:public BaseVisitor{ public: |
275 |
> |
virtual void visit(Atom* atom); |
276 |
> |
virtual void visit(DirectionalAtom* datom); |
277 |
> |
virtual void visit(RigidBody* rb); |
278 |
> |
}; |
279 |
> |
|
280 |
> |
class SSDAtomVisitor:public BaseAtomVisitor{ public: |
281 |
> |
virtual void visit(Atom* atom); |
282 |
> |
virtual void visit(DirectionalAtom* datom); |
283 |
> |
virtual void visit(RigidBody* rb); |
284 |
> |
}; |
285 |
> |
|
286 |
> |
class CompositeVisitor: public BaseVisitor { |
287 |
> |
public: |
288 |
> |
|
289 |
> |
typedef list<pair<BaseVisitor*, int> > VistorListType; |
290 |
> |
typedef VistorListType::iterator VisitorListIterator; |
291 |
> |
virtual void visit(Atom* atom) { |
292 |
> |
VisitorListIterator i; |
293 |
> |
BaseVisitor* curVisitor; |
294 |
> |
for(i = visitorList.begin();i != visitorList.end();++i) { |
295 |
> |
atom->accept(*i); |
296 |
> |
} |
297 |
> |
} |
298 |
> |
|
299 |
> |
virtual void visit(DirectionalAtom* datom) { |
300 |
> |
VisitorListIterator i; |
301 |
> |
BaseVisitor* curVisitor; |
302 |
> |
for(i = visitorList.begin();i != visitorList.end();++i) { |
303 |
> |
atom->accept(*i); |
304 |
> |
} |
305 |
> |
} |
306 |
> |
|
307 |
> |
virtual void visit(RigidBody* rb) { |
308 |
> |
VisitorListIterator i; |
309 |
> |
std::vector<Atom*> myAtoms; |
310 |
> |
std::vector<Atom*>::iterator ai; |
311 |
> |
myAtoms = rb->getAtoms(); |
312 |
> |
for(i = visitorList.begin();i != visitorList.end();++i) {{ |
313 |
> |
rb->accept(*i); |
314 |
> |
for(ai = myAtoms.begin(); ai != myAtoms.end(); ++ai){ |
315 |
> |
(*ai)->accept(*i); |
316 |
> |
} |
317 |
> |
} |
318 |
|
|
319 |
+ |
void addVisitor(BaseVisitor* v, int priority); |
320 |
+ |
|
321 |
+ |
protected: |
322 |
+ |
VistorListType visitorList; |
323 |
+ |
}; |
324 |
+ |
|
325 |
|
\end{lstlisting} |
326 |
+ |
|
327 |
|
\section{\label{appendixSection:concepts}Concepts} |
328 |
|
|
329 |
|
OOPSE manipulates both traditional atoms as well as some objects |
330 |
|
that {\it behave like atoms}. These objects can be rigid |
331 |
|
collections of atoms or atoms which have orientational degrees of |
332 |
< |
freedom. Here is a diagram of the class heirarchy: |
333 |
< |
|
334 |
< |
%\begin{figure} |
335 |
< |
%\centering |
336 |
< |
%\includegraphics[width=3in]{heirarchy.eps} |
337 |
< |
%\caption[Class heirarchy for StuntDoubles in {\sc oopse}-3.0]{ \\ |
338 |
< |
%The class heirarchy of StuntDoubles in {\sc oopse}-3.0. The |
339 |
< |
%selection syntax allows the user to select any of the objects that |
340 |
< |
%are descended from a StuntDouble.} \label{oopseFig:heirarchy} |
287 |
< |
%\end{figure} |
288 |
< |
|
332 |
> |
freedom. A diagram of the class hierarchy is illustrated in |
333 |
> |
Fig.~\ref{oopseFig:hierarchy}. Every Molecule, Atom and |
334 |
> |
DirectionalAtom in {\sc OOPSE} have their own names which are |
335 |
> |
specified in the {\tt .md} file. In contrast, RigidBodies are |
336 |
> |
denoted by their membership and index inside a particular molecule: |
337 |
> |
[MoleculeName]\_RB\_[index] (the contents inside the brackets depend |
338 |
> |
on the specifics of the simulation). The names of rigid bodies are |
339 |
> |
generated automatically. For example, the name of the first rigid |
340 |
> |
body in a DMPC molecule is DMPC\_RB\_0. |
341 |
|
\begin{itemize} |
342 |
|
\item A {\bf StuntDouble} is {\it any} object that can be manipulated by the |
343 |
|
integrators and minimizers. |
347 |
|
DirectionalAtom}s which behaves as a single unit. |
348 |
|
\end{itemize} |
349 |
|
|
298 |
– |
Every Molecule, Atom and DirectionalAtom in {\sc OOPSE} have their |
299 |
– |
own names which are specified in the {\tt .md} file. In contrast, |
300 |
– |
RigidBodies are denoted by their membership and index inside a |
301 |
– |
particular molecule: [MoleculeName]\_RB\_[index] (the contents |
302 |
– |
inside the brackets depend on the specifics of the simulation). The |
303 |
– |
names of rigid bodies are generated automatically. For example, the |
304 |
– |
name of the first rigid body in a DMPC molecule is DMPC\_RB\_0. |
305 |
– |
|
350 |
|
\section{\label{appendixSection:syntax}Syntax of the Select Command} |
351 |
|
|
352 |
< |
The most general form of the select command is: {\tt select {\it |
353 |
< |
expression}}. This expression represents an arbitrary set of |
354 |
< |
StuntDoubles (Atoms or RigidBodies) in {\sc OOPSE}. Expressions are |
355 |
< |
composed of either name expressions, index expressions, predefined |
356 |
< |
sets, user-defined expressions, comparison operators, within |
357 |
< |
expressions, or logical combinations of the above expression types. |
358 |
< |
Expressions can be combined using parentheses and the Boolean |
359 |
< |
operators. |
352 |
> |
{\sc OOPSE} provides a powerful selection utility to select |
353 |
> |
StuntDoubles. The most general form of the select command is: |
354 |
> |
|
355 |
> |
{\tt select {\it expression}}. |
356 |
> |
|
357 |
> |
This expression represents an arbitrary set of StuntDoubles (Atoms |
358 |
> |
or RigidBodies) in {\sc OOPSE}. Expressions are composed of either |
359 |
> |
name expressions, index expressions, predefined sets, user-defined |
360 |
> |
expressions, comparison operators, within expressions, or logical |
361 |
> |
combinations of the above expression types. Expressions can be |
362 |
> |
combined using parentheses and the Boolean operators. |
363 |
|
|
364 |
|
\subsection{\label{appendixSection:logical}Logical expressions} |
365 |
|
|
492 |
|
and other atoms of type $B$, $g_{AB}(r)$. {\tt StaticProps} can |
493 |
|
also be used to compute the density distributions of other molecules |
494 |
|
in a reference frame {\it fixed to the body-fixed reference frame} |
495 |
< |
of a selected atom or rigid body. |
495 |
> |
of a selected atom or rigid body. Due to the fact that the selected |
496 |
> |
StuntDoubles from two selections may be overlapped, {\tt |
497 |
> |
StaticProps} performs the calculation in three stages which are |
498 |
> |
illustrated in Fig.~\ref{oopseFig:staticPropsProcess}. |
499 |
|
|
500 |
+ |
\begin{figure} |
501 |
+ |
\centering |
502 |
+ |
\includegraphics[width=\linewidth]{staticPropsProcess.eps} |
503 |
+ |
\caption[A representation of the three-stage correlations in |
504 |
+ |
\texttt{StaticProps}]{This diagram illustrates three-stage |
505 |
+ |
processing used by \texttt{StaticProps}. $S_1$ and $S_2$ are the |
506 |
+ |
numbers of selected stuntdobules from {\tt -{}-sele1} and {\tt |
507 |
+ |
-{}-sele2} respectively, while $C$ is the number of stuntdobules |
508 |
+ |
appearing at both sets. The first stage($S_1-C$ and $S_2$) and |
509 |
+ |
second stages ($S_1$ and $S_2-C$) are completely non-overlapping. On |
510 |
+ |
the contrary, the third stage($C$ and $C$) are completely |
511 |
+ |
overlapping} \label{oopseFig:staticPropsProcess} |
512 |
+ |
\end{figure} |
513 |
+ |
|
514 |
|
There are five seperate radial distribution functions availiable in |
515 |
|
OOPSE. Since every radial distrbution function invlove the |
516 |
|
calculation between pairs of bodies, {\tt -{}-sele1} and {\tt |
554 |
|
\end{description} |
555 |
|
|
556 |
|
The vectors (and angles) associated with these angular pair |
557 |
< |
distribution functions are most easily seen in the figure below: |
557 |
> |
distribution functions are most easily seen in |
558 |
> |
Fig.~\ref{oopseFig:gofr} |
559 |
|
|
560 |
|
\begin{figure} |
561 |
|
\centering |
566 |
|
their body-fixed frames.} \label{oopseFig:gofr} |
567 |
|
\end{figure} |
568 |
|
|
504 |
– |
Due to the fact that the selected StuntDoubles from two selections |
505 |
– |
may be overlapped, {\tt StaticProps} performs the calculation in |
506 |
– |
three stages which are illustrated in |
507 |
– |
Fig.~\ref{oopseFig:staticPropsProcess}. |
508 |
– |
|
509 |
– |
\begin{figure} |
510 |
– |
\centering |
511 |
– |
\includegraphics[width=\linewidth]{staticPropsProcess.eps} |
512 |
– |
\caption[A representation of the three-stage correlations in |
513 |
– |
\texttt{StaticProps}]{This diagram illustrates three-stage |
514 |
– |
processing used by \texttt{StaticProps}. $S_1$ and $S_2$ are the |
515 |
– |
numbers of selected stuntdobules from {\tt -{}-sele1} and {\tt |
516 |
– |
-{}-sele2} respectively, while $C$ is the number of stuntdobules |
517 |
– |
appearing at both sets. The first stage($S_1-C$ and $S_2$) and |
518 |
– |
second stages ($S_1$ and $S_2-C$) are completely non-overlapping. On |
519 |
– |
the contrary, the third stage($C$ and $C$) are completely |
520 |
– |
overlapping} \label{oopseFig:staticPropsProcess} |
521 |
– |
\end{figure} |
522 |
– |
|
569 |
|
The options available for {\tt StaticProps} are as follows: |
570 |
|
\begin{longtable}[c]{|EFG|} |
571 |
|
\caption{StaticProps Command-line Options} |
628 |
|
select different types of atoms is already present in the code. |
629 |
|
|
630 |
|
For large simulations, the trajectory files can sometimes reach |
631 |
< |
sizes in excess of several gigabytes. In order to effectively |
632 |
< |
analyze that amount of data. In order to prevent a situation where |
633 |
< |
the program runs out of memory due to large trajectories, |
634 |
< |
\texttt{dynamicProps} will estimate the size of free memory at |
635 |
< |
first, and determine the number of frames in each block, which |
590 |
< |
allows the operating system to load two blocks of data |
631 |
> |
sizes in excess of several gigabytes. In order to prevent a |
632 |
> |
situation where the program runs out of memory due to large |
633 |
> |
trajectories, \texttt{dynamicProps} will estimate the size of free |
634 |
> |
memory at first, and determine the number of frames in each block, |
635 |
> |
which allows the operating system to load two blocks of data |
636 |
|
simultaneously without swapping. Upon reading two blocks of the |
637 |
|
trajectory, \texttt{dynamicProps} will calculate the time |
638 |
|
correlation within the first block and the cross correlations |