--- trunk/src/brains/SimInfo.cpp 2005/03/09 17:30:29 413 +++ trunk/src/brains/SimInfo.cpp 2005/04/13 18:41:17 490 @@ -65,9 +65,9 @@ namespace oopse { namespace oopse { -SimInfo::SimInfo(std::vector >& molStampPairs, +SimInfo::SimInfo(MakeStamps* stamps, std::vector >& molStampPairs, ForceField* ff, Globals* simParams) : - forceField_(ff), simParams_(simParams), + stamps_(stamps), forceField_(ff), simParams_(simParams), ndf_(0), ndfRaw_(0), ndfTrans_(0), nZconstraint_(0), nGlobalMols_(0), nGlobalAtoms_(0), nGlobalCutoffGroups_(0), nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0), @@ -147,9 +147,8 @@ SimInfo::~SimInfo() { delete i->second; } molecules_.clear(); - - MemoryUtils::deletePointers(moleculeStamps_); - + + delete stamps_; delete sman_; delete simParams_; delete forceField_; @@ -367,7 +366,19 @@ 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); + } + } + } + } void SimInfo::removeExcludePairs(Molecule* mol) { @@ -411,6 +422,19 @@ 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); + } + } + } } @@ -646,9 +670,6 @@ void SimInfo::setupFortranSim() { } //setup fortran simulation - //gloalExcludes and molMembershipArray should go away (They are never used) - //why the hell fortran need to know molecule? - //OOPSE = Object-Obfuscated Parallel Simulation Engine int nGlobalExcludes = 0; int* globalExcludes = NULL; int* excludeList = exclude_.getExcludeList(); @@ -836,11 +857,10 @@ void SimInfo::setSnapshotManager(SnapshotManager* sman } void SimInfo::setSnapshotManager(SnapshotManager* sman) { - //if (sman_ == sman_) { - // return; - //} - - //delete sman_; + if (sman_ == sman) { + return; + } + delete sman_; sman_ = sman; Molecule* mol;