35 |
|
#include <vector> |
36 |
|
#include <iostream> |
37 |
|
|
38 |
+ |
#include "constraints/ConstraintPair.hpp" |
39 |
|
#include "math/Vector3.hpp" |
40 |
|
#include "primitives/Atom.hpp" |
41 |
|
#include "primitives/RigidBody.hpp" |
42 |
< |
//#include "primitives/Bond.hpp" |
43 |
< |
//#include "primitives/Bend.hpp" |
44 |
< |
//#include "primitives/Torsion.hpp" |
44 |
< |
#include "primitives/SRI.hpp" |
42 |
> |
#include "primitives/Bond.hpp" |
43 |
> |
#include "primitives/Bend.hpp" |
44 |
> |
#include "primitives/Torsion.hpp" |
45 |
|
#include "primitives/CutoffGroup.hpp" |
46 |
|
|
47 |
|
namespace oopse{ |
63 |
|
typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator; |
64 |
|
typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator; |
65 |
|
|
66 |
< |
Molecule(int stampId, int globalIndex); |
66 |
> |
Molecule(int stampId, int globalIndex, const std::string& molName); |
67 |
|
virtual ~Molecule(); |
68 |
|
|
69 |
|
/** |
75 |
|
} |
76 |
|
|
77 |
|
/** |
78 |
+ |
* Returns the stamp id of this molecule |
79 |
+ |
* @note Ideally, every molecule should keep a pointer of its molecule stamp instead of its |
80 |
+ |
* stamp id. However, the pointer will become invalid, if the molecule migrate to other processor. |
81 |
+ |
*/ |
82 |
+ |
int getStampId() { |
83 |
+ |
return stampId_; |
84 |
+ |
} |
85 |
+ |
|
86 |
+ |
/** Returns the name of the molecule */ |
87 |
+ |
std::string getType() { |
88 |
+ |
return moleculeName_; |
89 |
+ |
} |
90 |
+ |
|
91 |
+ |
/** |
92 |
|
* Sets the global index of this molecule. |
93 |
|
* @param new global index to be set |
94 |
|
*/ |
96 |
|
return globalIndex_; |
97 |
|
} |
98 |
|
|
99 |
+ |
|
100 |
|
/** add an atom into this molecule */ |
101 |
|
void addAtom(Atom* atom); |
102 |
|
|
113 |
|
void addRigidBody(RigidBody *rb); |
114 |
|
|
115 |
|
/** add a cutoff group into this molecule */ |
116 |
< |
void addCutoffGroup(CutoffGroup* cp); |
116 |
> |
void addCutoffGroup(CutoffGroup* cp); |
117 |
|
|
118 |
+ |
void addConstraintPair(ConstraintPair* consPair); |
119 |
+ |
|
120 |
|
/** */ |
121 |
|
void complete(); |
122 |
|
|
156 |
|
} |
157 |
|
|
158 |
|
/** Returns the total number of constraints in this molecule */ |
159 |
< |
unsigned int getNConstraints() { |
160 |
< |
return constraints_.size(); |
159 |
> |
unsigned int getNConstraintPairs() { |
160 |
> |
return constraintPairs_.size(); |
161 |
|
} |
162 |
|
|
163 |
|
Atom* getAtomAt(unsigned int i) { |
231 |
|
*/ |
232 |
|
CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i); |
233 |
|
|
234 |
< |
Constraint* beginConstraint(std::vector<Constraint*>::iterator& i); |
234 |
> |
ConstraintPair* beginConstraintPair(std::vector<ConstraintPair*>::iterator& i); |
235 |
|
|
236 |
< |
Constraint* nextConstraint(std::vector<Constraint*>::iterator& i); |
236 |
> |
ConstraintPair* nextConstraintPair(std::vector<ConstraintPair*>::iterator& i); |
237 |
|
|
221 |
– |
//void setStampID( int info ) {stampID = info;} |
238 |
|
|
223 |
– |
void calcForces( void ); |
224 |
– |
|
225 |
– |
void atoms2rigidBodies( void ); |
226 |
– |
|
239 |
|
/** return the total potential energy of short range interaction of this molecule */ |
240 |
|
double getPotential(); |
241 |
|
|
242 |
+ |
/** get total mass of this molecule */ |
243 |
+ |
double getMass(); |
244 |
|
|
245 |
|
/** return the center of mass of this molecule */ |
246 |
|
Vector3d getCom(); |
267 |
|
std::vector<RigidBody*> rigidBodies_; |
268 |
|
std::vector<StuntDouble*> integrableObjects_; |
269 |
|
std::vector<CutoffGroup*> cutoffGroups_; |
270 |
< |
std::vector<Constraint*> constraints_; |
270 |
> |
std::vector<ConstraintPair*> constraintPairs_; |
271 |
|
|
272 |
< |
int stampID; |
272 |
> |
int stampId_; |
273 |
> |
std::string moleculeName_; |
274 |
|
}; |
275 |
|
|
276 |
|
} //namespace oopse |