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 |
|
|
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 |
|
|