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

Comparing trunk/OOPSE-3.0/src/brains/SimInfo.cpp (file contents):
Revision 2000 by tim, Fri Feb 11 22:41:02 2005 UTC vs.
Revision 2082 by tim, Mon Mar 7 22:39:33 2005 UTC

# Line 144 | Line 144 | SimInfo::~SimInfo() {
144   }
145  
146   SimInfo::~SimInfo() {
147 <    //MemoryUtils::deleteVectorOfPointer(molecules_);
148 <
149 <    MemoryUtils::deleteVectorOfPointer(moleculeStamps_);
147 >    std::map<int, Molecule*>::iterator i;
148 >    for (i = molecules_.begin(); i != molecules_.end(); ++i) {
149 >        delete i->second;
150 >    }
151 >    molecules_.clear();
152      
153 +    MemoryUtils::deletePointers(moleculeStamps_);
154 +    
155      delete sman_;
156      delete simParams_;
157      delete forceField_;
# Line 754 | Line 758 | void SimInfo::setupCutoff() {
758      return maxCutoffRadius;
759   }
760  
761 < void SimInfo::setupCutoff() {
758 <    double rcut_;  //cutoff radius
759 <    double rsw_; //switching radius
761 > void SimInfo::getCutoff(double& rcut, double& rsw) {
762      
763      if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) {
764          
# Line 767 | Line 769 | void SimInfo::setupCutoff() {
769                  "\tfor the cutoffRadius.\n");
770              painCave.isFatal = 0;
771              simError();
772 <            rcut_ = 15.0;
772 >            rcut = 15.0;
773          } else{
774 <            rcut_ = simParams_->getRcut();
774 >            rcut = simParams_->getRcut();
775          }
776  
777          if (!simParams_->haveRsw()){
# Line 779 | Line 781 | void SimInfo::setupCutoff() {
781                  "\t0.95 * cutoffRadius for the switchingRadius\n");
782              painCave.isFatal = 0;
783              simError();
784 <            rsw_ = 0.95 * rcut_;
784 >            rsw = 0.95 * rcut;
785          } else{
786 <            rsw_ = simParams_->getRsw();
786 >            rsw = simParams_->getRsw();
787          }
788  
789      } else {
# Line 789 | Line 791 | void SimInfo::setupCutoff() {
791          //meta-data file, the maximum cutoff radius calculated from forcefiled will be used
792          
793          if (simParams_->haveRcut()) {
794 <            rcut_ = simParams_->getRcut();
794 >            rcut = simParams_->getRcut();
795          } else {
796              //set cutoff radius to the maximum cutoff radius based on atom types in the whole system
797 <            rcut_ = calcMaxCutoffRadius();
797 >            rcut = calcMaxCutoffRadius();
798          }
799  
800          if (simParams_->haveRsw()) {
801 <            rsw_  = simParams_->getRsw();
801 >            rsw  = simParams_->getRsw();
802          } else {
803 <            rsw_ = rcut_;
803 >            rsw = rcut;
804          }
805      
806      }
807 <        
807 > }
808 >
809 > void SimInfo::setupCutoff() {
810 >    getCutoff(rcut_, rsw_);    
811      double rnblist = rcut_ + 1; // skin of neighbor list
812  
813      //Pass these cutoff radius etc. to fortran. This function should be called once and only once
# Line 834 | Line 839 | void SimInfo::setSnapshotManager(SnapshotManager* sman
839   }
840  
841   void SimInfo::setSnapshotManager(SnapshotManager* sman) {
842 +    //if (sman_ == sman_) {
843 +    //    return;
844 +    //}
845 +    
846 +    //delete sman_;
847      sman_ = sman;
848  
849      Molecule* mol;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines