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" |
41 |
> |
#include "primitives/Bond.hpp" |
42 |
> |
#include "primitives/Bend.hpp" |
43 |
> |
#include "primitives/Torsion.hpp" |
44 |
|
#include "primitives/CutoffGroup.hpp" |
45 |
|
|
46 |
|
namespace oopse{ |
54 |
|
class Molecule { |
55 |
|
public: |
56 |
|
|
57 |
< |
Molecule(int stampId, int globalIndex); |
57 |
> |
typedef std::vector<Atom*>::iterator AtomIterator; |
58 |
> |
typedef std::vector<Bond*>::iterator BondIterator; |
59 |
> |
typedef std::vector<Bend*>::iterator BendIterator; |
60 |
> |
typedef std::vector<Torsion*>::iterator TorsionIterator; |
61 |
> |
typedef std::vector<RigidBody*>::iterator RigidBodyIterator; |
62 |
> |
typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator; |
63 |
> |
typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator; |
64 |
> |
|
65 |
> |
Molecule(int stampId, int globalIndex, const std::string& molName); |
66 |
|
virtual ~Molecule(); |
67 |
|
|
68 |
|
/** |
71 |
|
*/ |
72 |
|
int getGlobalIndex() { |
73 |
|
return globalIndex_; |
74 |
+ |
} |
75 |
+ |
|
76 |
+ |
/** |
77 |
+ |
* Returns the stamp id of this molecule |
78 |
+ |
* @note Ideally, every molecule should keep a pointer of its molecule stamp instead of its |
79 |
+ |
* stamp id. However, the pointer will become invalid, if the molecule migrate to other processor. |
80 |
+ |
*/ |
81 |
+ |
int getStampId() { |
82 |
+ |
return stampId_; |
83 |
|
} |
84 |
|
|
85 |
+ |
/** Returns the name of the molecule */ |
86 |
+ |
std::string getType() { |
87 |
+ |
return moleculeName_; |
88 |
+ |
} |
89 |
+ |
|
90 |
|
/** |
91 |
|
* Sets the global index of this molecule. |
92 |
|
* @param new global index to be set |
94 |
|
int setGlobalIndex(int index) { |
95 |
|
return globalIndex_; |
96 |
|
} |
76 |
– |
|
77 |
– |
/** |
78 |
– |
* Returns the local index of this molecule |
79 |
– |
* @return the local index of this molecule |
80 |
– |
*/ |
81 |
– |
int getLocalIndex() { |
82 |
– |
return localIndex_; |
83 |
– |
} |
97 |
|
|
98 |
+ |
|
99 |
|
/** add an atom into this molecule */ |
100 |
|
void addAtom(Atom* atom); |
101 |
|
|
232 |
|
|
233 |
|
Constraint* nextConstraint(std::vector<Constraint*>::iterator& i); |
234 |
|
|
221 |
– |
//void setStampID( int info ) {stampID = info;} |
235 |
|
|
223 |
– |
void calcForces( void ); |
224 |
– |
|
225 |
– |
void atoms2rigidBodies( void ); |
226 |
– |
|
236 |
|
/** return the total potential energy of short range interaction of this molecule */ |
237 |
|
double getPotential(); |
238 |
|
|
252 |
|
friend std::ostream& operator <<(std::ostream& o, Molecule& mol); |
253 |
|
|
254 |
|
private: |
255 |
< |
int localIndex_; |
255 |
> |
|
256 |
|
int globalIndex_; |
257 |
|
|
258 |
|
std::vector<Atom*> atoms_; |
264 |
|
std::vector<CutoffGroup*> cutoffGroups_; |
265 |
|
std::vector<Constraint*> constraints_; |
266 |
|
|
267 |
< |
int stampID; |
267 |
> |
int stampId_; |
268 |
> |
std::string moleculeName_; |
269 |
|
}; |
270 |
|
|
271 |
|
} //namespace oopse |