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 |
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. |
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 |
|
/** |
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; |
68 |
> |
class Constraint; |
69 |
|
|
70 |
< |
/** |
71 |
< |
* @class Molecule Molecule.hpp "primitives/Molecule.hpp" |
72 |
< |
* @brief |
73 |
< |
*/ |
74 |
< |
class Molecule { |
75 |
< |
public: |
70 |
> |
/** |
71 |
> |
* @class Molecule Molecule.hpp "primitives/Molecule.hpp" |
72 |
> |
* @brief |
73 |
> |
*/ |
74 |
> |
class Molecule { |
75 |
> |
public: |
76 |
|
|
77 |
< |
typedef std::vector<Atom*>::iterator AtomIterator; |
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<RigidBody*>::iterator RigidBodyIterator; |
82 |
< |
typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator; |
83 |
< |
typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator; |
84 |
< |
typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator; |
85 |
< |
typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator; |
86 |
< |
|
77 |
> |
typedef std::vector<Atom*>::iterator AtomIterator; |
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; |
85 |
> |
typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator; |
86 |
> |
typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator; |
87 |
> |
|
88 |
> |
|
89 |
> |
Molecule(int stampId, int globalIndex, const std::string& molName); |
90 |
> |
virtual ~Molecule(); |
91 |
|
|
92 |
< |
Molecule(int stampId, int globalIndex, const std::string& molName); |
93 |
< |
virtual ~Molecule(); |
92 |
> |
/** |
93 |
> |
* Returns the global index of this molecule. |
94 |
> |
* @return the global index of this molecule |
95 |
> |
*/ |
96 |
> |
int getGlobalIndex() { |
97 |
> |
return globalIndex_; |
98 |
> |
} |
99 |
> |
|
100 |
> |
/** |
101 |
> |
* Returns the stamp id of this molecule |
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 |
> |
|
111 |
> |
/** Returns the name of the molecule */ |
112 |
> |
std::string getType() { |
113 |
> |
return moleculeName_; |
114 |
> |
} |
115 |
> |
|
116 |
> |
/** |
117 |
> |
* Sets the global index of this molecule. |
118 |
> |
* @param new global index to be set |
119 |
> |
*/ |
120 |
> |
void setGlobalIndex(int index) { |
121 |
> |
globalIndex_ = index; |
122 |
> |
} |
123 |
> |
|
124 |
> |
|
125 |
> |
/** add an atom into this molecule */ |
126 |
> |
void addAtom(Atom* atom); |
127 |
> |
|
128 |
> |
/** add a bond into this molecule */ |
129 |
> |
void addBond(Bond* bond); |
130 |
> |
|
131 |
> |
/** add a bend into this molecule */ |
132 |
> |
void addBend(Bend* bend); |
133 |
> |
|
134 |
> |
/** add a torsion into this molecule*/ |
135 |
> |
void addTorsion(Torsion* torsion); |
136 |
|
|
137 |
< |
/** |
138 |
< |
* Returns the global index of this molecule. |
139 |
< |
* @return the global index of this molecule |
140 |
< |
*/ |
141 |
< |
int getGlobalIndex() { |
142 |
< |
return globalIndex_; |
143 |
< |
} |
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 |
> |
|
143 |
> |
/** add a cutoff group into this molecule */ |
144 |
> |
void addCutoffGroup(CutoffGroup* cp); |
145 |
> |
|
146 |
> |
void addConstraintPair(ConstraintPair* consPair); |
147 |
> |
|
148 |
> |
void addConstraintElem(ConstraintElem* consElem); |
149 |
> |
|
150 |
> |
/** */ |
151 |
> |
void complete(); |
152 |
> |
|
153 |
> |
/** Returns the total number of atoms in this molecule */ |
154 |
> |
unsigned int getNAtoms() { |
155 |
> |
return atoms_.size(); |
156 |
> |
} |
157 |
> |
|
158 |
> |
/** Returns the total number of bonds in this molecule */ |
159 |
> |
unsigned int getNBonds(){ |
160 |
> |
return bonds_.size(); |
161 |
> |
} |
162 |
> |
|
163 |
> |
/** Returns the total number of bends in this molecule */ |
164 |
> |
unsigned int getNBends() { |
165 |
> |
return bends_.size(); |
166 |
> |
} |
167 |
> |
|
168 |
> |
/** Returns the total number of torsions in this molecule */ |
169 |
> |
unsigned int getNTorsions() { |
170 |
> |
return torsions_.size(); |
171 |
> |
} |
172 |
|
|
173 |
< |
/** |
174 |
< |
* Returns the stamp id of this molecule |
175 |
< |
* @note Ideally, every molecule should keep a pointer of its molecule stamp instead of its |
176 |
< |
* stamp id. However, the pointer will become invalid, if the molecule migrate to other processor. |
177 |
< |
*/ |
178 |
< |
int getStampId() { |
179 |
< |
return stampId_; |
180 |
< |
} |
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 |
> |
|
183 |
> |
/** Returns the total number of integrable objects in this molecule */ |
184 |
> |
unsigned int getNIntegrableObjects() { |
185 |
> |
return integrableObjects_.size(); |
186 |
> |
} |
187 |
> |
|
188 |
> |
/** Returns the total number of cutoff groups in this molecule */ |
189 |
> |
unsigned int getNCutoffGroups() { |
190 |
> |
return cutoffGroups_.size(); |
191 |
> |
} |
192 |
> |
|
193 |
> |
/** Returns the total number of constraints in this molecule */ |
194 |
> |
unsigned int getNConstraintPairs() { |
195 |
> |
return constraintPairs_.size(); |
196 |
> |
} |
197 |
> |
|
198 |
> |
Atom* getAtomAt(unsigned int i) { |
199 |
> |
assert(i < atoms_.size()); |
200 |
> |
return atoms_[i]; |
201 |
> |
} |
202 |
> |
|
203 |
> |
RigidBody* getRigidBodyAt(unsigned int i) { |
204 |
> |
assert(i < rigidBodies_.size()); |
205 |
> |
return rigidBodies_[i]; |
206 |
> |
} |
207 |
> |
|
208 |
> |
Atom* beginAtom(std::vector<Atom*>::iterator& i) { |
209 |
> |
i = atoms_.begin(); |
210 |
> |
return (i == atoms_.end()) ? NULL : *i; |
211 |
> |
} |
212 |
> |
|
213 |
> |
Atom* nextAtom(std::vector<Atom*>::iterator& i) { |
214 |
> |
++i; |
215 |
> |
return (i == atoms_.end()) ? NULL : *i; |
216 |
> |
} |
217 |
> |
|
218 |
> |
Bond* beginBond(std::vector<Bond*>::iterator& i) { |
219 |
> |
i = bonds_.begin(); |
220 |
> |
return (i == bonds_.end()) ? NULL : *i; |
221 |
> |
} |
222 |
> |
|
223 |
> |
Bond* nextBond(std::vector<Bond*>::iterator& i) { |
224 |
> |
++i; |
225 |
> |
return (i == bonds_.end()) ? NULL : *i; |
226 |
> |
|
227 |
> |
} |
228 |
> |
|
229 |
> |
Bend* beginBend(std::vector<Bend*>::iterator& i) { |
230 |
> |
i = bends_.begin(); |
231 |
> |
return (i == bends_.end()) ? NULL : *i; |
232 |
> |
} |
233 |
> |
|
234 |
> |
Bend* nextBend(std::vector<Bend*>::iterator& i) { |
235 |
> |
++i; |
236 |
> |
return (i == bends_.end()) ? NULL : *i; |
237 |
> |
} |
238 |
> |
|
239 |
> |
Torsion* beginTorsion(std::vector<Torsion*>::iterator& i) { |
240 |
> |
i = torsions_.begin(); |
241 |
> |
return (i == torsions_.end()) ? NULL : *i; |
242 |
> |
} |
243 |
> |
|
244 |
> |
Torsion* nextTorsion(std::vector<Torsion*>::iterator& i) { |
245 |
> |
++i; |
246 |
> |
return (i == torsions_.end()) ? NULL : *i; |
247 |
> |
} |
248 |
|
|
249 |
< |
/** Returns the name of the molecule */ |
250 |
< |
std::string getType() { |
251 |
< |
return moleculeName_; |
252 |
< |
} |
253 |
< |
|
254 |
< |
/** |
255 |
< |
* Sets the global index of this molecule. |
256 |
< |
* @param new global index to be set |
257 |
< |
*/ |
258 |
< |
void setGlobalIndex(int index) { |
259 |
< |
globalIndex_ = index; |
260 |
< |
} |
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 |
> |
|
264 |
> |
RigidBody* nextRigidBody(std::vector<RigidBody*>::iterator& i) { |
265 |
> |
++i; |
266 |
> |
return (i == rigidBodies_.end()) ? NULL : *i; |
267 |
> |
} |
268 |
> |
|
269 |
> |
StuntDouble* beginIntegrableObject(std::vector<StuntDouble*>::iterator& i) { |
270 |
> |
i = integrableObjects_.begin(); |
271 |
> |
return (i == integrableObjects_.end()) ? NULL : *i; |
272 |
> |
} |
273 |
> |
|
274 |
> |
StuntDouble* nextIntegrableObject(std::vector<StuntDouble*>::iterator& i) { |
275 |
> |
++i; |
276 |
> |
return (i == integrableObjects_.end()) ? NULL : *i; |
277 |
> |
} |
278 |
> |
|
279 |
> |
CutoffGroup* beginCutoffGroup(std::vector<CutoffGroup*>::iterator& i) { |
280 |
> |
i = cutoffGroups_.begin(); |
281 |
> |
return (i == cutoffGroups_.end()) ? NULL : *i; |
282 |
> |
} |
283 |
|
|
284 |
< |
|
285 |
< |
/** add an atom into this molecule */ |
286 |
< |
void addAtom(Atom* atom); |
287 |
< |
|
288 |
< |
/** add a bond into this molecule */ |
289 |
< |
void addBond(Bond* bond); |
290 |
< |
|
291 |
< |
/** add a bend into this molecule */ |
292 |
< |
void addBend(Bend* bend); |
293 |
< |
|
294 |
< |
/** add a torsion into this molecule*/ |
295 |
< |
void addTorsion(Torsion* torsion); |
296 |
< |
|
297 |
< |
/** add a rigidbody into this molecule */ |
298 |
< |
void addRigidBody(RigidBody *rb); |
299 |
< |
|
300 |
< |
/** add a cutoff group into this molecule */ |
301 |
< |
void addCutoffGroup(CutoffGroup* cp); |
302 |
< |
|
303 |
< |
void addConstraintPair(ConstraintPair* consPair); |
284 |
> |
CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i) { |
285 |
> |
++i; |
286 |
> |
return (i == cutoffGroups_.end()) ? NULL : *i; |
287 |
> |
} |
288 |
> |
|
289 |
> |
ConstraintPair* beginConstraintPair(std::vector<ConstraintPair*>::iterator& i) { |
290 |
> |
i = constraintPairs_.begin(); |
291 |
> |
return (i == constraintPairs_.end()) ? NULL : *i; |
292 |
> |
} |
293 |
> |
|
294 |
> |
ConstraintPair* nextConstraintPair(std::vector<ConstraintPair*>::iterator& i) { |
295 |
> |
++i; |
296 |
> |
return (i == constraintPairs_.end()) ? NULL : *i; |
297 |
> |
} |
298 |
> |
|
299 |
> |
ConstraintElem* beginConstraintElem(std::vector<ConstraintElem*>::iterator& i) { |
300 |
> |
i = constraintElems_.begin(); |
301 |
> |
return (i == constraintElems_.end()) ? NULL : *i; |
302 |
> |
} |
303 |
> |
|
304 |
> |
ConstraintElem* nextConstraintElem(std::vector<ConstraintElem*>::iterator& i) { |
305 |
> |
++i; |
306 |
> |
return (i == constraintElems_.end()) ? NULL : *i; |
307 |
> |
} |
308 |
|
|
309 |
< |
void addConstraintElem(ConstraintElem* consElem); |
309 |
> |
/** |
310 |
> |
* Returns the total potential energy of short range interaction |
311 |
> |
* of this molecule |
312 |
> |
*/ |
313 |
> |
RealType getPotential(); |
314 |
> |
|
315 |
> |
/** get total mass of this molecule */ |
316 |
> |
RealType getMass(); |
317 |
> |
|
318 |
> |
/** return the center of mass of this molecule */ |
319 |
> |
Vector3d getCom(); |
320 |
> |
|
321 |
> |
/** Moves the center of this molecule */ |
322 |
> |
void moveCom(const Vector3d& delta); |
323 |
> |
|
324 |
> |
/** Returns the velocity of center of mass of this molecule */ |
325 |
> |
Vector3d getComVel(); |
326 |
|
|
327 |
< |
/** */ |
328 |
< |
void complete(); |
329 |
< |
|
144 |
< |
/** Returns the total number of atoms in this molecule */ |
145 |
< |
unsigned int getNAtoms() { |
146 |
< |
return atoms_.size(); |
147 |
< |
} |
148 |
< |
|
149 |
< |
/** Returns the total number of bonds in this molecule */ |
150 |
< |
unsigned int getNBonds(){ |
151 |
< |
return bonds_.size(); |
152 |
< |
} |
153 |
< |
|
154 |
< |
/** Returns the total number of bends in this molecule */ |
155 |
< |
unsigned int getNBends() { |
156 |
< |
return bends_.size(); |
157 |
< |
} |
158 |
< |
|
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 |
< |
} |
327 |
> |
std::string getMoleculeName() { |
328 |
> |
return moleculeName_; |
329 |
> |
} |
330 |
|
|
331 |
< |
Atom* beginAtom(std::vector<Atom*>::iterator& i) { |
195 |
< |
i = atoms_.begin(); |
196 |
< |
return (i == atoms_.end()) ? NULL : *i; |
197 |
< |
} |
331 |
> |
friend std::ostream& operator <<(std::ostream& o, Molecule& mol); |
332 |
|
|
333 |
< |
Atom* nextAtom(std::vector<Atom*>::iterator& i) { |
334 |
< |
++i; |
335 |
< |
return (i == atoms_.end()) ? NULL : *i; |
336 |
< |
} |
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 |
< |
Bond* beginBond(std::vector<Bond*>::iterator& i) { |
341 |
< |
i = bonds_.begin(); |
342 |
< |
return (i == bonds_.end()) ? NULL : *i; |
343 |
< |
} |
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 |
< |
Bond* nextBond(std::vector<Bond*>::iterator& i) { |
347 |
< |
++i; |
348 |
< |
return (i == bonds_.end()) ? NULL : *i; |
346 |
> |
/** |
347 |
> |
* clear all of the properties |
348 |
> |
*/ |
349 |
> |
void clearProperties(); |
350 |
|
|
351 |
< |
} |
351 |
> |
/** |
352 |
> |
* Returns all names of properties |
353 |
> |
* @return all names of properties |
354 |
> |
*/ |
355 |
> |
std::vector<std::string> getPropertyNames(); |
356 |
|
|
357 |
< |
Bend* beginBend(std::vector<Bend*>::iterator& i) { |
358 |
< |
i = bends_.begin(); |
359 |
< |
return (i == bends_.end()) ? NULL : *i; |
360 |
< |
} |
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 |
< |
Bend* nextBend(std::vector<Bend*>::iterator& i) { |
364 |
< |
++i; |
365 |
< |
return (i == bends_.end()) ? NULL : *i; |
366 |
< |
} |
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 |
> |
|
373 |
> |
int globalIndex_; |
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_; |
383 |
> |
std::vector<ConstraintPair*> constraintPairs_; |
384 |
> |
std::vector<ConstraintElem*> constraintElems_; |
385 |
> |
int stampId_; |
386 |
> |
std::string moleculeName_; |
387 |
> |
PropertyMap properties_; |
388 |
|
|
389 |
< |
Torsion* beginTorsion(std::vector<Torsion*>::iterator& i) { |
226 |
< |
i = torsions_.begin(); |
227 |
< |
return (i == torsions_.end()) ? NULL : *i; |
228 |
< |
} |
389 |
> |
}; |
390 |
|
|
391 |
< |
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 |
< |
} |
284 |
< |
|
285 |
< |
/** return the total potential energy of short range interaction of this molecule */ |
286 |
< |
double getPotential(); |
287 |
< |
|
288 |
< |
/** get total mass of this molecule */ |
289 |
< |
double getMass(); |
290 |
< |
|
291 |
< |
/** return the center of mass of this molecule */ |
292 |
< |
Vector3d getCom(); |
293 |
< |
|
294 |
< |
/** Moves the center of this molecule */ |
295 |
< |
void moveCom(const Vector3d& delta); |
296 |
< |
|
297 |
< |
/** Returns the velocity of center of mass of this molecule */ |
298 |
< |
Vector3d getComVel(); |
299 |
< |
|
300 |
< |
std::string getMoleculeName() { |
301 |
< |
return moleculeName_; |
302 |
< |
} |
303 |
< |
|
304 |
< |
friend std::ostream& operator <<(std::ostream& o, Molecule& mol); |
305 |
< |
|
306 |
< |
private: |
307 |
< |
|
308 |
< |
int globalIndex_; |
309 |
< |
|
310 |
< |
std::vector<Atom*> atoms_; |
311 |
< |
std::vector<Bond*> bonds_; |
312 |
< |
std::vector<Bend*> bends_; |
313 |
< |
std::vector<Torsion*> torsions_; |
314 |
< |
std::vector<RigidBody*> rigidBodies_; |
315 |
< |
std::vector<StuntDouble*> integrableObjects_; |
316 |
< |
std::vector<CutoffGroup*> cutoffGroups_; |
317 |
< |
std::vector<ConstraintPair*> constraintPairs_; |
318 |
< |
std::vector<ConstraintElem*> constraintElems_; |
319 |
< |
int stampId_; |
320 |
< |
std::string moleculeName_; |
321 |
< |
}; |
322 |
< |
|
323 |
< |
} //namespace oopse |
391 |
> |
} //namespace OpenMD |
392 |
|
#endif // |