ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/brains/SimInfo.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/brains/SimInfo.cpp (file contents):
Revision 2463 by gezelter, Mon Nov 21 22:59:21 2005 UTC vs.
Revision 2469 by tim, Fri Dec 2 15:38:03 2005 UTC

# Line 80 | Line 80 | namespace oopse {
80      return result;
81    }
82    
83 <  SimInfo::SimInfo(MakeStamps* stamps, std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs,
84 <                   ForceField* ff, Globals* simParams) :
85 <    stamps_(stamps), forceField_(ff), simParams_(simParams),
83 >  SimInfo::SimInfo(ForceField* ff, Globals* simParams) :
84 >    forceField_(ff), simParams_(simParams),
85      ndf_(0), ndfRaw_(0), ndfTrans_(0), nZconstraint_(0),
86      nGlobalMols_(0), nGlobalAtoms_(0), nGlobalCutoffGroups_(0),
87      nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0),
# Line 90 | Line 89 | namespace oopse {
89      nIntegrableObjects_(0),  nCutoffGroups_(0), nConstraints_(0),
90      sman_(NULL), fortranInitialized_(false) {
91  
93            
94      std::vector<std::pair<MoleculeStamp*, int> >::iterator i;
92        MoleculeStamp* molStamp;
93        int nMolWithSameStamp;
94        int nCutoffAtoms = 0; // number of atoms belong to cutoff groups
# Line 99 | Line 96 | namespace oopse {
96        CutoffGroupStamp* cgStamp;    
97        RigidBodyStamp* rbStamp;
98        int nRigidAtoms = 0;
99 <    
100 <      for (i = molStampPairs.begin(); i !=molStampPairs.end(); ++i) {
101 <        molStamp = i->first;
102 <        nMolWithSameStamp = i->second;
99 >      std::vector<Component*> components = simParams->getComponents();
100 >      
101 >      for (std::vector<Component*>::iterator i = components.begin(); i !=components.end(); ++i) {
102 >        molStamp = (*i)->getMoleculeStamp();
103 >        nMolWithSameStamp = (*i)->getNMol();
104          
105          addMoleculeStamp(molStamp, nMolWithSameStamp);
106  
107          //calculate atoms in molecules
108          nGlobalAtoms_ += molStamp->getNAtoms() *nMolWithSameStamp;  
109  
112
110          //calculate atoms in cutoff groups
111          int nAtomsInGroups = 0;
112          int nCutoffGroupsInStamp = molStamp->getNCutoffGroups();
113          
114          for (int j=0; j < nCutoffGroupsInStamp; j++) {
115 <          cgStamp = molStamp->getCutoffGroup(j);
115 >          cgStamp = molStamp->getCutoffGroupStamp(j);
116            nAtomsInGroups += cgStamp->getNMembers();
117          }
118  
# Line 128 | Line 125 | namespace oopse {
125          int nRigidBodiesInStamp = molStamp->getNRigidBodies();
126          
127          for (int j=0; j < nRigidBodiesInStamp; j++) {
128 <          rbStamp = molStamp->getRigidBody(j);
128 >          rbStamp = molStamp->getRigidBodyStamp(j);
129            nAtomsInRigidBodies += rbStamp->getNMembers();
130          }
131  
# Line 167 | Line 164 | namespace oopse {
164      }
165      molecules_.clear();
166        
170    delete stamps_;
167      delete sman_;
168      delete simParams_;
169      delete forceField_;
# Line 274 | Line 270 | namespace oopse {
270            }
271          }
272              
273 <      }//end for (integrableObject)
274 <    }// end for (mol)
273 >      }
274 >    }
275      
276      // n_constraints is local, so subtract them on each processor
277      ndf_local -= nConstraints_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines