--- trunk/OOPSE/libmdtools/SimSetup.cpp 2004/05/12 14:30:12 1163 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2004/05/12 16:38:45 1167 @@ -185,7 +185,9 @@ void SimSetup::makeMolecules(void){ RigidBodyStamp* currentRigidBody; CutoffGroupStamp* currentCutoffGroup; CutoffGroup* myCutoffGroup; - + int nCutoffGroups;// number of cutoff group of a molecule defined in mdl file + set cutoffAtomSet; //atoms belong to cutoffgroup defined at mdl file + bond_pair* theBonds; bend_set* theBends; torsion_set* theTorsions; @@ -218,7 +220,8 @@ void SimSetup::makeMolecules(void){ molInfo.nBends = comp_stamps[stampID]->getNBends(); molInfo.nTorsions = comp_stamps[stampID]->getNTorsions(); molInfo.nRigidBodies = comp_stamps[stampID]->getNRigidBodies(); - molInfo.nCutoffGroups = comp_stamps[stampID]->getNCutoffGroups(); + + nCutoffGroups = comp_stamps[stampID]->getNCutoffGroups(); molInfo.myAtoms = &(info[k].atoms[atomOffset]); @@ -485,8 +488,11 @@ void SimSetup::makeMolecules(void){ //create cutoff group for molecule + + cutoffAtomSet.clear(); molInfo.myCutoffGroups.clear(); - for (j = 0; j < molInfo.nCutoffGroups; j++){ + + for (j = 0; j < nCutoffGroups; j++){ currentCutoffGroup = comp_stamps[stampID]->getCutoffGroup(j); nMembers = currentCutoffGroup->getNMembers(); @@ -500,15 +506,30 @@ void SimSetup::makeMolecules(void){ // tempI is atom numbering on local processor tempI = molI + atomOffset; - + myCutoffGroup->addAtom(info[k].atoms[tempI]); + + cutoffAtomSet.insert(tempI); } molInfo.myCutoffGroups.push_back(myCutoffGroup); }//end for (j = 0; j < molInfo.nCutoffGroups; j++) - + //creat a cutoff group for every atom in current molecule which does not belong to cutoffgroup defined at mdl file + for(j = 0; j < molInfo.nAtoms; j++){ + + if(cutoffAtomSet.find(molInfo.myAtoms[j]->getIndex()) == cutoffAtomSet.end()){ + myCutoffGroup = new CutoffGroup(); + myCutoffGroup->addAtom(molInfo.myAtoms[j]); + molInfo.myCutoffGroups.push_back(myCutoffGroup); + } + + } + + + + // After this is all set up, scan through the atoms to // see if they can be added to the integrableObjects: