ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/primitives/Molecule.hpp (file contents):
Revision 1713 by tim, Fri Nov 5 02:56:22 2004 UTC vs.
Revision 1782 by tim, Wed Nov 24 20:55:03 2004 UTC

# Line 38 | Line 38
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{
# Line 55 | Line 54 | class Molecule {
54   class Molecule {
55      public:
56  
57 <        Molecule();
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          /**
# Line 66 | Line 73 | class Molecule {
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
# Line 73 | Line 94 | class Molecule {
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  
# Line 142 | Line 156 | class Molecule {
156          unsigned int getNConstraints() {
157              return constraints_.size();
158          }
159 <        
159 >
160 >        Atom* getAtomAt(unsigned int i) {
161 >            assert(i < atoms_.size());
162 >            return atoms_[i];
163 >        }
164          /**
165           * Returns the first atom in this molecule and initialize the iterator.
166           * @return the first atom, return NULL if there is not cut off group in this molecule
# Line 214 | Line 232 | class Molecule {
232  
233          Constraint* nextConstraint(std::vector<Constraint*>::iterator& i);
234          
217        //void setStampID( int info ) {stampID = info;}
235  
219        void calcForces( void );
220
221        void atoms2rigidBodies( void );
222
236          /** return the total potential energy of short range interaction of this molecule */
237          double getPotential();
238  
# Line 239 | Line 252 | class Molecule {
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_;
# Line 251 | Line 264 | class Molecule {
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines