ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/tengDissertation/Appendix.tex
Revision: 2806
Committed: Tue Jun 6 20:49:05 2006 UTC (18 years ago) by tim
Content type: application/x-tex
File size: 20089 byte(s)
Log Message:
change the size of figure

File Contents

# User Rev Content
1 tim 2805 \appendix
2 tim 2685 \chapter{\label{chapt:appendix}APPENDIX}
3    
4 tim 2688 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{wilson}. For instance, in the
8     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    
18 tim 2685 \section{\label{appendixSection:desginPattern}Design Pattern}
19    
20 tim 2688 Design patterns are optimal solutions to commonly-occurring problems
21     in software design. Although originated as an architectural concept
22     for buildings and towns by Christopher Alexander \cite{alexander},
23     software patterns first became popular with the wide acceptance of
24     the book, Design Patterns: Elements of Reusable Object-Oriented
25     Software \cite{gamma94}. Patterns reflect the experience, knowledge
26     and insights of developers who have successfully used these patterns
27     in their own work. Patterns are reusable. They provide a ready-made
28     solution that can be adapted to different problems as necessary.
29     Pattern are expressive. they provide a common vocabulary of
30     solutions that can express large solutions succinctly.
31 tim 2685
32 tim 2688 Patterns are usually described using a format that includes the
33     following information:
34     \begin{enumerate}
35     \item The \emph{name} that is commonly used for the pattern. Good pattern names form a vocabulary for
36     discussing conceptual abstractions. a pattern may have more than one commonly used or recognizable name
37     in the literature. In this case it is common practice to document these nicknames or synonyms under
38     the heading of \emph{Aliases} or \emph{Also Known As}.
39     \item The \emph{motivation} or \emph{context} that this pattern applies
40     to. Sometimes, it will include some prerequisites that should be satisfied before deciding to use a pattern
41     \item The \emph{solution} to the problem that the pattern
42     addresses. It describes how to construct the necessary work products. The description may include
43     pictures, diagrams and prose which identify the pattern's structure, its participants, and their
44     collaborations, to show how the problem is solved.
45     \item The \emph{consequences} of using the given solution to solve a
46     problem, both positive and negative.
47     \end{enumerate}
48 tim 2685
49 tim 2688 As one of the latest advanced techniques emerged from
50     object-oriented community, design patterns were applied in some of
51     the modern scientific software applications, such as JMol, OOPSE
52 tim 2693 \cite{Meineke05} and PROTOMOL \cite{Matthey05} \textit{etc}.
53 tim 2685
54 tim 2693 \subsection{\label{appendixSection:singleton}Singleton}
55     The Singleton pattern ensures that only one instance of a class is
56     created. All objects that use an instance of that class use the same
57     instance.
58    
59 tim 2688 \subsection{\label{appendixSection:factoryMethod}Factory Method}
60     The Factory Method pattern is a creational pattern which deals with
61     the problem of creating objects without specifying the exact class
62     of object that will be created. Factory Method solves this problem
63     by defining a separate method for creating the objects, which
64     subclasses can then override to specify the derived type of product
65     that will be created.
66 tim 2685
67    
68 tim 2688 \subsection{\label{appendixSection:visitorPattern}Visitor}
69     The purpose of the Visitor Pattern is to encapsulate an operation
70     that you want to perform on the elements of a data structure. In
71     this way, you can change the operation being performed on a
72     structure without the need of changing the classes of the elements
73     that you are operating on.
74 tim 2685
75    
76 tim 2688 \subsection{\label{appendixSection:templateMethod}Template Method}
77    
78 tim 2685 \section{\label{appendixSection:analysisFramework}Analysis Framework}
79    
80 tim 2730 \section{\label{appendixSection:concepts}Concepts}
81 tim 2685
82 tim 2730 OOPSE manipulates both traditional atoms as well as some objects
83     that {\it behave like atoms}. These objects can be rigid
84     collections of atoms or atoms which have orientational degrees of
85     freedom. Here is a diagram of the class heirarchy:
86 tim 2688
87 tim 2806 %\begin{figure}
88     %\centering
89     %\includegraphics[width=3in]{heirarchy.eps}
90     %\caption[Class heirarchy for StuntDoubles in {\sc oopse}-3.0]{ \\
91     %The class heirarchy of StuntDoubles in {\sc oopse}-3.0. The
92     %selection syntax allows the user to select any of the objects that
93     %are descended from a StuntDouble.} \label{oopseFig:heirarchy}
94     %\end{figure}
95 tim 2688
96 tim 2730 \begin{itemize}
97     \item A {\bf StuntDouble} is {\it any} object that can be manipulated by the
98     integrators and minimizers.
99     \item An {\bf Atom} is a fundamental point-particle that can be moved around during a simulation.
100     \item A {\bf DirectionalAtom} is an atom which has {\it orientational} as well as translational degrees of freedom.
101     \item A {\bf RigidBody} is a collection of {\bf Atom}s or {\bf
102     DirectionalAtom}s which behaves as a single unit.
103     \end{itemize}
104 tim 2688
105 tim 2730 Every Molecule, Atom and DirectionalAtom in {\sc oopse} have their
106     own names which are specified in the {\tt .md} file. In contrast,
107     RigidBodies are denoted by their membership and index inside a
108     particular molecule: [MoleculeName]\_RB\_[index] (the contents
109     inside the brackets depend on the specifics of the simulation). The
110     names of rigid bodies are generated automatically. For example, the
111     name of the first rigid body in a DMPC molecule is DMPC\_RB\_0.
112    
113     \section{\label{appendixSection:syntax}Syntax of the Select Command}
114    
115     The most general form of the select command is: {\tt select {\it
116     expression}}
117    
118     This expression represents an arbitrary set of StuntDoubles (Atoms
119     or RigidBodies) in {\sc oopse}. Expressions are composed of either
120     name expressions, index expressions, predefined sets, user-defined
121     expressions, comparison operators, within expressions, or logical
122     combinations of the above expression types. Expressions can be
123     combined using parentheses and the Boolean operators.
124    
125     \subsection{\label{appendixSection:logical}Logical expressions}
126    
127     The logical operators allow complex queries to be constructed out of
128     simpler ones using the standard boolean connectives {\bf and}, {\bf
129     or}, {\bf not}. Parentheses can be used to alter the precedence of
130     the operators.
131    
132     \begin{center}
133     \begin{tabular}{|ll|}
134     \hline
135     {\bf logical operator} & {\bf equivalent operator} \\
136     \hline
137     and & ``\&'', ``\&\&'' \\
138     or & ``$|$'', ``$||$'', ``,'' \\
139     not & ``!'' \\
140     \hline
141     \end{tabular}
142     \end{center}
143    
144     \subsection{\label{appendixSection:name}Name expressions}
145    
146     \begin{center}
147 tim 2805 \begin{tabular}{|llp{2in}|}
148 tim 2730 \hline {\bf type of expression} & {\bf examples} & {\bf translation
149     of
150     examples} \\
151     \hline expression without ``.'' & select DMPC & select all
152     StuntDoubles
153     belonging to all DMPC molecules \\
154     & select C* & select all atoms which have atom types beginning with C
155     \\
156     & select DMPC\_RB\_* & select all RigidBodies in DMPC molecules (but
157     only select the rigid bodies, and not the atoms belonging to them). \\
158     \hline expression has one ``.'' & select TIP3P.O\_TIP3P & select the
159     O\_TIP3P
160     atoms belonging to TIP3P molecules \\
161     & select DMPC\_RB\_O.PO4 & select the PO4 atoms belonging to
162     the first
163     RigidBody in each DMPC molecule \\
164     & select DMPC.20 & select the twentieth StuntDouble in each DMPC
165     molecule \\
166     \hline expression has two ``.''s & select DMPC.DMPC\_RB\_?.* &
167     select all atoms
168     belonging to all rigid bodies within all DMPC molecules \\
169     \hline
170     \end{tabular}
171     \end{center}
172    
173     \subsection{\label{appendixSection:index}Index expressions}
174    
175     \begin{center}
176     \begin{tabular}{|lp{4in}|}
177     \hline
178     {\bf examples} & {\bf translation of examples} \\
179     \hline
180     select 20 & select all of the StuntDoubles belonging to Molecule 20 \\
181     select 20 to 30 & select all of the StuntDoubles belonging to
182     molecules which have global indices between 20 (inclusive) and 30
183     (exclusive) \\
184     \hline
185     \end{tabular}
186     \end{center}
187    
188     \subsection{\label{appendixSection:predefined}Predefined sets}
189    
190     \begin{center}
191     \begin{tabular}{|ll|}
192     \hline
193     {\bf keyword} & {\bf description} \\
194     \hline
195     all & select all StuntDoubles \\
196     none & select none of the StuntDoubles \\
197     \hline
198     \end{tabular}
199     \end{center}
200    
201     \subsection{\label{appendixSection:userdefined}User-defined expressions}
202    
203     Users can define arbitrary terms to represent groups of
204     StuntDoubles, and then use the define terms in select commands. The
205     general form for the define command is: {\bf define {\it term
206     expression}}
207    
208     Once defined, the user can specify such terms in boolean expressions
209    
210     {\tt define SSDWATER SSD or SSD1 or SSDRF}
211    
212     {\tt select SSDWATER}
213    
214     \subsection{\label{appendixSection:comparison}Comparison expressions}
215    
216     StuntDoubles can be selected by using comparision operators on their
217     properties. The general form for the comparison command is: a
218     property name, followed by a comparision operator and then a number.
219    
220     \begin{center}
221     \begin{tabular}{|l|l|}
222     \hline
223     {\bf property} & mass, charge \\
224     {\bf comparison operator} & ``$>$'', ``$<$'', ``$=$'', ``$>=$'',
225     ``$<=$'', ``$!=$'' \\
226     \hline
227     \end{tabular}
228     \end{center}
229    
230     For example, the phrase {\tt select mass > 16.0 and charge < -2}
231 tim 2805 would select StuntDoubles which have mass greater than 16.0 and
232 tim 2730 charges less than -2.
233    
234     \subsection{\label{appendixSection:within}Within expressions}
235    
236     The ``within'' keyword allows the user to select all StuntDoubles
237     within the specified distance (in Angstroms) from a selection,
238     including the selected atom itself. The general form for within
239     selection is: {\tt select within(distance, expression)}
240    
241     For example, the phrase {\tt select within(2.5, PO4 or NC4)} would
242     select all StuntDoubles which are within 2.5 angstroms of PO4 or NC4
243     atoms.
244    
245     \section{\label{appendixSection:tools}Tools which use the selection command}
246    
247     \subsection{\label{appendixSection:Dump2XYZ}Dump2XYZ}
248    
249     Dump2XYZ can transform an OOPSE dump file into a xyz file which can
250     be opened by other molecular dynamics viewers such as Jmol and VMD.
251     The options available for Dump2XYZ are as follows:
252    
253    
254     \begin{longtable}[c]{|EFG|}
255     \caption{Dump2XYZ Command-line Options}
256     \\ \hline
257     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
258     \endhead
259     \hline
260     \endfoot
261     -h & {\tt -{}-help} & Print help and exit \\
262     -V & {\tt -{}-version} & Print version and exit \\
263     -i & {\tt -{}-input=filename} & input dump file \\
264     -o & {\tt -{}-output=filename} & output file name \\
265     -n & {\tt -{}-frame=INT} & print every n frame (default=`1') \\
266     -w & {\tt -{}-water} & skip the the waters (default=off) \\
267     -m & {\tt -{}-periodicBox} & map to the periodic box (default=off)\\
268     -z & {\tt -{}-zconstraint} & replace the atom types of zconstraint molecules (default=off) \\
269     -r & {\tt -{}-rigidbody} & add a pseudo COM atom to rigidbody (default=off) \\
270     -t & {\tt -{}-watertype} & replace the atom type of water model (default=on) \\
271     -b & {\tt -{}-basetype} & using base atom type (default=off) \\
272     & {\tt -{}-repeatX=INT} & The number of images to repeat in the x direction (default=`0') \\
273     & {\tt -{}-repeatY=INT} & The number of images to repeat in the y direction (default=`0') \\
274     & {\tt -{}-repeatZ=INT} & The number of images to repeat in the z direction (default=`0') \\
275     -s & {\tt -{}-selection=selection script} & By specifying {\tt -{}-selection}=``selection command'' with Dump2XYZ, the user can select an arbitrary set of StuntDoubles to be
276     converted. \\
277     & {\tt -{}-originsele} & By specifying {\tt -{}-originsele}=``selection command'' with Dump2XYZ, the user can re-center the origin of the system around a specific StuntDouble \\
278     & {\tt -{}-refsele} & In order to rotate the system, {\tt -{}-originsele} and {\tt -{}-refsele} must be given to define the new coordinate set. A StuntDouble which contains a dipole (the direction of the dipole is always (0, 0, 1) in body frame) is specified by {\tt -{}-originsele}. The new x-z plane is defined by the direction of the dipole and the StuntDouble is specified by {\tt -{}-refsele}.
279     \end{longtable}
280    
281    
282     \subsection{\label{appendixSection:StaticProps}StaticProps}
283    
284     {\tt StaticProps} can compute properties which are averaged over
285     some or all of the configurations that are contained within a dump
286     file. The most common example of a static property that can be
287     computed is the pair distribution function between atoms of type $A$
288     and other atoms of type $B$, $g_{AB}(r)$. StaticProps can also be
289     used to compute the density distributions of other molecules in a
290     reference frame {\it fixed to the body-fixed reference frame} of a
291     selected atom or rigid body.
292    
293     There are five seperate radial distribution functions availiable in
294     OOPSE. Since every radial distrbution function invlove the
295     calculation between pairs of bodies, {\tt -{}-sele1} and {\tt
296     -{}-sele2} must be specified to tell StaticProps which bodies to
297     include in the calculation.
298    
299     \begin{description}
300     \item[{\tt -{}-gofr}] Computes the pair distribution function,
301     \begin{equation*}
302     g_{AB}(r) = \frac{1}{\rho_B}\frac{1}{N_A} \langle \sum_{i \in A}
303     \sum_{j \in B} \delta(r - r_{ij}) \rangle
304     \end{equation*}
305     \item[{\tt -{}-r\_theta}] Computes the angle-dependent pair distribution
306     function. The angle is defined by the intermolecular vector
307     $\vec{r}$ and $z$-axis of DirectionalAtom A,
308     \begin{equation*}
309     g_{AB}(r, \cos \theta) = \frac{1}{\rho_B}\frac{1}{N_A} \langle
310     \sum_{i \in A} \sum_{j \in B} \delta(r - r_{ij}) \delta(\cos
311     \theta_{ij} - \cos \theta)\rangle
312     \end{equation*}
313     \item[{\tt -{}-r\_omega}] Computes the angle-dependent pair distribution
314     function. The angle is defined by the $z$-axes of the two
315     DirectionalAtoms A and B.
316     \begin{equation*}
317     g_{AB}(r, \cos \omega) = \frac{1}{\rho_B}\frac{1}{N_A} \langle
318     \sum_{i \in A} \sum_{j \in B} \delta(r - r_{ij}) \delta(\cos
319     \omega_{ij} - \cos \omega)\rangle
320     \end{equation*}
321     \item[{\tt -{}-theta\_omega}] Computes the pair distribution in the angular
322     space $\theta, \omega$ defined by the two angles mentioned above.
323     \begin{equation*}
324     g_{AB}(\cos\theta, \cos \omega) = \frac{1}{\rho_B}\frac{1}{N_A}
325     \langle \sum_{i \in A} \sum_{j \in B} \langle \delta(\cos
326     \theta_{ij} - \cos \theta) \delta(\cos \omega_{ij} - \cos
327     \omega)\rangle
328     \end{equation*}
329     \item[{\tt -{}-gxyz}] Calculates the density distribution of particles of type
330     B in the body frame of particle A. Therefore, {\tt -{}-originsele}
331     and {\tt -{}-refsele} must be given to define A's internal
332     coordinate set as the reference frame for the calculation.
333     \end{description}
334    
335     The vectors (and angles) associated with these angular pair
336     distribution functions are most easily seen in the figure below:
337    
338     \begin{figure}
339     \centering
340 tim 2805 \includegraphics[width=3in]{definition.eps}
341 tim 2730 \caption[Definitions of the angles between directional objects]{ \\
342     Any two directional objects (DirectionalAtoms and RigidBodies) have
343     a set of two angles ($\theta$, and $\omega$) between the z-axes of
344     their body-fixed frames.} \label{oopseFig:gofr}
345     \end{figure}
346    
347     The options available for {\tt StaticProps} are as follows:
348     \begin{longtable}[c]{|EFG|}
349     \caption{StaticProps Command-line Options}
350     \\ \hline
351     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
352     \endhead
353     \hline
354     \endfoot
355     -h& {\tt -{}-help} & Print help and exit \\
356     -V& {\tt -{}-version} & Print version and exit \\
357     -i& {\tt -{}-input=filename} & input dump file \\
358     -o& {\tt -{}-output=filename} & output file name \\
359     -n& {\tt -{}-step=INT} & process every n frame (default=`1') \\
360     -r& {\tt -{}-nrbins=INT} & number of bins for distance (default=`100') \\
361     -a& {\tt -{}-nanglebins=INT} & number of bins for cos(angle) (default= `50') \\
362     -l& {\tt -{}-length=DOUBLE} & maximum length (Defaults to 1/2 smallest length of first frame) \\
363     & {\tt -{}-sele1=selection script} & select the first StuntDouble set \\
364     & {\tt -{}-sele2=selection script} & select the second StuntDouble set \\
365     & {\tt -{}-sele3=selection script} & select the third StuntDouble set \\
366     & {\tt -{}-refsele=selection script} & select reference (can only be used with {\tt -{}-gxyz}) \\
367     & {\tt -{}-molname=STRING} & molecule name \\
368     & {\tt -{}-begin=INT} & begin internal index \\
369     & {\tt -{}-end=INT} & end internal index \\
370     \hline
371     \multicolumn{3}{|l|}{One option from the following group of options is required:} \\
372     \hline
373     & {\tt -{}-gofr} & $g(r)$ \\
374     & {\tt -{}-r\_theta} & $g(r, \cos(\theta))$ \\
375     & {\tt -{}-r\_omega} & $g(r, \cos(\omega))$ \\
376     & {\tt -{}-theta\_omega} & $g(\cos(\theta), \cos(\omega))$ \\
377     & {\tt -{}-gxyz} & $g(x, y, z)$ \\
378     & {\tt -{}-p2} & $P_2$ order parameter ({\tt -{}-sele1} and {\tt -{}-sele2} must be specified) \\
379     & {\tt -{}-scd} & $S_{CD}$ order parameter(either {\tt -{}-sele1}, {\tt -{}-sele2}, {\tt -{}-sele3} are specified or {\tt -{}-molname}, {\tt -{}-begin}, {\tt -{}-end} are specified) \\
380     & {\tt -{}-density} & density plot ({\tt -{}-sele1} must be specified) \\
381     & {\tt -{}-slab\_density} & slab density ({\tt -{}-sele1} must be specified)
382     \end{longtable}
383    
384     \subsection{\label{appendixSection:DynamicProps}DynamicProps}
385    
386     {\tt DynamicProps} computes time correlation functions from the
387     configurations stored in a dump file. Typical examples of time
388     correlation functions are the mean square displacement and the
389     velocity autocorrelation functions. Once again, the selection
390     syntax can be used to specify the StuntDoubles that will be used for
391     the calculation. A general time correlation function can be thought
392     of as:
393     \begin{equation}
394     C_{AB}(t) = \langle \vec{u}_A(t) \cdot \vec{v}_B(0) \rangle
395     \end{equation}
396     where $\vec{u}_A(t)$ is a vector property associated with an atom of
397     type $A$ at time $t$, and $\vec{v}_B(t^{\prime})$ is a different
398     vector property associated with an atom of type $B$ at a different
399     time $t^{\prime}$. In most autocorrelation functions, the vector
400     properties ($\vec{v}$ and $\vec{u}$) and the types of atoms ($A$ and
401     $B$) are identical, and the three calculations built in to {\tt
402     DynamicProps} make these assumptions. It is possible, however, to
403     make simple modifications to the {\tt DynamicProps} code to allow
404     the use of {\it cross} time correlation functions (i.e. with
405     different vectors). The ability to use two selection scripts to
406     select different types of atoms is already present in the code.
407    
408     The options available for DynamicProps are as follows:
409     \begin{longtable}[c]{|EFG|}
410     \caption{DynamicProps Command-line Options}
411     \\ \hline
412     {\bf option} & {\bf verbose option} & {\bf behavior} \\ \hline
413     \endhead
414     \hline
415     \endfoot
416     -h& {\tt -{}-help} & Print help and exit \\
417     -V& {\tt -{}-version} & Print version and exit \\
418     -i& {\tt -{}-input=filename} & input dump file \\
419     -o& {\tt -{}-output=filename} & output file name \\
420     & {\tt -{}-sele1=selection script} & select first StuntDouble set \\
421     & {\tt -{}-sele2=selection script} & select second StuntDouble set (if sele2 is not set, use script from sele1) \\
422     \hline
423     \multicolumn{3}{|l|}{One option from the following group of options is required:} \\
424     \hline
425     -r& {\tt -{}-rcorr} & compute mean square displacement \\
426     -v& {\tt -{}-vcorr} & compute velocity correlation function \\
427     -d& {\tt -{}-dcorr} & compute dipole correlation function
428     \end{longtable}
429    
430     \subsection{\label{appendixSection:hydrodynamics}Hydrodynamics}