| 1 |
+ |
#define _LARGEFILE_SOURCE64 |
| 2 |
|
#define _FILE_OFFSET_BITS 64 |
| 3 |
|
|
| 4 |
< |
#include <cstring> |
| 4 |
> |
#include <string.h> |
| 5 |
|
#include <iostream> |
| 6 |
|
#include <fstream> |
| 7 |
|
|
| 18 |
|
#endif // is_mpi |
| 19 |
|
|
| 20 |
|
strcpy( outName, entry_plug->statusName ); |
| 21 |
< |
|
| 21 |
> |
|
| 22 |
|
//std::cerr << "Opening " << outName << " for stat\n"; |
| 23 |
|
|
| 24 |
|
outFile.open(outName, ios::out | ios::trunc ); |
| 31 |
|
painCave.isFatal = 1; |
| 32 |
|
simError(); |
| 33 |
|
} |
| 34 |
< |
|
| 34 |
> |
|
| 35 |
|
//outFile.setf( ios::scientific ); |
| 36 |
< |
outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\tenthalpy\tconserved quantity\n"; |
| 36 |
> |
outFile << "#time(fs)\tE_tot\tV\tKE\tT(K)\tP(atm)\tVol(A^3)\tH_conserved"; |
| 37 |
> |
|
| 38 |
> |
if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) |
| 39 |
> |
outFile << "\tV_raw"; |
| 40 |
|
|
| 41 |
< |
|
| 41 |
> |
if (entry_plug->useSolidThermInt) |
| 42 |
> |
outFile << "\tV_harm"; |
| 43 |
|
|
| 44 |
+ |
outFile << "\n"; |
| 45 |
+ |
|
| 46 |
+ |
|
| 47 |
|
#ifdef IS_MPI |
| 48 |
|
} |
| 49 |
|
|
| 71 |
|
|
| 72 |
|
void StatWriter::writeStat( double currentTime ){ |
| 73 |
|
|
| 74 |
< |
double totE, potE, kinE, temp, press, vol, enthalpy; |
| 74 |
> |
double totE, potE, kinE, temp, press, vol; |
| 75 |
|
double conservedQuantity; |
| 76 |
|
|
| 77 |
|
totE = tStats->getTotalE(); |
| 80 |
|
temp = tStats->getTemperature(); |
| 81 |
|
press = tStats->getPressure(); |
| 82 |
|
vol = tStats->getVolume(); |
| 75 |
– |
enthalpy = tStats->getEnthalpy(); |
| 83 |
|
conservedQuantity = entry_plug->the_integrator->getConservedQuantity(); |
| 84 |
+ |
|
| 85 |
|
#ifdef IS_MPI |
| 86 |
|
if(worldRank == 0 ){ |
| 87 |
|
#endif // is_mpi |
| 95 |
|
<< temp << "\t" |
| 96 |
|
<< press << "\t" |
| 97 |
|
<< vol << "\t" |
| 98 |
< |
<< enthalpy << "\t" |
| 91 |
< |
<< conservedQuantity << "\n"; |
| 98 |
> |
<< conservedQuantity; |
| 99 |
|
|
| 100 |
+ |
if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) |
| 101 |
+ |
outFile << "\t" << entry_plug->vRaw; |
| 102 |
+ |
|
| 103 |
+ |
if (entry_plug->useSolidThermInt) |
| 104 |
+ |
outFile << "\t" << entry_plug->vHarm; |
| 105 |
+ |
|
| 106 |
+ |
outFile << "\n"; |
| 107 |
+ |
|
| 108 |
|
outFile.flush(); |
| 109 |
|
|
| 110 |
|
#ifdef IS_MPI |
| 111 |
|
} |
| 112 |
|
#endif // is_mpi |
| 113 |
|
} |
| 114 |
+ |
|