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

Comparing trunk/src/primitives/Molecule.hpp (file contents):
Revision 305 by tim, Mon Feb 7 22:39:19 2005 UTC vs.
Revision 2052 by gezelter, Fri Jan 9 19:06:35 2015 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# 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, 234107 (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  
63 namespace oopse{
66  
67 < class Constraint;
67 > namespace OpenMD{
68  
69 < /**
70 < * @class Molecule Molecule.hpp "primitives/Molecule.hpp"
71 < * @brief
72 < */
73 < class Molecule {
74 <    public:
69 >  class Constraint;
70 >  
71 >  /**
72 >   * @class Molecule Molecule.hpp "primitives/Molecule.hpp"
73 >   * @brief
74 >   */
75 >  class Molecule {
76 >  public:
77  
78 <        typedef std::vector<Atom*>::iterator AtomIterator;
79 <        typedef std::vector<Bond*>::iterator BondIterator;
80 <        typedef std::vector<Bend*>::iterator BendIterator;
81 <        typedef std::vector<Torsion*>::iterator TorsionIterator;
78 <        typedef std::vector<RigidBody*>::iterator RigidBodyIterator;
79 <        typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator;
80 <        typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator;        
81 <        typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator;
82 <        typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator;
83 <        
78 >    struct HBondDonor {
79 >      Atom* donorAtom;
80 >      Atom* donatedHydrogen;
81 >    };
82  
83 <        Molecule(int stampId, int globalIndex, const std::string& molName);
84 <        virtual ~Molecule();
83 >    typedef std::vector<Atom*>::iterator AtomIterator;
84 >    typedef std::vector<Bond*>::iterator BondIterator;
85 >    typedef std::vector<Bend*>::iterator BendIterator;
86 >    typedef std::vector<Torsion*>::iterator TorsionIterator;
87 >    typedef std::vector<Inversion*>::iterator InversionIterator;
88 >    typedef std::vector<RigidBody*>::iterator RigidBodyIterator;
89 >    typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator;
90 >    typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator;
91 >    typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator;
92 >    typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator;
93 >    typedef std::vector<Atom*>::iterator FluctuatingChargeIterator;
94 >    typedef std::vector<HBondDonor*>::iterator HBondDonorIterator;
95 >    typedef std::vector<Atom*>::iterator HBondAcceptorIterator;
96  
97 <        /**
98 <         * Returns the global index of this molecule.
90 <         * @return  the global index of this molecule
91 <         */
92 <        int getGlobalIndex() {
93 <            return globalIndex_;
94 <        }
97 >    Molecule(int stampId, int globalIndex, const std::string& molName, int region);
98 >    virtual ~Molecule();
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.
104 <         */
105 <        int getStampId() {
106 <            return stampId_;
107 <        }
100 >    /**
101 >     * Returns the global index of this molecule.
102 >     * @return  the global index of this molecule
103 >     */
104 >    int getGlobalIndex() {
105 >      return globalIndex_;
106 >    }
107 >    
108 >    /**
109 >     * Returns the stamp id of this molecule
110 >     * @note Ideally, every molecule should keep a pointer of its
111 >     * molecule stamp instead of its stamp id. However, the pointer
112 >     * will become invalid, if the molecule migrate to other
113 >     * processor.
114 >     */
115 >    int getStampId() {
116 >      return stampId_;
117 >    }
118 >    int getRegion() {
119 >      return region_;
120 >    }
121 >    
122 >    /** Returns the name of the molecule */
123 >    std::string getType() {
124 >      return moleculeName_;
125 >    }
126 >    
127 >    /**
128 >     * Sets the global index of this molecule.
129 >     * @param index new global index to be set
130 >     */
131 >    void setGlobalIndex(int index) {
132 >      globalIndex_ = index;
133 >    }
134  
135 <        /** Returns the name of the molecule */
136 <        std::string getType() {
137 <            return moleculeName_;
138 <        }
139 <        
140 <        /**
141 <         * Sets the global index of this molecule.
112 <         * @param new global index to be set
113 <         */
114 <        void setGlobalIndex(int index) {
115 <            globalIndex_ = index;
116 <        }
135 >    void setConstrainTotalCharge(bool ctc) {
136 >      constrainTotalCharge_ = ctc;
137 >    }
138 >    
139 >    bool constrainTotalCharge() {
140 >      return constrainTotalCharge_;
141 >    }
142  
143 <        
144 <        /** add an atom into this molecule */
145 <        void addAtom(Atom* atom);
143 >    /** add an atom into this molecule */
144 >    void addAtom(Atom* atom);
145 >    
146 >    /** add a bond into this molecule */
147 >    void addBond(Bond* bond);
148 >    
149 >    /** add a bend into this molecule */
150 >    void addBend(Bend* bend);
151 >    
152 >    /** add a torsion into this molecule*/
153 >    void addTorsion(Torsion* torsion);
154  
155 <        /** add a bond into this molecule */
156 <        void addBond(Bond* bond);
155 >    /** add an improper torsion into this molecule*/
156 >    void addInversion(Inversion* inversion);
157 >    
158 >    /** add a rigidbody into this molecule */
159 >    void addRigidBody(RigidBody *rb);
160 >    
161 >    /** add a cutoff group into this molecule */
162 >    void addCutoffGroup(CutoffGroup* cp);    
163 >    
164 >    void addConstraintPair(ConstraintPair* consPair);
165 >    
166 >    void addConstraintElem(ConstraintElem* consElem);
167 >    
168 >    /** */
169 >    void complete();
170 >    
171 >    /** Returns the total number of atoms in this molecule */
172 >    unsigned int getNAtoms() {
173 >      return atoms_.size();
174 >    }
175 >    
176 >    /** Returns the total number of bonds in this molecule */        
177 >    unsigned int getNBonds(){
178 >      return bonds_.size();
179 >    }
180 >    
181 >    /** Returns the total number of bends in this molecule */        
182 >    unsigned int getNBends() {
183 >      return bends_.size();
184 >    }
185 >    
186 >    /** Returns the total number of torsions in this molecule */        
187 >    unsigned int getNTorsions() {
188 >      return torsions_.size();
189 >    }
190  
191 <        /** add a bend into this molecule */
192 <        void addBend(Bend* bend);
191 >    /** Returns the total number of improper torsions in this molecule */
192 >    unsigned int getNInversions() {
193 >      return inversions_.size();
194 >    }
195 >    
196 >    /** Returns the total number of rigid bodies in this molecule */        
197 >    unsigned int getNRigidBodies() {
198 >      return rigidBodies_.size();
199 >    }
200 >    
201 >    /** Returns the total number of integrable objects in this molecule */
202 >    unsigned int getNIntegrableObjects() {
203 >      return integrableObjects_.size();
204 >    }
205 >    
206 >    /** Returns the total number of cutoff groups in this molecule */
207 >    unsigned int getNCutoffGroups() {
208 >      return cutoffGroups_.size();
209 >    }
210 >    
211 >    /** Returns the total number of constraints in this molecule */
212 >    unsigned int getNConstraintPairs() {
213 >      return constraintPairs_.size();
214 >    }
215  
216 <        /** add a torsion into this molecule*/
217 <        void addTorsion(Torsion* torsion);
216 >    /** Returns the total number of fluctuating charges in this molecule */
217 >    unsigned int getNFluctuatingCharges() {
218 >      return fluctuatingCharges_.size();
219 >    }
220 >    /** Returns the total number of Hydrogen Bond donors in this molecule */
221 >    unsigned int getNHBondDonors() {
222 >      return hBondDonors_.size();
223 >    }
224 >    
225 >    /** Returns the total number of Hydrogen Bond acceptors in this molecule */
226 >    unsigned int getNHBondAcceptors() {
227 >      return hBondAcceptors_.size();
228 >    }
229  
230 <        /** add a rigidbody into this molecule */
231 <        void addRigidBody(RigidBody *rb);
230 >    Atom* getAtomAt(unsigned int i) {
231 >      assert(i < atoms_.size());
232 >      return atoms_[i];
233 >    }
234 >    
235 >    RigidBody* getRigidBodyAt(unsigned int i) {
236 >      assert(i < rigidBodies_.size());
237 >      return rigidBodies_[i];
238 >    }
239 >    
240 >    Atom* beginAtom(std::vector<Atom*>::iterator& i) {
241 >      i = atoms_.begin();
242 >      return (i == atoms_.end()) ? NULL : *i;
243 >    }
244 >    
245 >    Atom* nextAtom(std::vector<Atom*>::iterator& i) {
246 >      ++i;
247 >      return (i == atoms_.end()) ? NULL : *i;    
248 >    }
249 >    
250 >    Bond* beginBond(std::vector<Bond*>::iterator& i) {
251 >      i = bonds_.begin();
252 >      return (i == bonds_.end()) ? NULL : *i;
253 >    }
254 >    
255 >    Bond* nextBond(std::vector<Bond*>::iterator& i) {
256 >      ++i;
257 >      return (i == bonds_.end()) ? NULL : *i;    
258 >      
259 >    }
260 >    
261 >    Bend* beginBend(std::vector<Bend*>::iterator& i) {
262 >      i = bends_.begin();
263 >      return (i == bends_.end()) ? NULL : *i;
264 >    }
265 >    
266 >    Bend* nextBend(std::vector<Bend*>::iterator& i) {
267 >      ++i;
268 >      return (i == bends_.end()) ? NULL : *i;    
269 >    }
270 >    
271 >    Torsion* beginTorsion(std::vector<Torsion*>::iterator& i) {
272 >      i = torsions_.begin();
273 >      return (i == torsions_.end()) ? NULL : *i;
274 >    }
275 >    
276 >    Torsion* nextTorsion(std::vector<Torsion*>::iterator& i) {
277 >      ++i;
278 >      return (i == torsions_.end()) ? NULL : *i;    
279 >    }    
280  
281 <        /** add a cutoff group into this molecule */
282 <        void addCutoffGroup(CutoffGroup* cp);    
281 >    Inversion* beginInversion(std::vector<Inversion*>::iterator& i) {
282 >      i = inversions_.begin();
283 >      return (i == inversions_.end()) ? NULL : *i;
284 >    }
285 >    
286 >    Inversion* nextInversion(std::vector<Inversion*>::iterator& i) {
287 >      ++i;
288 >      return (i == inversions_.end()) ? NULL : *i;    
289 >    }    
290 >    
291 >    RigidBody* beginRigidBody(std::vector<RigidBody*>::iterator& i) {
292 >      i = rigidBodies_.begin();
293 >      return (i == rigidBodies_.end()) ? NULL : *i;
294 >    }
295 >    
296 >    RigidBody* nextRigidBody(std::vector<RigidBody*>::iterator& i) {
297 >      ++i;
298 >      return (i == rigidBodies_.end()) ? NULL : *i;    
299 >    }
300 >    
301 >    StuntDouble* beginIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
302 >      i = integrableObjects_.begin();
303 >      return (i == integrableObjects_.end()) ? NULL : *i;
304 >    }
305 >    
306 >    StuntDouble* nextIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
307 >      ++i;
308 >      return (i == integrableObjects_.end()) ? NULL : *i;    
309 >    }    
310 >    
311 >    CutoffGroup* beginCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
312 >      i = cutoffGroups_.begin();
313 >      return (i == cutoffGroups_.end()) ? NULL : *i;
314 >    }
315  
316 <        void addConstraintPair(ConstraintPair* consPair);
317 <        
318 <        void addConstraintElem(ConstraintElem* consElem);
319 <
320 <        /** */
321 <        void complete();
322 <
323 <        /** Returns the total number of atoms in this molecule */
324 <        unsigned int getNAtoms() {
325 <            return atoms_.size();
326 <        }
316 >    CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
317 >      ++i;
318 >      return (i == cutoffGroups_.end()) ? NULL : *i;    
319 >    }
320 >    
321 >    ConstraintPair* beginConstraintPair(std::vector<ConstraintPair*>::iterator& i) {
322 >      i = constraintPairs_.begin();
323 >      return (i == constraintPairs_.end()) ? NULL : *i;
324 >    }
325 >    
326 >    ConstraintPair* nextConstraintPair(std::vector<ConstraintPair*>::iterator& i) {            
327 >      ++i;
328 >      return (i == constraintPairs_.end()) ? NULL : *i;    
329 >    }        
330 >    
331 >    ConstraintElem* beginConstraintElem(std::vector<ConstraintElem*>::iterator& i) {
332 >      i = constraintElems_.begin();
333 >      return (i == constraintElems_.end()) ? NULL : *i;
334 >    }
335 >    
336 >    ConstraintElem* nextConstraintElem(std::vector<ConstraintElem*>::iterator& i) {            
337 >      ++i;
338 >      return (i == constraintElems_.end()) ? NULL : *i;    
339 >    }
340  
341 <        /** Returns the total number of bonds in this molecule */        
342 <        unsigned int getNBonds(){
343 <            return bonds_.size();
344 <        }
341 >    Atom* beginFluctuatingCharge(std::vector<Atom*>::iterator& i) {
342 >      i = fluctuatingCharges_.begin();
343 >      return (i == fluctuatingCharges_.end()) ? NULL : *i;
344 >    }
345 >    
346 >    Atom* nextFluctuatingCharge(std::vector<Atom*>::iterator& i) {
347 >      ++i;
348 >      return (i == fluctuatingCharges_.end()) ? NULL : *i;    
349 >    }
350  
351 <        /** Returns the total number of bends in this molecule */        
352 <        unsigned int getNBends() {
353 <            return bends_.size();
354 <        }
351 >    HBondDonor* beginHBondDonor(std::vector<HBondDonor*>::iterator& i) {
352 >      i = hBondDonors_.begin();
353 >      return (i == hBondDonors_.end()) ? NULL : *i;
354 >    }
355 >    
356 >    HBondDonor* nextHBondDonor(std::vector<HBondDonor*>::iterator& i) {
357 >      ++i;
358 >      return (i == hBondDonors_.end()) ? NULL : *i;    
359 >    }
360 >    
361 >    Atom* beginHBondAcceptor(std::vector<Atom*>::iterator& i) {
362 >      i = hBondAcceptors_.begin();
363 >      return (i == hBondAcceptors_.end()) ? NULL : *i;
364 >    }
365 >    
366 >    Atom* nextHBondAcceptor(std::vector<Atom*>::iterator& i) {
367 >      ++i;
368 >      return (i == hBondAcceptors_.end()) ? NULL : *i;    
369 >    }
370  
159        /** Returns the total number of torsions in this molecule */        
160        unsigned int getNTorsions() {
161            return torsions_.size();
162        }
163
164        /** Returns the total number of rigid bodies in this molecule */        
165        unsigned int getNRigidBodies() {
166            return rigidBodies_.size();
167        }
168
169        /** Returns the total number of integrable objects in this molecule */
170        unsigned int getNIntegrableObjects() {
171            return integrableObjects_.size();
172        }
173
174        /** Returns the total number of cutoff groups in this molecule */
175        unsigned int getNCutoffGroups() {
176            return cutoffGroups_.size();
177        }
178
179        /** Returns the total number of constraints in this molecule */
180        unsigned int getNConstraintPairs() {
181            return constraintPairs_.size();
182        }
183
184        Atom* getAtomAt(unsigned int i) {
185            assert(i < atoms_.size());
186            return atoms_[i];
187        }
188
189        RigidBody* getRigidBodyAt(unsigned int i) {
190            assert(i < rigidBodies_.size());
191            return rigidBodies_[i];
192        }
371          
372 <        Atom* beginAtom(std::vector<Atom*>::iterator& i) {
373 <            i = atoms_.begin();
374 <            return (i == atoms_.end()) ? NULL : *i;
375 <        }
372 >    /**
373 >     * Returns the total potential energy of short range interaction
374 >     * of this molecule
375 >     */    
376 >    RealType getPotential();
377 >    
378 >    /** get total mass of this molecule */        
379 >    RealType getMass();
380 >    
381 >    /**
382 >     * Returns the current center of mass position of this molecule.
383 >     *
384 >     * @return the center of mass position of this molecule.
385 >     */    
386 >    Vector3d getCom();
387 >    
388 >    /**
389 >     * Returns the center of mass position of this molecule in
390 >     * specified snapshot
391 >     *
392 >     * @return the center of mass position of this molecule
393 >     * @param snapshotNo
394 >     */    
395 >    Vector3d getCom(int snapshotNo);
396  
397 <        Atom* nextAtom(std::vector<Atom*>::iterator& i) {
398 <            ++i;
399 <            return (i == atoms_.end()) ? NULL : *i;    
400 <        }
397 >    
398 >    /** Moves the center of this molecule */
399 >    void moveCom(const Vector3d& delta);
400 >    
401 >    /** Returns the velocity of center of mass of this molecule */
402 >    Vector3d getComVel();
403  
404 <        Bond* beginBond(std::vector<Bond*>::iterator& i) {
405 <            i = bonds_.begin();
406 <            return (i == bonds_.end()) ? NULL : *i;
207 <        }
208 <
209 <        Bond* nextBond(std::vector<Bond*>::iterator& i) {
210 <            ++i;
211 <            return (i == bonds_.end()) ? NULL : *i;    
212 <
213 <        }
214 <
215 <        Bend* beginBend(std::vector<Bend*>::iterator& i) {
216 <            i = bends_.begin();
217 <            return (i == bends_.end()) ? NULL : *i;
218 <        }
219 <
220 <        Bend* nextBend(std::vector<Bend*>::iterator& i) {
221 <            ++i;
222 <            return (i == bends_.end()) ? NULL : *i;    
223 <        }
224 <
225 <        Torsion* beginTorsion(std::vector<Torsion*>::iterator& i) {
226 <            i = torsions_.begin();
227 <            return (i == torsions_.end()) ? NULL : *i;
228 <        }
229 <
230 <        Torsion* nextTorsion(std::vector<Torsion*>::iterator& i) {
231 <            ++i;
232 <            return (i == torsions_.end()) ? NULL : *i;    
233 <        }    
234 <
235 <        RigidBody* beginRigidBody(std::vector<RigidBody*>::iterator& i) {
236 <            i = rigidBodies_.begin();
237 <            return (i == rigidBodies_.end()) ? NULL : *i;
238 <        }
239 <
240 <        RigidBody* nextRigidBody(std::vector<RigidBody*>::iterator& i) {
241 <            ++i;
242 <            return (i == rigidBodies_.end()) ? NULL : *i;    
243 <        }
244 <
245 <        StuntDouble* beginIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
246 <            i = integrableObjects_.begin();
247 <            return (i == integrableObjects_.end()) ? NULL : *i;
248 <        }
249 <
250 <        StuntDouble* nextIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
251 <            ++i;
252 <            return (i == integrableObjects_.end()) ? NULL : *i;    
253 <        }    
254 <
255 <        CutoffGroup* beginCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
256 <            i = cutoffGroups_.begin();
257 <            return (i == cutoffGroups_.end()) ? NULL : *i;
258 <        }
259 <
260 <        CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {            
261 <            ++i;
262 <            return (i == cutoffGroups_.end()) ? NULL : *i;    
263 <        }
264 <
265 <        ConstraintPair* beginConstraintPair(std::vector<ConstraintPair*>::iterator& i) {
266 <            i = constraintPairs_.begin();
267 <            return (i == constraintPairs_.end()) ? NULL : *i;
268 <        }
269 <
270 <        ConstraintPair* nextConstraintPair(std::vector<ConstraintPair*>::iterator& i) {            
271 <            ++i;
272 <            return (i == constraintPairs_.end()) ? NULL : *i;    
273 <        }        
274 <
275 <        ConstraintElem* beginConstraintElem(std::vector<ConstraintElem*>::iterator& i) {
276 <            i = constraintElems_.begin();
277 <            return (i == constraintElems_.end()) ? NULL : *i;
278 <        }
279 <
280 <        ConstraintElem* nextConstraintElem(std::vector<ConstraintElem*>::iterator& i) {            
281 <            ++i;
282 <            return (i == constraintElems_.end()) ? NULL : *i;    
283 <        }
404 >    std::string getMoleculeName() {
405 >      return moleculeName_;
406 >    }
407          
408 <        /** return the total potential energy of short range interaction of this molecule */
286 <        double getPotential();
408 >    friend std::ostream& operator <<(std::ostream& o, Molecule& mol);
409  
410 <        /** get total mass of this molecule */        
411 <        double getMass();
410 >    //below functions are just forward functions
411 >    /**
412 >     * Adds property into property map
413 >     * @param genData GenericData to be added into PropertyMap
414 >     */
415 >    void addProperty(GenericData* genData);
416  
417 <        /** return the center of mass of this molecule */
418 <        Vector3d getCom();
417 >    /**
418 >     * Removes property from PropertyMap by name
419 >     * @param propName the name of property to be removed
420 >     */
421 >    void removeProperty(const std::string& propName);
422  
423 <        /** Moves the center of this molecule */
424 <        void moveCom(const Vector3d& delta);
423 >    /**
424 >     * clear all of the properties
425 >     */
426 >    void clearProperties();
427  
428 <        /** Returns the velocity of center of mass of this molecule */
429 <        Vector3d getComVel();
428 >    /**
429 >     * Returns all names of properties
430 >     * @return all names of properties
431 >     */
432 >    std::vector<std::string> getPropertyNames();
433  
434 <        std::string getMoleculeName() {
435 <            return moleculeName_;
436 <        }
437 <        
438 <        friend std::ostream& operator <<(std::ostream& o, Molecule& mol);
305 <        
306 <    private:
307 <        
308 <        int globalIndex_;
434 >    /**
435 >     * Returns all of the properties in PropertyMap
436 >     * @return all of the properties in PropertyMap
437 >     */      
438 >    std::vector<GenericData*> getProperties();
439  
440 <        std::vector<Atom*> atoms_;
441 <        std::vector<Bond*> bonds_;
442 <        std::vector<Bend*> bends_;
443 <        std::vector<Torsion*> torsions_;
444 <        std::vector<RigidBody*> rigidBodies_;
445 <        std::vector<StuntDouble*> integrableObjects_;
446 <        std::vector<CutoffGroup*> cutoffGroups_;
447 <        std::vector<ConstraintPair*> constraintPairs_;
448 <        std::vector<ConstraintElem*> constraintElems_;
449 <        int stampId_;
450 <        std::string moleculeName_;
451 < };
440 >    /**
441 >     * Returns property
442 >     * @param propName name of property
443 >     * @return a pointer point to property with propName. If no property named propName
444 >     * exists, return NULL
445 >     */      
446 >    GenericData* getPropertyByName(const std::string& propName);
447 >    
448 >  private:
449 >    
450 >    int globalIndex_;
451 >    
452 >    std::vector<Atom*> atoms_;
453 >    std::vector<Bond*> bonds_;
454 >    std::vector<Bend*> bends_;
455 >    std::vector<Torsion*> torsions_;
456 >    std::vector<Inversion*> inversions_;
457 >    std::vector<RigidBody*> rigidBodies_;
458 >    std::vector<StuntDouble*> integrableObjects_;
459 >    std::vector<CutoffGroup*> cutoffGroups_;
460 >    std::vector<ConstraintPair*> constraintPairs_;
461 >    std::vector<ConstraintElem*> constraintElems_;
462 >    std::vector<Atom*> fluctuatingCharges_;
463 >    std::vector<HBondDonor*> hBondDonors_;
464 >    std::vector<Atom*> hBondAcceptors_;
465 >    
466 >    int stampId_;
467 >    int region_;
468 >    std::string moleculeName_;
469 >    PropertyMap properties_;
470 >    bool constrainTotalCharge_;
471  
472 < } //namespace oopse
472 >  };
473 >
474 > } //namespace OpenMD
475   #endif //

Comparing trunk/src/primitives/Molecule.hpp (property svn:keywords):
Revision 305 by tim, Mon Feb 7 22:39:19 2005 UTC vs.
Revision 2052 by gezelter, Fri Jan 9 19:06:35 2015 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines