| 18 |
|
#endif // is_mpi |
| 19 |
|
|
| 20 |
|
strcpy( outName, entry_plug->statusName ); |
| 21 |
< |
|
| 21 |
> |
strcpy( rawName, entry_plug->rawPotName ); |
| 22 |
> |
|
| 23 |
|
//std::cerr << "Opening " << outName << " for stat\n"; |
| 24 |
|
|
| 25 |
|
outFile.open(outName, ios::out | ios::trunc ); |
| 33 |
|
simError(); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
+ |
rawFile.open(rawName, ios::out | ios::trunc ); |
| 37 |
+ |
|
| 38 |
+ |
if( !rawFile ){ |
| 39 |
+ |
|
| 40 |
+ |
sprintf( painCave.errMsg, |
| 41 |
+ |
"Could not open \"%s\" for stat output.\n", |
| 42 |
+ |
rawName); |
| 43 |
+ |
painCave.isFatal = 1; |
| 44 |
+ |
simError(); |
| 45 |
+ |
} |
| 46 |
+ |
|
| 47 |
|
//outFile.setf( ios::scientific ); |
| 48 |
|
outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\tconserved quantity\n"; |
| 49 |
|
|
| 50 |
< |
|
| 50 |
> |
rawFile << "#time(fs)\tRaw Pot\t Raw Harm\n"; |
| 51 |
|
|
| 52 |
|
#ifdef IS_MPI |
| 53 |
|
} |
| 67 |
|
#endif // is_mpi |
| 68 |
|
|
| 69 |
|
outFile.close(); |
| 70 |
+ |
rawFile.close(); |
| 71 |
|
delete tStats; |
| 72 |
|
|
| 73 |
|
#ifdef IS_MPI |
| 108 |
|
} |
| 109 |
|
#endif // is_mpi |
| 110 |
|
} |
| 111 |
+ |
|
| 112 |
+ |
void StatWriter::writeRaw( double currentTime ){ |
| 113 |
+ |
|
| 114 |
+ |
double rawPot, rawHarm; |
| 115 |
+ |
|
| 116 |
+ |
rawPot = entry_plug->vRaw; |
| 117 |
+ |
rawHarm = entry_plug->vHarm; |
| 118 |
+ |
|
| 119 |
+ |
#ifdef IS_MPI |
| 120 |
+ |
if(worldRank == 0 ){ |
| 121 |
+ |
#endif // is_mpi |
| 122 |
+ |
|
| 123 |
+ |
rawFile.precision(8); |
| 124 |
+ |
rawFile |
| 125 |
+ |
<< currentTime << "\t" |
| 126 |
+ |
<< rawPot << "\t" |
| 127 |
+ |
<< rawHarm << "\n"; |
| 128 |
+ |
|
| 129 |
+ |
rawFile.flush(); |
| 130 |
+ |
|
| 131 |
+ |
#ifdef IS_MPI |
| 132 |
+ |
} |
| 133 |
+ |
#endif // is_mpi |
| 134 |
+ |
} |