--- trunk/src/brains/SimInfo.cpp 2005/03/07 22:39:33 398 +++ trunk/src/brains/SimInfo.cpp 2005/04/13 18:41:17 490 @@ -65,15 +65,15 @@ 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), nAtoms_(0), nBonds_(0), nBends_(0), nTorsions_(0), nRigidBodies_(0), nIntegrableObjects_(0), nCutoffGroups_(0), nConstraints_(0), - sman_(NULL), fortranInitialized_(false), selectMan_(NULL) { + sman_(NULL), fortranInitialized_(false) { std::vector >::iterator i; @@ -139,8 +139,6 @@ SimInfo::SimInfo(std::vectorselectAll(); } SimInfo::~SimInfo() { @@ -149,13 +147,11 @@ SimInfo::~SimInfo() { delete i->second; } molecules_.clear(); - - MemoryUtils::deletePointers(moleculeStamps_); - + + delete stamps_; delete sman_; delete simParams_; delete forceField_; - delete selectMan_; } int SimInfo::getNGlobalConstraints() { @@ -370,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) { @@ -414,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); + } + } + } } @@ -649,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(); @@ -839,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;