ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/md_code/StatWriter.cpp
Revision: 11
Committed: Tue Jul 9 18:40:59 2002 UTC (21 years, 11 months ago) by mmeineke
File size: 882 byte(s)
Log Message:
This commit was generated by cvs2svn to compensate for changes in r10, which
included commits to RCS files with non-trunk default branches.

File Contents

# Content
1 #include <cstring>
2 #include <iostream>
3 #include <fstream>
4
5 #include "ReadWrite.hpp"
6
7
8 StatWriter::StatWriter( SimInfo* the_entry_plug ){
9
10 entry_plug = the_entry_plug;
11
12 strcpy( outName, entry_plug->statusName );
13 outFile.open(outName, ios::out | ios::trunc );
14
15 if( !outFile ){
16
17 cerr << "Could not open \"" << outName << "\" for stat output.\n";
18 exit(8);
19 }
20
21 //outFile.setf( ios::scientific );
22 outFile << "#time(fs)\ttot_E\tpotential\tkinetic\ttemperature\n";
23
24 tStats = new Thermo( entry_plug );
25 }
26
27 StatWriter::~StatWriter( ){
28
29 outFile.close();
30 delete tStats;
31 }
32
33 void StatWriter::writeStat( double currentTime ){
34
35 outFile.precision(8);
36 outFile
37 << currentTime << "\t"
38 << tStats->getTotalE() << "\t"
39 << tStats->getPotential() << "\t"
40 << tStats->getKinetic() << "\t"
41 << tStats->getTemperature() << "\n";
42 outFile.flush();
43 }