70 |
|
for (mol = info_->beginMolecule(miter); mol != NULL; mol = info_->nextMolecule(miter)) { |
71 |
|
for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL; |
72 |
|
integrableObject = mol->nextIntegrableObject(iiter)) { |
73 |
< |
|
73 |
> |
|
74 |
|
double mass = integrableObject->getMass(); |
75 |
|
Vector3d vel = integrableObject->getVel(); |
76 |
< |
|
76 |
> |
|
77 |
|
kinetic += mass * (vel[0]*vel[0] + vel[1]*vel[1] + vel[2]*vel[2]); |
78 |
< |
|
78 |
> |
|
79 |
|
if (integrableObject->isDirectional()) { |
80 |
|
angMom = integrableObject->getJ(); |
81 |
|
I = integrableObject->getI(); |
110 |
|
double Thermo::getPotential() { |
111 |
|
double potential = 0.0; |
112 |
|
Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
113 |
< |
double potential_local = curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] + |
114 |
< |
curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] ; |
113 |
> |
double shortRangePot_local = curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] ; |
114 |
|
|
115 |
|
// Get total potential for entire system from MPI. |
116 |
|
|
117 |
|
#ifdef IS_MPI |
118 |
|
|
119 |
< |
MPI_Allreduce(&potential_local, &potential, 1, MPI_DOUBLE, MPI_SUM, |
119 |
> |
MPI_Allreduce(&shortRangePot_local, &potential, 1, MPI_DOUBLE, MPI_SUM, |
120 |
|
MPI_COMM_WORLD); |
121 |
+ |
potential += curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; |
122 |
|
|
123 |
|
#else |
124 |
|
|
125 |
< |
potential = potential_local; |
125 |
> |
potential = shortRangePot_local + curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; |
126 |
|
|
127 |
|
#endif // is_mpi |
128 |
|
|