--- trunk/src/brains/Thermo.cpp 2005/05/19 21:31:23 538 +++ trunk/src/brains/Thermo.cpp 2005/12/30 21:25:56 833 @@ -110,19 +110,19 @@ namespace oopse { double Thermo::getPotential() { double potential = 0.0; Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); - double potential_local = curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] + - curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] ; + double shortRangePot_local = curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] ; // Get total potential for entire system from MPI. #ifdef IS_MPI - MPI_Allreduce(&potential_local, &potential, 1, MPI_DOUBLE, MPI_SUM, + MPI_Allreduce(&shortRangePot_local, &potential, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + potential += curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; #else - potential = potential_local; + potential = shortRangePot_local + curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; #endif // is_mpi @@ -227,6 +227,12 @@ namespace oopse { stat[Stats::PRESSURE] = getPressure(); stat[Stats::VOLUME] = getVolume(); + Mat3x3d tensor =getPressureTensor(); + stat[Stats::PRESSURE_TENSOR_X] = tensor(0, 0); + stat[Stats::PRESSURE_TENSOR_Y] = tensor(1, 1); + stat[Stats::PRESSURE_TENSOR_Z] = tensor(2, 2); + + /**@todo need refactorying*/ //Conserved Quantity is set by integrator and time is set by setTime