ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/brains/SimInfo.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/brains/SimInfo.cpp (file contents):
Revision 1958 by tim, Tue Jan 25 21:59:18 2005 UTC vs.
Revision 2097 by tim, Wed Mar 9 17:30:29 2005 UTC

# Line 56 | Line 56
56   #include "UseTheForce/notifyCutoffs_interface.h"
57   #include "utils/MemoryUtils.hpp"
58   #include "utils/simError.h"
59 + #include "selection/SelectionManager.hpp"
60  
61   #ifdef IS_MPI
62   #include "UseTheForce/mpiComponentPlan.h"
# Line 137 | Line 138 | SimInfo::SimInfo(std::vector<std::pair<MoleculeStamp*,
138   #ifdef IS_MPI    
139      molToProcMap_.resize(nGlobalMols_);
140   #endif
141 <    
141 >
142   }
143  
144   SimInfo::~SimInfo() {
145 <    //MemoryUtils::deleteVectorOfPointer(molecules_);
146 <
147 <    MemoryUtils::deleteVectorOfPointer(moleculeStamps_);
145 >    std::map<int, Molecule*>::iterator i;
146 >    for (i = molecules_.begin(); i != molecules_.end(); ++i) {
147 >        delete i->second;
148 >    }
149 >    molecules_.clear();
150      
151 +    MemoryUtils::deletePointers(moleculeStamps_);
152 +    
153      delete sman_;
154      delete simParams_;
155      delete forceField_;
151
156   }
157  
158   int SimInfo::getNGlobalConstraints() {
# Line 751 | Line 755 | void SimInfo::setupCutoff() {
755      return maxCutoffRadius;
756   }
757  
758 < void SimInfo::setupCutoff() {
755 <    double rcut_;  //cutoff radius
756 <    double rsw_; //switching radius
758 > void SimInfo::getCutoff(double& rcut, double& rsw) {
759      
760      if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) {
761          
# Line 764 | Line 766 | void SimInfo::setupCutoff() {
766                  "\tfor the cutoffRadius.\n");
767              painCave.isFatal = 0;
768              simError();
769 <            rcut_ = 15.0;
769 >            rcut = 15.0;
770          } else{
771 <            rcut_ = simParams_->getRcut();
771 >            rcut = simParams_->getRcut();
772          }
773  
774          if (!simParams_->haveRsw()){
# Line 776 | Line 778 | void SimInfo::setupCutoff() {
778                  "\t0.95 * cutoffRadius for the switchingRadius\n");
779              painCave.isFatal = 0;
780              simError();
781 <            rsw_ = 0.95 * rcut_;
781 >            rsw = 0.95 * rcut;
782          } else{
783 <            rsw_ = simParams_->getRsw();
783 >            rsw = simParams_->getRsw();
784          }
785  
786      } else {
# Line 786 | Line 788 | void SimInfo::setupCutoff() {
788          //meta-data file, the maximum cutoff radius calculated from forcefiled will be used
789          
790          if (simParams_->haveRcut()) {
791 <            rcut_ = simParams_->getRcut();
791 >            rcut = simParams_->getRcut();
792          } else {
793              //set cutoff radius to the maximum cutoff radius based on atom types in the whole system
794 <            rcut_ = calcMaxCutoffRadius();
794 >            rcut = calcMaxCutoffRadius();
795          }
796  
797          if (simParams_->haveRsw()) {
798 <            rsw_  = simParams_->getRsw();
798 >            rsw  = simParams_->getRsw();
799          } else {
800 <            rsw_ = rcut_;
800 >            rsw = rcut;
801          }
802      
803      }
804 <        
804 > }
805 >
806 > void SimInfo::setupCutoff() {
807 >    getCutoff(rcut_, rsw_);    
808      double rnblist = rcut_ + 1; // skin of neighbor list
809  
810      //Pass these cutoff radius etc. to fortran. This function should be called once and only once
# Line 831 | Line 836 | void SimInfo::setSnapshotManager(SnapshotManager* sman
836   }
837  
838   void SimInfo::setSnapshotManager(SnapshotManager* sman) {
839 +    //if (sman_ == sman_) {
840 +    //    return;
841 +    //}
842 +    
843 +    //delete sman_;
844      sman_ = sman;
845  
846      Molecule* mol;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines