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 1583 by gezelter, Thu Jun 16 22:00:08 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 +
134      map<string, CutoffMethod> stringToCutoffMethod;
135      stringToCutoffMethod["HARD"] = HARD;
136      stringToCutoffMethod["SWITCHED"] = SWITCHED;
# Line 518 | Line 523 | namespace OpenMD {
523      InteractionData idat;
524      SelfData sdat;
525      RealType mf;
521    potVec pot(0.0);
522    potVec longRangePotential(0.0);
526      RealType lrPot;
527      RealType vpair;
528 +    potVec longRangePotential(0.0);
529 +    potVec workPot(0.0);
530  
531      int loopStart, loopEnd;
532  
533      idat.vdwMult = &vdwMult;
534      idat.electroMult = &electroMult;
535 <    idat.pot = &pot;
535 >    idat.pot = &workPot;
536 >    sdat.pot = fDecomp_->getEmbeddingPotential();
537      idat.vpair = &vpair;
538      idat.f1 = &f1;
539      idat.sw = &sw;
540 <
540 >    idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false;
541 >    idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE) ? true : false;
542 >    
543      loopEnd = PAIR_LOOP;
544      if (info_->requiresPrepair() ) {
545        loopStart = PREPAIR_LOOP;
546      } else {
547        loopStart = PAIR_LOOP;
548      }
549 <    
549 >  
550      for (int iLoop = loopStart; iLoop <= loopEnd; iLoop++) {
551      
552        if (iLoop == loopStart) {
# Line 581 | Line 589 | namespace OpenMD {
589              for (vector<int>::iterator jb = atomListColumn.begin();
590                   jb != atomListColumn.end(); ++jb) {              
591                atom2 = (*jb);
592 <              
592 >            
593                if (!fDecomp_->skipAtomPair(atom1, atom2)) {
586                
594                  vpair = 0.0;
595 +                workPot = 0.0;
596                  f1 = V3Zero;
597  
598                  fDecomp_->fillInteractionData(idat, atom1, atom2);
# Line 683 | Line 691 | namespace OpenMD {
691              fDecomp_->fillSelfData(sdat, atom1);
692              interactionMan_->doPreForce(sdat);
693            }
694 <
694 >          
695 >          
696            fDecomp_->distributeIntermediateData();        
697          }
698        }
# Line 704 | Line 713 | namespace OpenMD {
713            atom2 = (*jb);
714            fDecomp_->fillSkipData(idat, atom1, atom2);
715            interactionMan_->doSkipCorrection(idat);
716 +          fDecomp_->unpackSkipData(idat, atom1, atom2);
717  
718          }
719        }
# Line 718 | Line 728 | namespace OpenMD {
728  
729      }
730  
731 <    longRangePotential = fDecomp_->getLongRangePotential();
731 >    longRangePotential = *(fDecomp_->getEmbeddingPotential()) +
732 >      *(fDecomp_->getPairwisePotential());
733 >
734      lrPot = longRangePotential.sum();
735  
736      //store the tau and long range potential    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines