--- trunk/OOPSE/libmdtools/StatWriter.cpp 2004/06/01 18:07:34 1213 +++ trunk/OOPSE/libmdtools/StatWriter.cpp 2004/06/02 14:56:18 1221 @@ -18,7 +18,6 @@ StatWriter::StatWriter( SimInfo* the_entry_plug ){ #endif // is_mpi strcpy( outName, entry_plug->statusName ); - strcpy( rawName, entry_plug->rawPotName ); //std::cerr << "Opening " << outName << " for stat\n"; @@ -34,38 +33,17 @@ StatWriter::StatWriter( SimInfo* the_entry_plug ){ } //outFile.setf( ios::scientific ); - outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\tconserved quantity\n"; + outFile << "#time(fs)\tE_tot\tV\tKE\tT(K)\tP(atm)\tVol(A^3)\tH_conserved"; + + if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) + outFile << "\tV_raw"; - if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) { - rawFile.open(rawName, ios::out | ios::trunc ); - - if( !rawFile ){ - - sprintf( painCave.errMsg, - "Could not open \"%s\" for stat output.\n", - rawName); - painCave.isFatal = 1; - simError(); - } - - rawFile << "#time(fs)\tRaw Pot\t Raw Harm\n"; - } + if (entry_plug->useSolidThermInt) + outFile << "\tV_harm"; - if (entry_plug->useLiquidThermInt) { - rawFile.open(rawName, ios::out | ios::trunc ); - - if( !rawFile ){ - - sprintf( painCave.errMsg, - "Could not open \"%s\" for stat output.\n", - rawName); - painCave.isFatal = 1; - simError(); - } - - rawFile << "#time(fs)\tRaw Pot\n"; - } + outFile << "\n"; + #ifdef IS_MPI } @@ -84,7 +62,6 @@ StatWriter::~StatWriter( ){ #endif // is_mpi outFile.close(); - rawFile.close(); delete tStats; #ifdef IS_MPI @@ -104,6 +81,7 @@ void StatWriter::writeStat( double currentTime ){ press = tStats->getPressure(); vol = tStats->getVolume(); conservedQuantity = entry_plug->the_integrator->getConservedQuantity(); + #ifdef IS_MPI if(worldRank == 0 ){ #endif // is_mpi @@ -117,35 +95,20 @@ void StatWriter::writeStat( double currentTime ){ << temp << "\t" << press << "\t" << vol << "\t" - << conservedQuantity << "\n"; + << conservedQuantity; - outFile.flush(); + if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) + outFile << "\t" << entry_plug->vRaw; + + if (entry_plug->useSolidThermInt) + outFile << "\t" << entry_plug->vHarm; -#ifdef IS_MPI - } -#endif // is_mpi -} + outFile << "\n"; -void StatWriter::writeRaw( double currentTime ){ + outFile.flush(); - double rawPot, rawHarm; - - rawPot = entry_plug->vRaw; - rawHarm = entry_plug->vHarm; - #ifdef IS_MPI - if(worldRank == 0 ){ -#endif // is_mpi - - rawFile.precision(8); - rawFile - << currentTime << "\t" - << rawPot << "\t" - << rawHarm << "\n"; - - rawFile.flush(); - -#ifdef IS_MPI } #endif // is_mpi } +