--- trunk/src/brains/SimInfo.cpp 2005/03/07 22:39:33 398 +++ trunk/src/brains/SimInfo.cpp 2005/03/10 23:56:42 430 @@ -73,7 +73,7 @@ SimInfo::SimInfo(std::vector >::iterator i; @@ -139,8 +139,6 @@ SimInfo::SimInfo(std::vectorselectAll(); } SimInfo::~SimInfo() { @@ -155,7 +153,6 @@ SimInfo::~SimInfo() { delete sman_; delete simParams_; delete forceField_; - delete selectMan_; } int SimInfo::getNGlobalConstraints() { @@ -370,7 +367,32 @@ void SimInfo::addExcludePairs(Molecule* mol) { exclude_.addPair(c, d); } - + Molecule::RigidBodyIterator rbIter; + RigidBody* rb; + for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { + std::vector atoms = rb->getAtoms(); + for (int i = 0; i < atoms.size() -1 ; ++i) { + for (int j = i + 1; j < atoms.size(); ++j) { + a = atoms[i]->getGlobalIndex(); + b = atoms[j]->getGlobalIndex(); + exclude_.addPair(a, b); + } + } + } + + Molecule::CutoffGroupIterator cgIter; + CutoffGroup* cg; + for (cg = mol->beginCutoffGroup(cgIter); cg != NULL; cg = mol->nextCutoffGroup(cgIter)) { + std::vector atoms = cg->getAtoms(); + for (int i = 0; i < atoms.size() -1 ; ++i) { + for (int j = i + 1; j < atoms.size(); ++j) { + a = atoms[i]->getGlobalIndex(); + b = atoms[j]->getGlobalIndex(); + exclude_.addPair(a, b); + } + } + } + } void SimInfo::removeExcludePairs(Molecule* mol) { @@ -414,7 +436,33 @@ void SimInfo::removeExcludePairs(Molecule* mol) { exclude_.removePair(b, d); exclude_.removePair(c, d); } + + Molecule::RigidBodyIterator rbIter; + RigidBody* rb; + for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { + std::vector atoms = rb->getAtoms(); + for (int i = 0; i < atoms.size() -1 ; ++i) { + for (int j = i + 1; j < atoms.size(); ++j) { + a = atoms[i]->getGlobalIndex(); + b = atoms[j]->getGlobalIndex(); + exclude_.removePair(a, b); + } + } + } + Molecule::CutoffGroupIterator cgIter; + CutoffGroup* cg; + for (cg = mol->beginCutoffGroup(cgIter); cg != NULL; cg = mol->nextCutoffGroup(cgIter)) { + std::vector atoms = cg->getAtoms(); + for (int i = 0; i < atoms.size() -1 ; ++i) { + for (int j = i + 1; j < atoms.size(); ++j) { + a = atoms[i]->getGlobalIndex(); + b = atoms[j]->getGlobalIndex(); + exclude_.removePair(a, b); + } + } + } + }