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 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC vs.
Revision 1780 by jmarr, Mon Aug 20 18:28:22 2012 UTC

# Line 58 | Line 58
58   #include "primitives/Torsion.hpp"
59   #include "primitives/Inversion.hpp"
60   #include "nonbonded/NonBondedInteraction.hpp"
61 + #include "perturbations/ElectricField.hpp"
62   #include "parallel/ForceMatrixDecomposition.hpp"
63  
64   #include <cstdio>
# Line 423 | Line 424 | namespace OpenMD {
424      electrostaticScale_[2] = fopts.getelectrostatic13scale();
425      electrostaticScale_[3] = fopts.getelectrostatic14scale();    
426      
427 +    if (info_->getSimParams()->haveElectricField()) {
428 +      ElectricField* eField = new ElectricField(info_);
429 +      perturbations_.push_back(eField);
430 +    }
431 +
432      fDecomp_->distributeInitialData();
433  
434      initialized_ = true;
# Line 675 | Line 681 | namespace OpenMD {
681      InteractionData idat;
682      SelfData sdat;
683      RealType mf;
678    RealType lrPot;
684      RealType vpair;
685      RealType dVdFQ1(0.0);
686      RealType dVdFQ2(0.0);
# Line 869 | Line 874 | namespace OpenMD {
874  
875            fDecomp_->collectIntermediateData();
876  
877 <          for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
877 >          for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
878              fDecomp_->fillSelfData(sdat, atom1);
879              interactionMan_->doPreForce(sdat);
880            }
# Line 884 | Line 889 | namespace OpenMD {
889      fDecomp_->collectData();
890          
891      if (info_->requiresSelfCorrection()) {
892 <      for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
892 >      for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
893          fDecomp_->fillSelfData(sdat, atom1);
894          interactionMan_->doSelfCorrection(sdat);
895        }
# Line 897 | Line 902 | namespace OpenMD {
902        *(fDecomp_->getPairwisePotential());
903  
904      curSnapshot->setLongRangePotential(longRangePotential);
900
901    // lrPot = longRangePotential.sum();
902
903    // //store the long range potential  
904    // curSnapshot->setLongRangePotential(lrPot);
905      
906      curSnapshot->setExcludedPotentials(*(fDecomp_->getExcludedSelfPotential()) +
907                                           *(fDecomp_->getExcludedPotential()));
# Line 910 | Line 910 | namespace OpenMD {
910  
911    
912    void ForceManager::postCalculation() {
913 +
914 +    vector<Perturbation*>::iterator pi;
915 +    for (pi = perturbations_.begin(); pi != perturbations_.end(); ++pi) {
916 +      (*pi)->applyPerturbation();
917 +    }
918 +
919      SimInfo::MoleculeIterator mi;
920      Molecule* mol;
921      Molecule::RigidBodyIterator rbIter;
# Line 934 | Line 940 | namespace OpenMD {
940      curSnapshot->setStressTensor(stressTensor);
941      
942    }
937
943   } //end namespace OpenMD

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines