1 |
< |
#include <cstring> |
1 |
> |
#define _LARGEFILE_SOURCE64 |
2 |
> |
#define _FILE_OFFSET_BITS 64 |
3 |
> |
|
4 |
> |
#include <string.h> |
5 |
|
#include <iostream> |
6 |
|
#include <fstream> |
7 |
|
|
19 |
|
|
20 |
|
strcpy( outName, entry_plug->statusName ); |
21 |
|
|
22 |
< |
std::cerr << "Opening " << outName << " for stat\n"; |
22 |
> |
//std::cerr << "Opening " << outName << " for stat\n"; |
23 |
|
|
24 |
|
outFile.open(outName, ios::out | ios::trunc ); |
25 |
|
|
33 |
|
} |
34 |
|
|
35 |
|
//outFile.setf( ios::scientific ); |
36 |
< |
outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\n"; |
36 |
> |
outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\tconserved quantity\n"; |
37 |
|
|
38 |
|
|
39 |
|
|
64 |
|
|
65 |
|
void StatWriter::writeStat( double currentTime ){ |
66 |
|
|
67 |
< |
const double p_convert = 1.63882576e8; |
68 |
< |
double totE, potE, kinE, temp, press; |
67 |
> |
double totE, potE, kinE, temp, press, vol; |
68 |
> |
double conservedQuantity; |
69 |
|
|
70 |
|
totE = tStats->getTotalE(); |
71 |
|
potE = tStats->getPotential(); |
72 |
|
kinE = tStats->getKinetic(); |
73 |
|
temp = tStats->getTemperature(); |
74 |
< |
press = tStats->getPressure()*p_convert; |
75 |
< |
|
74 |
> |
press = tStats->getPressure(); |
75 |
> |
vol = tStats->getVolume(); |
76 |
> |
conservedQuantity = entry_plug->the_integrator->getConservedQuantity(); |
77 |
|
#ifdef IS_MPI |
78 |
|
if(worldRank == 0 ){ |
79 |
|
#endif // is_mpi |
85 |
|
<< potE << "\t" |
86 |
|
<< kinE << "\t" |
87 |
|
<< temp << "\t" |
88 |
< |
<< press << "\n"; |
88 |
> |
<< press << "\t" |
89 |
> |
<< vol << "\t" |
90 |
> |
<< conservedQuantity << "\n"; |
91 |
> |
|
92 |
|
outFile.flush(); |
93 |
|
|
94 |
|
#ifdef IS_MPI |