ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/optimization/StatusFunction.hpp
(Generate patch)

Comparing branches/development/src/optimization/StatusFunction.hpp (file contents):
Revision 1750 by gezelter, Thu Jun 7 12:53:46 2012 UTC vs.
Revision 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC

# Line 2 | Line 2
2   #define OPTIMIZATION_STATUSFUNCTION_HPP
3   #include "config.h"
4   #include "io/DumpWriter.hpp"
5 + #include "brains/Stats.hpp"
6   #include "io/StatWriter.hpp"
7  
8   namespace OpenMD {
# Line 20 | Line 21 | namespace OpenMD {
21    class DumpStatusFunction : public StatusFunction {
22  
23    public:
24 <    DumpStatusFunction(SimInfo* info) : StatusFunction(), info_(info), thermo(info) {
24 >    DumpStatusFunction(SimInfo* info) : StatusFunction(), info_(info) {
25 >      stats = new Stats(info_);
26        dumpWriter = new DumpWriter(info_);    
27 <      StatsBitSet mask;
27 >      Stats::StatsBitSet mask;
28        mask.set(Stats::TIME);
29        mask.set(Stats::POTENTIAL_ENERGY);
30 <      statWriter = new StatWriter(info_->getStatFileName(), mask);
30 >      stats->setStatsMask(mask);
31 >      statWriter = new StatWriter(info_->getStatFileName(), stats);
32      }
33      virtual void writeStatus(int functionCount, int gradientCount, const DynamicVector<RealType>& x, RealType f) {
34        Snapshot* curSnapshot =info_->getSnapshotManager()->getCurrentSnapshot();
32      thermo.saveStat();
35        curSnapshot->setTime(functionCount);        
36 +
37 +      stats->collectStats();
38 +      statWriter->writeStat();
39 +
40        dumpWriter->writeDumpAndEor();
35      statWriter->writeStat(curSnapshot->statData);
41      }
42      ~DumpStatusFunction() {
43        delete dumpWriter;
# Line 41 | Line 46 | namespace OpenMD {
46      
47    private:
48      SimInfo* info_;
49 +    Stats* stats;
50      DumpWriter* dumpWriter;
51 <    StatWriter* statWriter;
46 <    Thermo thermo;
51 >    StatWriter* statWriter;    
52    };
53                              
54    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines