ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/primitives/Molecule.hpp
(Generate patch)

Comparing:
trunk/src/primitives/Molecule.hpp (file contents), Revision 963 by tim, Wed May 17 21:51:42 2006 UTC vs.
branches/development/src/primitives/Molecule.hpp (file contents), Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
35 + *                                                                      
36 + * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37 + * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 + * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 + * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 + * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   /**
# Line 58 | Line 59
59   #include "primitives/Bond.hpp"
60   #include "primitives/Bend.hpp"
61   #include "primitives/Torsion.hpp"
62 + #include "primitives/Inversion.hpp"
63   #include "primitives/CutoffGroup.hpp"
64 + #include "utils/PropertyMap.hpp"
65  
66 < namespace oopse{
66 > namespace OpenMD{
67  
68    class Constraint;
69  
# Line 75 | Line 78 | namespace oopse{
78      typedef std::vector<Bond*>::iterator BondIterator;
79      typedef std::vector<Bend*>::iterator BendIterator;
80      typedef std::vector<Torsion*>::iterator TorsionIterator;
81 +    typedef std::vector<Inversion*>::iterator InversionIterator;
82      typedef std::vector<RigidBody*>::iterator RigidBodyIterator;
83      typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator;
84 <    typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator;        
84 >    typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator;
85      typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator;
86      typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator;
87 <        
88 <
87 >    
88 >    
89      Molecule(int stampId, int globalIndex, const std::string& molName);
90      virtual ~Molecule();
91  
# Line 92 | Line 96 | namespace oopse{
96      int getGlobalIndex() {
97        return globalIndex_;
98      }
99 <
99 >    
100      /**
101       * Returns the stamp id of this molecule
102 <     * @note Ideally, every molecule should keep a pointer of its molecule stamp instead of its
103 <     * stamp id. However, the pointer will become invalid, if the molecule migrate to other processor.
102 >     * @note Ideally, every molecule should keep a pointer of its
103 >     * molecule stamp instead of its stamp id. However, the pointer
104 >     * will become invalid, if the molecule migrate to other
105 >     * processor.
106       */
107      int getStampId() {
108        return stampId_;
109      }
110 <
110 >    
111      /** Returns the name of the molecule */
112      std::string getType() {
113        return moleculeName_;
114      }
115 <        
115 >    
116      /**
117       * Sets the global index of this molecule.
118       * @param new global index to be set
# Line 114 | Line 120 | namespace oopse{
120      void setGlobalIndex(int index) {
121        globalIndex_ = index;
122      }
123 <
124 <        
123 >    
124 >    
125      /** add an atom into this molecule */
126      void addAtom(Atom* atom);
127 <
127 >    
128      /** add a bond into this molecule */
129      void addBond(Bond* bond);
130 <
130 >    
131      /** add a bend into this molecule */
132      void addBend(Bend* bend);
133 <
133 >    
134      /** add a torsion into this molecule*/
135      void addTorsion(Torsion* torsion);
136  
137 +    /** add an improper torsion into this molecule*/
138 +    void addInversion(Inversion* inversion);
139 +    
140      /** add a rigidbody into this molecule */
141      void addRigidBody(RigidBody *rb);
142 <
142 >    
143      /** add a cutoff group into this molecule */
144      void addCutoffGroup(CutoffGroup* cp);    
145 <
145 >    
146      void addConstraintPair(ConstraintPair* consPair);
147 <        
147 >    
148      void addConstraintElem(ConstraintElem* consElem);
149 <
149 >    
150      /** */
151      void complete();
152 <
152 >    
153      /** Returns the total number of atoms in this molecule */
154      unsigned int getNAtoms() {
155        return atoms_.size();
156      }
157 <
157 >    
158      /** Returns the total number of bonds in this molecule */        
159      unsigned int getNBonds(){
160        return bonds_.size();
161      }
162 <
162 >    
163      /** Returns the total number of bends in this molecule */        
164      unsigned int getNBends() {
165        return bends_.size();
166      }
167 <
167 >    
168      /** Returns the total number of torsions in this molecule */        
169      unsigned int getNTorsions() {
170        return torsions_.size();
171      }
172  
173 +    /** Returns the total number of improper torsions in this molecule */
174 +    unsigned int getNInversions() {
175 +      return inversions_.size();
176 +    }
177 +    
178      /** Returns the total number of rigid bodies in this molecule */        
179      unsigned int getNRigidBodies() {
180        return rigidBodies_.size();
181      }
182 <
182 >    
183      /** Returns the total number of integrable objects in this molecule */
184      unsigned int getNIntegrableObjects() {
185        return integrableObjects_.size();
186      }
187 <
187 >    
188      /** Returns the total number of cutoff groups in this molecule */
189      unsigned int getNCutoffGroups() {
190        return cutoffGroups_.size();
191      }
192 <
192 >    
193      /** Returns the total number of constraints in this molecule */
194      unsigned int getNConstraintPairs() {
195        return constraintPairs_.size();
196      }
197 <
197 >    
198      Atom* getAtomAt(unsigned int i) {
199        assert(i < atoms_.size());
200        return atoms_[i];
201      }
202 <
202 >    
203      RigidBody* getRigidBodyAt(unsigned int i) {
204        assert(i < rigidBodies_.size());
205        return rigidBodies_[i];
206      }
207 <        
207 >    
208      Atom* beginAtom(std::vector<Atom*>::iterator& i) {
209        i = atoms_.begin();
210        return (i == atoms_.end()) ? NULL : *i;
211      }
212 <
212 >    
213      Atom* nextAtom(std::vector<Atom*>::iterator& i) {
214        ++i;
215        return (i == atoms_.end()) ? NULL : *i;    
216      }
217 <
217 >    
218      Bond* beginBond(std::vector<Bond*>::iterator& i) {
219        i = bonds_.begin();
220        return (i == bonds_.end()) ? NULL : *i;
221      }
222 <
222 >    
223      Bond* nextBond(std::vector<Bond*>::iterator& i) {
224        ++i;
225        return (i == bonds_.end()) ? NULL : *i;    
226 <
226 >      
227      }
228 <
228 >    
229      Bend* beginBend(std::vector<Bend*>::iterator& i) {
230        i = bends_.begin();
231        return (i == bends_.end()) ? NULL : *i;
232      }
233 <
233 >    
234      Bend* nextBend(std::vector<Bend*>::iterator& i) {
235        ++i;
236        return (i == bends_.end()) ? NULL : *i;    
237      }
238 <
238 >    
239      Torsion* beginTorsion(std::vector<Torsion*>::iterator& i) {
240        i = torsions_.begin();
241        return (i == torsions_.end()) ? NULL : *i;
242      }
243 <
243 >    
244      Torsion* nextTorsion(std::vector<Torsion*>::iterator& i) {
245        ++i;
246        return (i == torsions_.end()) ? NULL : *i;    
247      }    
248  
249 +    Inversion* beginInversion(std::vector<Inversion*>::iterator& i) {
250 +      i = inversions_.begin();
251 +      return (i == inversions_.end()) ? NULL : *i;
252 +    }
253 +    
254 +    Inversion* nextInversion(std::vector<Inversion*>::iterator& i) {
255 +      ++i;
256 +      return (i == inversions_.end()) ? NULL : *i;    
257 +    }    
258 +    
259      RigidBody* beginRigidBody(std::vector<RigidBody*>::iterator& i) {
260        i = rigidBodies_.begin();
261        return (i == rigidBodies_.end()) ? NULL : *i;
262      }
263 <
263 >    
264      RigidBody* nextRigidBody(std::vector<RigidBody*>::iterator& i) {
265        ++i;
266        return (i == rigidBodies_.end()) ? NULL : *i;    
267      }
268 <
268 >    
269      StuntDouble* beginIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
270        i = integrableObjects_.begin();
271        return (i == integrableObjects_.end()) ? NULL : *i;
272      }
273 <
273 >    
274      StuntDouble* nextIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
275        ++i;
276        return (i == integrableObjects_.end()) ? NULL : *i;    
277      }    
278 <
278 >    
279      CutoffGroup* beginCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
280        i = cutoffGroups_.begin();
281        return (i == cutoffGroups_.end()) ? NULL : *i;
282      }
283  
284 <    CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {            
284 >    CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
285        ++i;
286        return (i == cutoffGroups_.end()) ? NULL : *i;    
287      }
288 <
288 >    
289      ConstraintPair* beginConstraintPair(std::vector<ConstraintPair*>::iterator& i) {
290        i = constraintPairs_.begin();
291        return (i == constraintPairs_.end()) ? NULL : *i;
292      }
293 <
293 >    
294      ConstraintPair* nextConstraintPair(std::vector<ConstraintPair*>::iterator& i) {            
295        ++i;
296        return (i == constraintPairs_.end()) ? NULL : *i;    
297      }        
298 <
298 >    
299      ConstraintElem* beginConstraintElem(std::vector<ConstraintElem*>::iterator& i) {
300        i = constraintElems_.begin();
301        return (i == constraintElems_.end()) ? NULL : *i;
302      }
303 <
303 >    
304      ConstraintElem* nextConstraintElem(std::vector<ConstraintElem*>::iterator& i) {            
305        ++i;
306        return (i == constraintElems_.end()) ? NULL : *i;    
307      }
308          
309 <    /** return the total potential energy of short range interaction of this molecule */
309 >    /**
310 >     * Returns the total potential energy of short range interaction
311 >     * of this molecule
312 >     */    
313      RealType getPotential();
314 <
314 >    
315      /** get total mass of this molecule */        
316      RealType getMass();
317 <
317 >    
318      /** return the center of mass of this molecule */
319      Vector3d getCom();
320 <
320 >    
321      /** Moves the center of this molecule */
322      void moveCom(const Vector3d& delta);
323 <
323 >    
324      /** Returns the velocity of center of mass of this molecule */
325      Vector3d getComVel();
326  
# Line 302 | Line 329 | namespace oopse{
329      }
330          
331      friend std::ostream& operator <<(std::ostream& o, Molecule& mol);
332 <        
332 >
333 >    //below functions are just forward functions
334 >    /**
335 >     * Adds property into property map
336 >     * @param genData GenericData to be added into PropertyMap
337 >     */
338 >    void addProperty(GenericData* genData);
339 >
340 >    /**
341 >     * Removes property from PropertyMap by name
342 >     * @param propName the name of property to be removed
343 >     */
344 >    void removeProperty(const std::string& propName);
345 >
346 >    /**
347 >     * clear all of the properties
348 >     */
349 >    void clearProperties();
350 >
351 >    /**
352 >     * Returns all names of properties
353 >     * @return all names of properties
354 >     */
355 >    std::vector<std::string> getPropertyNames();
356 >
357 >    /**
358 >     * Returns all of the properties in PropertyMap
359 >     * @return all of the properties in PropertyMap
360 >     */      
361 >    std::vector<GenericData*> getProperties();
362 >
363 >    /**
364 >     * Returns property
365 >     * @param propName name of property
366 >     * @return a pointer point to property with propName. If no property named propName
367 >     * exists, return NULL
368 >     */      
369 >    GenericData* getPropertyByName(const std::string& propName);
370 >    
371    private:
372 <        
372 >    
373      int globalIndex_;
374 <
374 >    
375      std::vector<Atom*> atoms_;
376      std::vector<Bond*> bonds_;
377      std::vector<Bend*> bends_;
378      std::vector<Torsion*> torsions_;
379 +    std::vector<Inversion*> inversions_;
380      std::vector<RigidBody*> rigidBodies_;
381      std::vector<StuntDouble*> integrableObjects_;
382      std::vector<CutoffGroup*> cutoffGroups_;
# Line 318 | Line 384 | namespace oopse{
384      std::vector<ConstraintElem*> constraintElems_;
385      int stampId_;
386      std::string moleculeName_;
387 +    PropertyMap properties_;
388 +
389    };
390  
391 < } //namespace oopse
391 > } //namespace OpenMD
392   #endif //

Comparing:
trunk/src/primitives/Molecule.hpp (property svn:keywords), Revision 963 by tim, Wed May 17 21:51:42 2006 UTC vs.
branches/development/src/primitives/Molecule.hpp (property svn:keywords), Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines