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] ; |
115 |
|
|
116 |
< |
// Get total potential for entire system from MPI. |
117 |
< |
|
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]; |
125 |
< |
|
126 |
< |
#else |
127 |
< |
|
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 |
|
|