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 1701 by tim, Wed Nov 3 16:08:43 2004 UTC vs.
Revision 1738 by tim, Sat Nov 13 05:08:12 2004 UTC

# Line 55 | Line 55 | class Molecule {
55   class Molecule {
56      public:
57  
58 <        Molecule();
58 >        typedef std::vector<Atom*>::iterator AtomIterator;
59 >        typedef std::vector<Bond*>::iterator BondIterator;
60 >        typedef std::vector<Bend*>::iterator BendIterator;
61 >        typedef std::vector<Torsion*>::iterator TorsionIterator;
62 >        typedef std::vector<RigidBody*>::iterator RigidBodyIterator;
63 >        typedef std::vector<CutoffGroup*>::iterator CutoffGroupIterator;
64 >        typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator;        
65 >
66 >        Molecule(int stampId, int globalIndex, const std::string& molName);
67          virtual ~Molecule();
68  
69          /**
# Line 67 | Line 75 | class Molecule {
75          }
76  
77          /**
78 +         * Returns the stamp id of this molecule
79 +         * @note Ideally, every molecule should keep a pointer of its molecule stamp instead of its
80 +         * stamp id. However, the pointer will become invalid, if the molecule migrate to other processor.
81 +         */
82 +        int getStampId() {
83 +            return stampId_;
84 +        }
85 +
86 +        /** Returns the name of the molecule */
87 +        std::string getType() {
88 +            return moleculeName_;
89 +        }
90 +        
91 +        /**
92           * Sets the global index of this molecule.
93           * @param new global index to be set
94           */
95          int setGlobalIndex(int index) {
96              return globalIndex_;
97          }
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        }
98  
99 +        
100          /** add an atom into this molecule */
101          void addAtom(Atom* atom);
102  
# Line 142 | Line 157 | class Molecule {
157          unsigned int getNConstraints() {
158              return constraints_.size();
159          }
160 <        
160 >
161 >        Atom* getAtomAt(unsigned int i) {
162 >            assert(i < atoms_.size());
163 >            return atoms_[i];
164 >        }
165          /**
166           * Returns the first atom in this molecule and initialize the iterator.
167           * @return the first atom, return NULL if there is not cut off group in this molecule
# Line 214 | Line 233 | class Molecule {
233  
234          Constraint* nextConstraint(std::vector<Constraint*>::iterator& i);
235          
217        //void setStampID( int info ) {stampID = info;}
236  
219        void calcForces( void );
220
221        void atoms2rigidBodies( void );
222
237          /** return the total potential energy of short range interaction of this molecule */
238          double getPotential();
239  
# Line 239 | Line 253 | class Molecule {
253          friend std::ostream& operator <<(std::ostream& o, Molecule& mol);
254          
255      private:
256 <        int localIndex_;
256 >        
257          int globalIndex_;
258  
259          std::vector<Atom*> atoms_;
# Line 250 | Line 264 | class Molecule {
264          std::vector<StuntDouble*> integrableObjects_;
265          std::vector<CutoffGroup*> cutoffGroups_;
266          std::vector<Constraint*> constraints_;
267 +
268 +        int stampId_;
269 +        std::string moleculeName_;
270   };
271  
272   } //namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines