--- branches/mmeineke/OOPSE/libmdtools/StatWriter.cpp 2003/03/21 17:42:12 377 +++ trunk/OOPSE/libmdtools/StatWriter.cpp 2004/06/02 14:56:18 1221 @@ -1,4 +1,7 @@ -#include +#define _LARGEFILE_SOURCE64 +#define _FILE_OFFSET_BITS 64 + +#include #include #include @@ -15,9 +18,9 @@ StatWriter::StatWriter( SimInfo* the_entry_plug ){ #endif // is_mpi strcpy( outName, entry_plug->statusName ); - - std::cerr << "Opening " << outName << " for stat\n"; + //std::cerr << "Opening " << outName << " for stat\n"; + outFile.open(outName, ios::out | ios::trunc ); if( !outFile ){ @@ -28,12 +31,19 @@ StatWriter::StatWriter( SimInfo* the_entry_plug ){ painCave.isFatal = 1; simError(); } - + //outFile.setf( ios::scientific ); - outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\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) + outFile << "\tV_harm"; + outFile << "\n"; + + #ifdef IS_MPI } @@ -61,12 +71,16 @@ void StatWriter::writeStat( double currentTime ){ void StatWriter::writeStat( double currentTime ){ - double totE, potE, kinE, temp; + double totE, potE, kinE, temp, press, vol; + double conservedQuantity; totE = tStats->getTotalE(); potE = tStats->getPotential(); kinE = tStats->getKinetic(); temp = tStats->getTemperature(); + press = tStats->getPressure(); + vol = tStats->getVolume(); + conservedQuantity = entry_plug->the_integrator->getConservedQuantity(); #ifdef IS_MPI if(worldRank == 0 ){ @@ -78,10 +92,23 @@ void StatWriter::writeStat( double currentTime ){ << totE << "\t" << potE << "\t" << kinE << "\t" - << temp << "\n"; + << temp << "\t" + << press << "\t" + << vol << "\t" + << conservedQuantity; + + if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) + outFile << "\t" << entry_plug->vRaw; + + if (entry_plug->useSolidThermInt) + outFile << "\t" << entry_plug->vHarm; + + outFile << "\n"; + outFile.flush(); #ifdef IS_MPI } #endif // is_mpi } +