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

Comparing branches/development/src/brains/Thermo.cpp (file contents):
Revision 1723 by gezelter, Thu May 24 20:59:54 2012 UTC vs.
Revision 1760 by gezelter, Thu Jun 21 19:26:46 2012 UTC

# Line 112 | Line 112 | namespace OpenMD {
112  
113    RealType Thermo::getPotential() {
114      RealType potential = 0.0;
115    Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
116    RealType shortRangePot_local =  curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] ;
117
118    // Get total potential for entire system from MPI.
119
120 #ifdef IS_MPI
121
122    MPI_Allreduce(&shortRangePot_local, &potential, 1, MPI_REALTYPE, MPI_SUM,
123                  MPI_COMM_WORLD);
124    potential += curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL];
115  
116 < #else
117 <
128 <    potential = shortRangePot_local + curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL];
129 <
130 < #endif // is_mpi
131 <
116 >    Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
117 >    potential = curSnapshot->getShortRangePotential() + curSnapshot->getLongRangePotential();
118      return potential;
119    }
120  
# Line 174 | Line 160 | namespace OpenMD {
160  
161   #endif //is_mpi
162  
163 <    kinetic = kinetic * 0.5 / PhysicalConstants::energyConvert;
163 >    kinetic = kinetic * 0.5;
164      return ( 2.0 * kinetic) / (info_->getNFluctuatingCharges()* PhysicalConstants::kb );    
165    }
166  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines