--- branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp 2004/11/05 23:38:27 1719 +++ branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp 2004/11/13 05:08:12 1738 @@ -55,7 +55,15 @@ class Molecule { class Molecule { public: - Molecule(int stampId, int globalIndex); + typedef std::vector::iterator AtomIterator; + typedef std::vector::iterator BondIterator; + typedef std::vector::iterator BendIterator; + typedef std::vector::iterator TorsionIterator; + typedef std::vector::iterator RigidBodyIterator; + typedef std::vector::iterator CutoffGroupIterator; + typedef std::vector::iterator IntegrableObjectIterator; + + Molecule(int stampId, int globalIndex, const std::string& molName); virtual ~Molecule(); /** @@ -67,21 +75,28 @@ 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 */ int setGlobalIndex(int index) { return globalIndex_; } - - /** - * Returns the local index of this molecule - * @return the local index of this molecule - */ - int getLocalIndex() { - return localIndex_; - } + /** add an atom into this molecule */ void addAtom(Atom* atom); @@ -218,12 +233,7 @@ class Molecule { Constraint* nextConstraint(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(); @@ -243,7 +253,7 @@ class Molecule { friend std::ostream& operator <<(std::ostream& o, Molecule& mol); private: - int localIndex_; + int globalIndex_; std::vector atoms_; @@ -255,7 +265,8 @@ class Molecule { std::vector cutoffGroups_; std::vector constraints_; - int stampID; + int stampId_; + std::string moleculeName_; }; } //namespace oopse