--- trunk/OOPSE/libmdtools/Thermo.cpp 2003/03/26 15:37:05 403 +++ trunk/OOPSE/libmdtools/Thermo.cpp 2003/04/03 13:43:02 444 @@ -10,6 +10,7 @@ using namespace std; #include "Thermo.hpp" #include "SRI.hpp" #include "Integrator.hpp" +#include "simError.h" #ifdef IS_MPI #define __C @@ -86,17 +87,26 @@ double Thermo::getPotential(){ double potential_local; double potential; int el, nSRI; - SRI** sris; + Molecule* molecules; - sris = entry_plug->sr_interactions; + molecules = entry_plug->molecules; nSRI = entry_plug->n_SRI; potential_local = 0.0; + potential = 0.0; potential_local += entry_plug->lrPot; - for( el=0; elget_potential(); + for( el=0; eln_mol; el++ ){ + potential_local += molecules[el].getPotential(); } + +#ifdef IS_MPI + /* + std::cerr << "node " << worldRank << ": before LONG RANGE pot = " << entry_plug->lrPot + << "; pot_local = " << potential_local + << "; pot = " << potential << "\n"; + */ +#endif // Get total potential for entire system from MPI. #ifdef IS_MPI @@ -105,6 +115,12 @@ double Thermo::getPotential(){ potential = potential_local; #endif // is_mpi +#ifdef IS_MPI + /* + std::cerr << "node " << worldRank << ": after pot = " << potential << "\n"; + */ +#endif + return potential; } @@ -196,7 +212,7 @@ void Thermo::velocitize() { av2 = 2.0 * kebar / atoms[vr]->getMass(); vbar = sqrt( av2 ); - + // vbar = sqrt( 8.31451e-7 * temperature / atoms[vr]->getMass() ); // picks random velocities from a gaussian distribution