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 1756 by gezelter, Mon Jun 18 18:23:20 2012 UTC vs.
Revision 1760 by gezelter, Thu Jun 21 19:26:46 2012 UTC

# Line 586 | Line 586 | namespace OpenMD {
586          }      
587        }      
588      }
589 +
590 + #ifdef IS_MPI
591 +    // Collect from all nodes.  This should eventually be moved into a
592 +    // SystemDecomposition, but this is a better place than in
593 +    // Thermo to do the collection.
594 +    MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &bondPotential, 1, MPI::REALTYPE,
595 +                              MPI::SUM);
596 +    MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &bendPotential, 1, MPI::REALTYPE,
597 +                              MPI::SUM);
598 +    MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &torsionPotential, 1,
599 +                              MPI::REALTYPE, MPI::SUM);
600 +    MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &inversionPotential, 1,
601 +                              MPI::REALTYPE, MPI::SUM);
602 + #endif
603 +
604 +    Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
605 +
606 +    curSnapshot->setBondPotential(bondPotential);
607 +    curSnapshot->setBendPotential(bendPotential);
608 +    curSnapshot->setTorsionPotential(torsionPotential);
609 +    curSnapshot->setInversionPotential(inversionPotential);
610      
611 <    RealType  shortRangePotential = bondPotential + bendPotential +
611 >    RealType shortRangePotential = bondPotential + bendPotential +
612        torsionPotential +  inversionPotential;    
613 <    Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
614 <    curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] = shortRangePotential;
594 <    curSnapshot->statData[Stats::BOND_POTENTIAL] = bondPotential;
595 <    curSnapshot->statData[Stats::BEND_POTENTIAL] = bendPotential;
596 <    curSnapshot->statData[Stats::DIHEDRAL_POTENTIAL] = torsionPotential;
597 <    curSnapshot->statData[Stats::INVERSION_POTENTIAL] = inversionPotential;    
613 >
614 >    curSnapshot->setShortRangePotential(shortRangePotential);
615    }
616    
617    void ForceManager::longRangeInteractions() {
# Line 649 | Line 666 | namespace OpenMD {
666      RealType dVdFQ2(0.0);
667      potVec longRangePotential(0.0);
668      potVec workPot(0.0);
669 +    potVec exPot(0.0);
670      vector<int>::iterator ia, jb;
671  
672      int loopStart, loopEnd;
# Line 656 | Line 674 | namespace OpenMD {
674      idat.vdwMult = &vdwMult;
675      idat.electroMult = &electroMult;
676      idat.pot = &workPot;
677 +    idat.excludedPot = &exPot;
678      sdat.pot = fDecomp_->getEmbeddingPotential();
679      idat.vpair = &vpair;
680      idat.dVdFQ1 = &dVdFQ1;
# Line 723 | Line 742 | namespace OpenMD {
742  
743                  vpair = 0.0;
744                  workPot = 0.0;
745 +                exPot = 0.0;
746                  f1 = V3Zero;
747                  dVdFQ1 = 0.0;
748                  dVdFQ2 = 0.0;
# Line 860 | Line 880 | namespace OpenMD {
880      longRangePotential = *(fDecomp_->getEmbeddingPotential()) +
881        *(fDecomp_->getPairwisePotential());
882  
883 +    curSnapshot->setLongRangePotentialFamilies(longRangePotential);
884 +
885      lrPot = longRangePotential.sum();
886  
887 <    //store the stressTensor and long range potential    
888 <    curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot;
889 <    curSnapshot->statData[Stats::VANDERWAALS_POTENTIAL] = longRangePotential[VANDERWAALS_FAMILY];
890 <    curSnapshot->statData[Stats::ELECTROSTATIC_POTENTIAL] = longRangePotential[ELECTROSTATIC_FAMILY];
887 >    //store the long range potential  
888 >    curSnapshot->setLongRangePotential(lrPot);
889 >
890 >    curSnapshot->setExcludedPotentials(*(fDecomp_->getExcludedPotential()));
891 >
892    }
893  
894    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines