--- trunk/mdtools/md_code/Thermo.cpp 2003/01/27 21:28:19 249 +++ trunk/mdtools/md_code/Thermo.cpp 2003/02/04 20:16:08 264 @@ -1,6 +1,9 @@ #include +#include +using namespace std; #ifdef IS_MPI +#include #include #endif //is_mpi @@ -14,6 +17,7 @@ Thermo::Thermo( SimInfo* the_entry_plug ) { Thermo::Thermo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; int baseSeed = BASE_SEED; + gaussStream = new gaussianSPRNG( baseSeed ); } @@ -63,7 +67,7 @@ double Thermo::getKinetic(){ } } #ifdef IS_MPI - MPI_COMM_WORLD.Allreduce(&kinetic,&kinetic_global,1,MPI_DOUBLE,MPI_SUM); + MPI::COMM_WORLD.Allreduce(&kinetic,&kinetic_global,1,MPI_DOUBLE,MPI_SUM); kinetic = kinetic_global; #endif //is_mpi @@ -94,8 +98,9 @@ double Thermo::getPotential(){ // Get total potential for entire system from MPI. #ifdef IS_MPI - MPI_COMM_WORLD.Allreduce(&potential,&potential_global,1,MPI_DOUBLE,MPI_SUM); + MPI::COMM_WORLD.Allreduce(&potential,&potential_global,1,MPI_DOUBLE,MPI_SUM); potential = potential_global; + #endif // is_mpi return potential; @@ -185,7 +190,7 @@ void Thermo::velocitize() { #ifdef IS_MPI #error "SPRNG random number generator must be used for MPI" #else -#warning "Using drand48 for random number generation" + // warning "Using drand48 for random number generation" #endif // is_mpi x = drand48(); @@ -199,6 +204,7 @@ void Thermo::velocitize() { x = drand48(); y = drand48(); vz = vbar * sqrt( -2.0 * log(x)) * cos(2 * M_PI * y); + #endif // use_spring #ifdef USE_SPRNG @@ -260,7 +266,7 @@ void Thermo::velocitize() { #ifdef IS_MPI #error "SPRNG random number generator must be used for MPI" #else // is_mpi -#warning "Using drand48 for random number generation" + //warning "Using drand48 for random number generation" #endif // is_MPI vbar = sqrt( 2.0 * kebar * dAtom->getIxx() );