--- branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp 2004/11/01 22:52:57 1695 +++ branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp 2004/11/10 22:01:06 1725 @@ -38,13 +38,16 @@ #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/Bond.hpp" +//#include "primitives/Bend.hpp" +//#include "primitives/Torsion.hpp" +#include "primitives/SRI.hpp" #include "primitives/CutoffGroup.hpp" namespace oopse{ +class Constraint; + /** * @class Molecule Molecule.hpp "primitives/Molecule.hpp" * @brief @@ -52,7 +55,15 @@ class Molecule { class Molecule { public: - Molecule(); + 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); virtual ~Molecule(); /** @@ -70,14 +81,6 @@ class Molecule { 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); @@ -135,6 +138,15 @@ class Molecule { return cutoffGroups_.size(); } + /** Returns the total number of constraints in this molecule */ + unsigned int getNConstraints() { + return constraints_.size(); + } + + Atom* getAtomAt(unsigned int i) { + assert(i < atoms_.size()); + return atoms_[i]; + } /** * Returns the first atom in this molecule and initialize the iterator. * @return the first atom, return NULL if there is not cut off group in this molecule @@ -202,6 +214,10 @@ class Molecule { */ CutoffGroup* nextCutoffGroup(std::vector::iterator& i); + Constraint* beginConstraint(std::vector::iterator& i); + + Constraint* nextConstraint(std::vector::iterator& i); + //void setStampID( int info ) {stampID = info;} void calcForces( void ); @@ -227,7 +243,7 @@ class Molecule { friend std::ostream& operator <<(std::ostream& o, Molecule& mol); private: - int localIndex_; + int globalIndex_; std::vector atoms_; @@ -237,6 +253,9 @@ class Molecule { std::vector rigidBodies_; std::vector integrableObjects_; std::vector cutoffGroups_; + std::vector constraints_; + + int stampID; }; } //namespace oopse