ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/MoleculeCreator.cpp
(Generate patch)

Comparing branches/development/src/brains/MoleculeCreator.cpp (file contents):
Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
Revision 1540 by gezelter, Mon Jan 17 21:34:36 2011 UTC

# Line 138 | Line 138 | namespace OpenMD {
138      int nCutoffGroups = molStamp->getNCutoffGroups();
139      for (int i = 0; i < nCutoffGroups; ++i) {
140        currentCutoffGroupStamp = molStamp->getCutoffGroupStamp(i);
141 <      cutoffGroup = createCutoffGroup(mol, currentCutoffGroupStamp);
141 >      cutoffGroup = createCutoffGroup(mol, currentCutoffGroupStamp, localIndexMan);
142        mol->addCutoffGroup(cutoffGroup);
143      }
144  
# Line 169 | Line 169 | namespace OpenMD {
169      // every single free atom
170      
171      for (fai = freeAtoms.begin(); fai != freeAtoms.end(); ++fai) {
172 <      cutoffGroup = createCutoffGroup(mol, *fai);
172 >      cutoffGroup = createCutoffGroup(mol, *fai, localIndexMan);
173        mol->addCutoffGroup(cutoffGroup);
174      }
175      //create constraints
# Line 449 | Line 449 | namespace OpenMD {
449    }
450    
451  
452 <  CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule* mol, CutoffGroupStamp* stamp) {
452 >  CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule* mol,
453 >                                                  CutoffGroupStamp* stamp,
454 >                                                  LocalIndexManager* localIndexMan) {
455      int nAtoms;
456      CutoffGroup* cg;
457      Atom* atom;
# Line 461 | Line 463 | namespace OpenMD {
463        assert(atom);
464        cg->addAtom(atom);
465      }
466 <
466 >    
467 >    //set the local index of this cutoffGroup, global index will be set later
468 >    cg->setLocalIndex(localIndexMan->getNextCutoffGroupIndex());
469 >    
470      return cg;
471    }    
472 <
473 <  CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule * mol, Atom* atom) {
472 >  
473 >  CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule * mol, Atom* atom,
474 >                                                  LocalIndexManager* localIndexMan) {
475      CutoffGroup* cg;
476      cg  = new CutoffGroup();
477      cg->addAtom(atom);
478 +
479 +    //set the local index of this cutoffGroup, global index will be set later
480 +    cg->setLocalIndex(localIndexMan->getNextCutoffGroupIndex());
481 +
482      return cg;
483    }
484  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines