--- branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp 2004/11/10 22:01:06 1725 +++ branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp 2005/01/04 22:18:36 1901 @@ -35,13 +35,13 @@ #include #include +#include "constraints/ConstraintPair.hpp" #include "math/Vector3.hpp" #include "primitives/Atom.hpp" #include "primitives/RigidBody.hpp" -//#include "primitives/Bond.hpp" -//#include "primitives/Bend.hpp" -//#include "primitives/Torsion.hpp" -#include "primitives/SRI.hpp" +#include "primitives/Bond.hpp" +#include "primitives/Bend.hpp" +#include "primitives/Torsion.hpp" #include "primitives/CutoffGroup.hpp" namespace oopse{ @@ -63,7 +63,7 @@ class Molecule { typedef std::vector::iterator CutoffGroupIterator; typedef std::vector::iterator IntegrableObjectIterator; - Molecule(int stampId, int globalIndex); + Molecule(int stampId, int globalIndex, const std::string& molName); virtual ~Molecule(); /** @@ -75,6 +75,20 @@ class Molecule { } /** + * Returns the stamp id of this molecule + * @note Ideally, every molecule should keep a pointer of its molecule stamp instead of its + * stamp id. However, the pointer will become invalid, if the molecule migrate to other processor. + */ + int getStampId() { + return stampId_; + } + + /** Returns the name of the molecule */ + std::string getType() { + return moleculeName_; + } + + /** * Sets the global index of this molecule. * @param new global index to be set */ @@ -82,6 +96,7 @@ class Molecule { return globalIndex_; } + /** add an atom into this molecule */ void addAtom(Atom* atom); @@ -98,8 +113,10 @@ class Molecule { void addRigidBody(RigidBody *rb); /** add a cutoff group into this molecule */ - void addCutoffGroup(CutoffGroup* cp); + void addCutoffGroup(CutoffGroup* cp); + void addConstraintPair(ConstraintPair* consPair); + /** */ void complete(); @@ -139,8 +156,8 @@ class Molecule { } /** Returns the total number of constraints in this molecule */ - unsigned int getNConstraints() { - return constraints_.size(); + unsigned int getNConstraintPairs() { + return constraintPairs_.size(); } Atom* getAtomAt(unsigned int i) { @@ -214,19 +231,16 @@ class Molecule { */ CutoffGroup* nextCutoffGroup(std::vector::iterator& i); - Constraint* beginConstraint(std::vector::iterator& i); + ConstraintPair* beginConstraintPair(std::vector::iterator& i); - Constraint* nextConstraint(std::vector::iterator& i); + ConstraintPair* nextConstraintPair(std::vector::iterator& i); - //void setStampID( int info ) {stampID = info;} - void calcForces( void ); - - void atoms2rigidBodies( void ); - /** return the total potential energy of short range interaction of this molecule */ double getPotential(); + /** get total mass of this molecule */ + double getMass(); /** return the center of mass of this molecule */ Vector3d getCom(); @@ -253,9 +267,10 @@ class Molecule { std::vector rigidBodies_; std::vector integrableObjects_; std::vector cutoffGroups_; - std::vector constraints_; + std::vector constraintPairs_; - int stampID; + int stampId_; + std::string moleculeName_; }; } //namespace oopse