ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/tengDissertation/Appendix.tex
Revision: 2789
Committed: Mon Jun 5 21:00:46 2006 UTC (18 years ago) by tim
Content type: application/x-tex
File size: 20070 byte(s)
Log Message:
fix  reference problem

File Contents

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