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 1581 by gezelter, Mon Jun 13 22:13:12 2011 UTC vs.
Revision 1584 by gezelter, Fri Jun 17 20:16:35 2011 UTC

# Line 59 | Line 59
59   #include "nonbonded/NonBondedInteraction.hpp"
60   #include "parallel/ForceMatrixDecomposition.hpp"
61  
62 + #include <cstdio>
63 + #include <iostream>
64 + #include <iomanip>
65 +
66   using namespace std;
67   namespace OpenMD {
68    
# Line 123 | Line 127 | namespace OpenMD {
127          painCave.severity = OPENMD_INFO;
128          simError();
129        }
126      fDecomp_->setUserCutoff(rCut_);
130      }
131  
132 +    fDecomp_->setUserCutoff(rCut_);
133 +    interactionMan_->setCutoffRadius(rCut_);
134 +
135      map<string, CutoffMethod> stringToCutoffMethod;
136      stringToCutoffMethod["HARD"] = HARD;
137      stringToCutoffMethod["SWITCHED"] = SWITCHED;
# Line 258 | Line 264 | namespace OpenMD {
264      }
265      switcher_->setSwitchType(sft_);
266      switcher_->setSwitch(rSwitch_, rCut_);
267 +    interactionMan_->setSwitchingRadius(rSwitch_);
268    }
269    
270    void ForceManager::initialize() {
# Line 518 | Line 525 | namespace OpenMD {
525      InteractionData idat;
526      SelfData sdat;
527      RealType mf;
521    potVec pot(0.0);
522    potVec longRangePotential(0.0);
528      RealType lrPot;
529      RealType vpair;
530 +    potVec longRangePotential(0.0);
531 +    potVec workPot(0.0);
532  
533      int loopStart, loopEnd;
534  
535      idat.vdwMult = &vdwMult;
536      idat.electroMult = &electroMult;
537 <    idat.pot = &pot;
537 >    idat.pot = &workPot;
538 >    sdat.pot = fDecomp_->getEmbeddingPotential();
539      idat.vpair = &vpair;
540      idat.f1 = &f1;
541      idat.sw = &sw;
542 <
542 >    idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false;
543 >    idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE) ? true : false;
544 >    
545      loopEnd = PAIR_LOOP;
546      if (info_->requiresPrepair() ) {
547        loopStart = PREPAIR_LOOP;
548      } else {
549        loopStart = PAIR_LOOP;
550      }
551 <    
551 >  
552      for (int iLoop = loopStart; iLoop <= loopEnd; iLoop++) {
553      
554        if (iLoop == loopStart) {
# Line 581 | Line 591 | namespace OpenMD {
591              for (vector<int>::iterator jb = atomListColumn.begin();
592                   jb != atomListColumn.end(); ++jb) {              
593                atom2 = (*jb);
594 <              
594 >            
595                if (!fDecomp_->skipAtomPair(atom1, atom2)) {
586                
596                  vpair = 0.0;
597 +                workPot = 0.0;
598                  f1 = V3Zero;
599  
600                  fDecomp_->fillInteractionData(idat, atom1, atom2);
# Line 683 | Line 693 | namespace OpenMD {
693              fDecomp_->fillSelfData(sdat, atom1);
694              interactionMan_->doPreForce(sdat);
695            }
696 <
696 >          
697 >          
698            fDecomp_->distributeIntermediateData();        
699          }
700        }
# Line 704 | Line 715 | namespace OpenMD {
715            atom2 = (*jb);
716            fDecomp_->fillSkipData(idat, atom1, atom2);
717            interactionMan_->doSkipCorrection(idat);
718 +          fDecomp_->unpackSkipData(idat, atom1, atom2);
719  
720          }
721        }
# Line 718 | Line 730 | namespace OpenMD {
730  
731      }
732  
733 <    longRangePotential = fDecomp_->getLongRangePotential();
733 >    longRangePotential = *(fDecomp_->getEmbeddingPotential()) +
734 >      *(fDecomp_->getPairwisePotential());
735 >
736      lrPot = longRangePotential.sum();
737  
738      //store the tau and long range potential    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines