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 378 by mmeineke, Fri Mar 21 17:42:12 2003 UTC vs.
Revision 1221 by chrisfen, Wed Jun 2 14:56:18 2004 UTC

# Line 1 | Line 1
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  
# Line 15 | Line 18 | StatWriter::StatWriter( SimInfo* the_entry_plug ){
18   #endif // is_mpi
19  
20      strcpy( outName, entry_plug->statusName );
18    
19    std::cerr << "Opening " << outName << " for stat\n";
21  
22 +    //std::cerr << "Opening " << outName << " for stat\n";
23 +
24      outFile.open(outName, ios::out | ios::trunc );
25      
26      if( !outFile ){
# Line 28 | Line 31 | StatWriter::StatWriter( SimInfo* the_entry_plug ){
31        painCave.isFatal = 1;
32        simError();
33      }
34 <    
34 >
35      //outFile.setf( ios::scientific );
36 <    outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\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 <
41 >    if (entry_plug->useSolidThermInt)
42 >      outFile << "\tV_harm";
43  
44 +    outFile << "\n";
45 +
46 +    
47   #ifdef IS_MPI
48    }
49  
# Line 61 | Line 71 | void StatWriter::writeStat( double currentTime ){
71  
72   void StatWriter::writeStat( double currentTime ){
73  
74 <  double totE, potE, kinE, temp;
74 >  double totE, potE, kinE, temp, press, vol;
75 >  double conservedQuantity;
76  
77    totE = tStats->getTotalE();
78    potE = tStats->getPotential();
79    kinE = tStats->getKinetic();
80    temp = tStats->getTemperature();
81 +  press = tStats->getPressure();
82 +  vol = tStats->getVolume();
83 +  conservedQuantity = entry_plug->the_integrator->getConservedQuantity();
84  
85   #ifdef IS_MPI
86    if(worldRank == 0 ){
# Line 78 | Line 92 | void StatWriter::writeStat( double currentTime ){
92        << totE << "\t"
93        << potE << "\t"
94        << kinE << "\t"
95 <      << temp << "\n";
95 >      << temp << "\t"
96 >      << press << "\t"
97 >      << vol << "\t"
98 >      << conservedQuantity;
99 >
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 >    outFile << "\n";
107 >
108      outFile.flush();
109  
110   #ifdef IS_MPI
111    }
112   #endif // is_mpi
113   }
114 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines