--- trunk/src/brains/SimInfo.cpp 2005/02/11 22:41:02 316 +++ trunk/src/brains/SimInfo.cpp 2005/03/07 22:39:33 398 @@ -144,10 +144,14 @@ SimInfo::~SimInfo() { } SimInfo::~SimInfo() { - //MemoryUtils::deleteVectorOfPointer(molecules_); - - MemoryUtils::deleteVectorOfPointer(moleculeStamps_); + std::map::iterator i; + for (i = molecules_.begin(); i != molecules_.end(); ++i) { + delete i->second; + } + molecules_.clear(); + MemoryUtils::deletePointers(moleculeStamps_); + delete sman_; delete simParams_; delete forceField_; @@ -754,9 +758,7 @@ double SimInfo::calcMaxCutoffRadius() { return maxCutoffRadius; } -void SimInfo::setupCutoff() { - double rcut_; //cutoff radius - double rsw_; //switching radius +void SimInfo::getCutoff(double& rcut, double& rsw) { if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) { @@ -767,9 +769,9 @@ void SimInfo::setupCutoff() { "\tfor the cutoffRadius.\n"); painCave.isFatal = 0; simError(); - rcut_ = 15.0; + rcut = 15.0; } else{ - rcut_ = simParams_->getRcut(); + rcut = simParams_->getRcut(); } if (!simParams_->haveRsw()){ @@ -779,9 +781,9 @@ void SimInfo::setupCutoff() { "\t0.95 * cutoffRadius for the switchingRadius\n"); painCave.isFatal = 0; simError(); - rsw_ = 0.95 * rcut_; + rsw = 0.95 * rcut; } else{ - rsw_ = simParams_->getRsw(); + rsw = simParams_->getRsw(); } } else { @@ -789,20 +791,23 @@ void SimInfo::setupCutoff() { //meta-data file, the maximum cutoff radius calculated from forcefiled will be used if (simParams_->haveRcut()) { - rcut_ = simParams_->getRcut(); + rcut = simParams_->getRcut(); } else { //set cutoff radius to the maximum cutoff radius based on atom types in the whole system - rcut_ = calcMaxCutoffRadius(); + rcut = calcMaxCutoffRadius(); } if (simParams_->haveRsw()) { - rsw_ = simParams_->getRsw(); + rsw = simParams_->getRsw(); } else { - rsw_ = rcut_; + rsw = rcut; } } - +} + +void SimInfo::setupCutoff() { + getCutoff(rcut_, rsw_); double rnblist = rcut_ + 1; // skin of neighbor list //Pass these cutoff radius etc. to fortran. This function should be called once and only once @@ -834,6 +839,11 @@ void SimInfo::setSnapshotManager(SnapshotManager* sman } void SimInfo::setSnapshotManager(SnapshotManager* sman) { + //if (sman_ == sman_) { + // return; + //} + + //delete sman_; sman_ = sman; Molecule* mol;