# | Line 18 | Line 18 | StatWriter::StatWriter( SimInfo* the_entry_plug ){ | |
---|---|---|
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 ); | |
# | Line 31 | Line 32 | StatWriter::StatWriter( SimInfo* the_entry_plug ){ | |
32 | painCave.isFatal = 1; | |
33 | simError(); | |
34 | } | |
35 | < | |
35 | > | |
36 | //outFile.setf( ios::scientific ); | |
37 | outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\tpressure\tvolume\tconserved quantity\n"; | |
38 | ||
39 | < | |
39 | > | if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) { |
40 | > | 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 | > | } |
53 | ||
54 | + | 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 | + | } |
68 | + | |
69 | #ifdef IS_MPI | |
70 | } | |
71 | ||
# | Line 55 | Line 84 | StatWriter::~StatWriter( ){ | |
84 | #endif // is_mpi | |
85 | ||
86 | outFile.close(); | |
87 | + | rawFile.close(); |
88 | delete tStats; | |
89 | ||
90 | #ifdef IS_MPI | |
# | Line 95 | Line 125 | void StatWriter::writeStat( double currentTime ){ | |
125 | } | |
126 | #endif // is_mpi | |
127 | } | |
128 | + | |
129 | + | void StatWriter::writeRaw( double currentTime ){ |
130 | + | |
131 | + | double rawPot, rawHarm; |
132 | + | |
133 | + | rawPot = entry_plug->vRaw; |
134 | + | rawHarm = entry_plug->vHarm; |
135 | + | |
136 | + | #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 |
149 | + | } |
150 | + | #endif // is_mpi |
151 | + | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |