38 |
|
#include "math/Vector3.hpp" |
39 |
|
#include "primitives/Atom.hpp" |
40 |
|
#include "primitives/RigidBody.hpp" |
41 |
+ |
//#include "primitives/Bond.hpp" |
42 |
+ |
//#include "primitives/Bend.hpp" |
43 |
+ |
//#include "primitives/Torsion.hpp" |
44 |
+ |
#include "primitives/SRI.hpp" |
45 |
+ |
#include "primitives/CutoffGroup.hpp" |
46 |
|
|
47 |
|
namespace oopse{ |
48 |
|
|
49 |
+ |
class Constraint; |
50 |
+ |
|
51 |
|
/** |
52 |
|
* @class Molecule Molecule.hpp "primitives/Molecule.hpp" |
53 |
|
* @brief |
55 |
|
class Molecule { |
56 |
|
public: |
57 |
|
|
58 |
< |
Molecule(); |
58 |
> |
typedef std::vector<Atom*>::iterator AtomIterator; |
59 |
> |
typedef std::vector<Bond*>::iterator BondIterator; |
60 |
> |
typedef std::vector<Bend*>::iterator BendIterator; |
61 |
> |
typedef std::vector<Torsion*>::iterator TorsionIterator; |
62 |
> |
typedef std::vector<RigidBody*>::iterator RigidBodyIterator; |
63 |
> |
typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator; |
64 |
> |
typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator; |
65 |
> |
|
66 |
> |
Molecule(int stampId, int globalIndex); |
67 |
|
virtual ~Molecule(); |
68 |
|
|
69 |
|
/** |
78 |
|
* Sets the global index of this molecule. |
79 |
|
* @param new global index to be set |
80 |
|
*/ |
81 |
< |
void setGlobalIndex(int index) { |
81 |
> |
int setGlobalIndex(int index) { |
82 |
|
return globalIndex_; |
83 |
|
} |
69 |
– |
|
70 |
– |
/** |
71 |
– |
* Returns the local index of this molecule |
72 |
– |
* @return the local index of this molecule |
73 |
– |
*/ |
74 |
– |
int getLocalIndex() { |
75 |
– |
return localIndex_; |
76 |
– |
} |
84 |
|
|
85 |
|
/** add an atom into this molecule */ |
86 |
|
void addAtom(Atom* atom); |
138 |
|
return cutoffGroups_.size(); |
139 |
|
} |
140 |
|
|
141 |
+ |
/** Returns the total number of constraints in this molecule */ |
142 |
+ |
unsigned int getNConstraints() { |
143 |
+ |
return constraints_.size(); |
144 |
+ |
} |
145 |
+ |
|
146 |
+ |
Atom* getAtomAt(unsigned int i) { |
147 |
+ |
assert(i < atoms_.size()); |
148 |
+ |
return atoms_[i]; |
149 |
+ |
} |
150 |
|
/** |
151 |
|
* Returns the first atom in this molecule and initialize the iterator. |
152 |
|
* @return the first atom, return NULL if there is not cut off group in this molecule |
214 |
|
*/ |
215 |
|
CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i); |
216 |
|
|
217 |
+ |
Constraint* beginConstraint(std::vector<Constraint*>::iterator& i); |
218 |
+ |
|
219 |
+ |
Constraint* nextConstraint(std::vector<Constraint*>::iterator& i); |
220 |
+ |
|
221 |
|
//void setStampID( int info ) {stampID = info;} |
222 |
|
|
223 |
|
void calcForces( void ); |
232 |
|
Vector3d getCom(); |
233 |
|
|
234 |
|
/** Moves the center of this molecule */ |
235 |
< |
void moveCom(const Vetor3d& delta); |
235 |
> |
void moveCom(const Vector3d& delta); |
236 |
|
|
237 |
|
/** Returns the velocity of center of mass of this molecule */ |
238 |
|
Vector3d getComVel(); |
240 |
|
/** Returns the total mass of this molecule */ |
241 |
|
double getTotalMass(); |
242 |
|
|
243 |
< |
friend std::ostream& operator <<(std::ostream& o, const Molecule& mol); |
243 |
> |
friend std::ostream& operator <<(std::ostream& o, Molecule& mol); |
244 |
|
|
245 |
|
private: |
246 |
< |
int localIndex_; |
246 |
> |
|
247 |
|
int globalIndex_; |
248 |
|
|
249 |
|
std::vector<Atom*> atoms_; |
253 |
|
std::vector<RigidBody*> rigidBodies_; |
254 |
|
std::vector<StuntDouble*> integrableObjects_; |
255 |
|
std::vector<CutoffGroup*> cutoffGroups_; |
256 |
+ |
std::vector<Constraint*> constraints_; |
257 |
+ |
|
258 |
+ |
int stampID; |
259 |
|
}; |
260 |
|
|
261 |
|
} //namespace oopse |