| 18 |
|
#endif // is_mpi |
| 19 |
|
|
| 20 |
|
strcpy( outName, entry_plug->statusName ); |
| 21 |
– |
strcpy( rawName, entry_plug->rawPotName ); |
| 21 |
|
|
| 22 |
|
//std::cerr << "Opening " << outName << " for stat\n"; |
| 23 |
|
|
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
//outFile.setf( ios::scientific ); |
| 36 |
< |
outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\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 |
< |
if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) { |
| 42 |
< |
rawFile.open(rawName, ios::out | ios::trunc ); |
| 41 |
< |
|
| 42 |
< |
if( !rawFile ){ |
| 43 |
< |
|
| 44 |
< |
sprintf( painCave.errMsg, |
| 45 |
< |
"Could not open \"%s\" for stat output.\n", |
| 46 |
< |
rawName); |
| 47 |
< |
painCave.isFatal = 1; |
| 48 |
< |
simError(); |
| 49 |
< |
} |
| 50 |
< |
|
| 51 |
< |
rawFile << "#time(fs)\tRaw Pot\t Raw Harm\n"; |
| 52 |
< |
} |
| 41 |
> |
if (entry_plug->useSolidThermInt) |
| 42 |
> |
outFile << "\tV_harm"; |
| 43 |
|
|
| 44 |
< |
if (entry_plug->useLiquidThermInt) { |
| 55 |
< |
rawFile.open(rawName, ios::out | ios::trunc ); |
| 56 |
< |
|
| 57 |
< |
if( !rawFile ){ |
| 58 |
< |
|
| 59 |
< |
sprintf( painCave.errMsg, |
| 60 |
< |
"Could not open \"%s\" for stat output.\n", |
| 61 |
< |
rawName); |
| 62 |
< |
painCave.isFatal = 1; |
| 63 |
< |
simError(); |
| 64 |
< |
} |
| 65 |
< |
|
| 66 |
< |
rawFile << "#time(fs)\tRaw Pot\n"; |
| 67 |
< |
} |
| 44 |
> |
outFile << "\n"; |
| 45 |
|
|
| 46 |
+ |
|
| 47 |
|
#ifdef IS_MPI |
| 48 |
|
} |
| 49 |
|
|
| 62 |
|
#endif // is_mpi |
| 63 |
|
|
| 64 |
|
outFile.close(); |
| 87 |
– |
rawFile.close(); |
| 65 |
|
delete tStats; |
| 66 |
|
|
| 67 |
|
#ifdef IS_MPI |
| 81 |
|
press = tStats->getPressure(); |
| 82 |
|
vol = tStats->getVolume(); |
| 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 |
< |
<< conservedQuantity << "\n"; |
| 98 |
> |
<< conservedQuantity; |
| 99 |
|
|
| 100 |
< |
outFile.flush(); |
| 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 |
< |
#ifdef IS_MPI |
| 125 |
< |
} |
| 126 |
< |
#endif // is_mpi |
| 127 |
< |
} |
| 106 |
> |
outFile << "\n"; |
| 107 |
|
|
| 108 |
< |
void StatWriter::writeRaw( double currentTime ){ |
| 108 |
> |
outFile.flush(); |
| 109 |
|
|
| 131 |
– |
double rawPot, rawHarm; |
| 132 |
– |
|
| 133 |
– |
rawPot = entry_plug->vRaw; |
| 134 |
– |
rawHarm = entry_plug->vHarm; |
| 135 |
– |
|
| 110 |
|
#ifdef IS_MPI |
| 137 |
– |
if(worldRank == 0 ){ |
| 138 |
– |
#endif // is_mpi |
| 139 |
– |
|
| 140 |
– |
rawFile.precision(8); |
| 141 |
– |
rawFile |
| 142 |
– |
<< currentTime << "\t" |
| 143 |
– |
<< rawPot << "\t" |
| 144 |
– |
<< rawHarm << "\n"; |
| 145 |
– |
|
| 146 |
– |
rawFile.flush(); |
| 147 |
– |
|
| 148 |
– |
#ifdef IS_MPI |
| 111 |
|
} |
| 112 |
|
#endif // is_mpi |
| 113 |
|
} |
| 114 |
+ |
|