ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/StatWriter.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/StatWriter.cpp (file contents):
Revision 1212 by chrisfen, Tue Jun 1 17:15:43 2004 UTC vs.
Revision 1221 by chrisfen, Wed Jun 2 14:56:18 2004 UTC

# Line 18 | Line 18 | StatWriter::StatWriter( SimInfo* the_entry_plug ){
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  
# Line 34 | Line 33 | StatWriter::StatWriter( SimInfo* the_entry_plug ){
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 <      if (entry_plug->useSolidThermInt) {
56 <        sprintf( painCave.errMsg,
57 <                 "It appears that you have both solid and liquid thermodynamic\n"
58 <                 "integration activated in your .bass file. To avoid confusion,\n"
59 <                 "specify only one technique in your .bass file. Liquid-state\n"
60 <                 "thermodynamic integration will be assumed for the current\n"
61 <                 "simulation. If this is not what you desire, set useSolidThermInt\n"
62 <                 "to 'true' and useLiquidThermInt to 'false' in your .bass file.",
63 <                 rawName);
64 <        painCave.isFatal = 0;
65 <        simError();
66 <      }
67 <        
68 <      rawFile.open(rawName, ios::out | ios::trunc );
69 <      
70 <      if( !rawFile ){
71 <        
72 <        sprintf( painCave.errMsg,
73 <                 "Could not open \"%s\" for stat output.\n",
74 <                 rawName);
75 <        painCave.isFatal = 1;
76 <        simError();
77 <      }
78 <      
79 <      rawFile << "#time(fs)\tRaw Pot\n";
80 <    }
44 >    outFile << "\n";
45  
46 +    
47   #ifdef IS_MPI
48    }
49  
# Line 97 | Line 62 | StatWriter::~StatWriter( ){
62   #endif // is_mpi
63  
64      outFile.close();
100    rawFile.close();
65      delete tStats;
66  
67   #ifdef IS_MPI
# Line 117 | Line 81 | void StatWriter::writeStat( double currentTime ){
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
# Line 130 | Line 95 | void StatWriter::writeStat( double currentTime ){
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
138 <  }
139 < #endif // is_mpi
140 < }
106 >    outFile << "\n";
107  
108 < void StatWriter::writeRaw( double currentTime ){
108 >    outFile.flush();
109  
144  double rawPot, rawHarm;
145
146  rawPot = entry_plug->vRaw;
147  rawHarm = entry_plug->vHarm;
148
110   #ifdef IS_MPI
150  if(worldRank == 0 ){
151 #endif // is_mpi
152
153    rawFile.precision(8);
154    rawFile
155      << currentTime << "\t"
156      << rawPot << "\t"
157      << rawHarm << "\n";
158
159    rawFile.flush();
160
161 #ifdef IS_MPI
111    }
112   #endif // is_mpi
113   }
114 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines