--- trunk/src/brains/SimInfo.cpp 2005/03/10 23:56:42 430 +++ 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_; @@ -380,19 +379,6 @@ void SimInfo::addExcludePairs(Molecule* mol) { } } - 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) { @@ -450,19 +436,6 @@ void SimInfo::removeExcludePairs(Molecule* mol) { } } - 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); - } - } - } - } @@ -697,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(); @@ -887,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;