ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/ForceManager.cpp
(Generate patch)

Comparing branches/development/src/brains/ForceManager.cpp (file contents):
Revision 1850 by gezelter, Wed Feb 20 15:39:39 2013 UTC vs.
Revision 1868 by gezelter, Tue Apr 30 15:56:54 2013 UTC

# Line 67 | Line 67 | namespace OpenMD {
67   using namespace std;
68   namespace OpenMD {
69    
70 <  ForceManager::ForceManager(SimInfo * info) : info_(info) {
70 >  ForceManager::ForceManager(SimInfo * info) : info_(info), switcher_(NULL) {
71      forceField_ = info_->getForceField();
72      interactionMan_ = new InteractionManager();
73      fDecomp_ = new ForceMatrixDecomposition(info_, interactionMan_);
74 +    thermo = new Thermo(info_);
75    }
76  
77 +  ForceManager::~ForceManager() {
78 +    perturbations_.clear();
79 +    
80 +    delete switcher_;
81 +    delete interactionMan_;
82 +    delete fDecomp_;
83 +    delete thermo;
84 +  }
85 +  
86    /**
87     * setupCutoffs
88     *
# Line 433 | Line 443 | namespace OpenMD {
443        perturbations_.push_back(eField);
444      }
445  
446 +    usePeriodicBoundaryConditions_ = info_->getSimParams()->getUsePeriodicBoundaryConditions();
447 +    
448      fDecomp_->distributeInitialData();
449 <
450 <    initialized_ = true;
451 <
449 >    
450 >    initialized_ = true;
451 >    
452    }
453 <
453 >  
454    void ForceManager::calcForces() {
455      
456      if (!initialized_) initialize();
457 <
457 >    
458      preCalculation();  
459      shortRangeInteractions();
460      longRangeInteractions();
# Line 726 | Line 738 | namespace OpenMD {
738      
739        if (iLoop == loopStart) {
740          bool update_nlist = fDecomp_->checkNeighborList();
741 <        if (update_nlist)
741 >        if (update_nlist) {
742 >          if (!usePeriodicBoundaryConditions_)
743 >            Mat3x3d bbox = thermo->getBoundingBox();
744            neighborList = fDecomp_->buildNeighborList();
745 <      }            
745 >        }
746 >      }
747  
748        for (vector<pair<int, int> >::iterator it = neighborList.begin();
749               it != neighborList.end(); ++it) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines