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 1180 by chrisfen, Thu May 20 20:24:07 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 32 | Line 31 | StatWriter::StatWriter( SimInfo* the_entry_plug ){
31        painCave.isFatal = 1;
32        simError();
33      }
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    }
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 <    rawFile << "#time(fs)\tRaw Pot\t Raw Harm\n";
41 >    if (entry_plug->useSolidThermInt)
42 >      outFile << "\tV_harm";
43  
44 +    outFile << "\n";
45 +
46 +    
47   #ifdef IS_MPI
48    }
49  
# Line 67 | Line 62 | StatWriter::~StatWriter( ){
62   #endif // is_mpi
63  
64      outFile.close();
70    rawFile.close();
65      delete tStats;
66  
67   #ifdef IS_MPI
# Line 87 | 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 100 | 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
108 <  }
109 < #endif // is_mpi
110 < }
106 >    outFile << "\n";
107  
108 < void StatWriter::writeRaw( double currentTime ){
108 >    outFile.flush();
109  
114  double rawPot, rawHarm;
115
116  rawPot = entry_plug->vRaw;
117  rawHarm = entry_plug->vHarm;
118
110   #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
111    }
112   #endif // is_mpi
113   }
114 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines