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 1696 by tim, Tue Nov 2 15:23:46 2004 UTC vs.
Revision 1782 by tim, Wed Nov 24 20:55:03 2004 UTC

# Line 45 | Line 45 | namespace oopse{
45  
46   namespace oopse{
47  
48 + class Constraint;
49 +
50   /**
51   * @class Molecule Molecule.hpp "primitives/Molecule.hpp"
52   * @brief
# Line 52 | 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 64 | Line 74 | class Molecule {
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
93           */
94          int setGlobalIndex(int index) {
95              return globalIndex_;
96          }
73        
74        /**
75         * Returns the local index of this molecule
76         * @return the local index of this molecule
77         */
78        int getLocalIndex() {
79            return localIndex_;
80        }
97  
98 +        
99          /** add an atom into this molecule */
100          void addAtom(Atom* atom);
101  
# Line 139 | 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 211 | Line 232 | class Molecule {
232  
233          Constraint* nextConstraint(std::vector<Constraint*>::iterator& i);
234          
214        //void setStampID( int info ) {stampID = info;}
235  
216        void calcForces( void );
217
218        void atoms2rigidBodies( void );
219
236          /** return the total potential energy of short range interaction of this molecule */
237          double getPotential();
238  
# Line 236 | 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 247 | Line 263 | class Molecule {
263          std::vector<StuntDouble*> integrableObjects_;
264          std::vector<CutoffGroup*> cutoffGroups_;
265          std::vector<Constraint*> constraints_;
266 +
267 +        int stampId_;
268 +        std::string moleculeName_;
269   };
270  
271   } //namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines