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

Comparing branches/development/src/brains/Stats.hpp (file contents):
Revision 1710 by gezelter, Fri May 18 21:44:02 2012 UTC vs.
Revision 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC

# Line 53 | Line 53
53  
54   #include <string>
55   #include <map>
56 + #include <bitset>
57  
58   #include "math/SquareMatrix3.hpp"
59 + #include "utils/Accumulator.hpp"
60 + #include "brains/SimInfo.hpp"
61 +
62 + using namespace std;
63   namespace OpenMD {
64  
60  /**
61   * @class Stats Stats.hpp "brains/Stats.hpp"
62   */
65    class Stats{
66    public:
67      enum StatsIndex {
# Line 77 | Line 79 | namespace OpenMD {
79        TRANSLATIONAL_KINETIC,
80        ROTATIONAL_KINETIC,
81        LONG_RANGE_POTENTIAL,  
80      SHORT_RANGE_POTENTIAL,
82        VANDERWAALS_POTENTIAL,
83        ELECTROSTATIC_POTENTIAL,
84 +      METALLIC_POTENTIAL,
85 +      HYDROGENBONDING_POTENTIAL,
86 +      SHORT_RANGE_POTENTIAL,
87        BOND_POTENTIAL,
88        BEND_POTENTIAL,
89        DIHEDRAL_POTENTIAL,
90        INVERSION_POTENTIAL,
91 <      VRAW,
92 <      VHARM,
93 <      PRESSURE_TENSOR_XX,
94 <      PRESSURE_TENSOR_XY,
91 <      PRESSURE_TENSOR_XZ,
92 <      PRESSURE_TENSOR_YX,
93 <      PRESSURE_TENSOR_YY,
94 <      PRESSURE_TENSOR_YZ,
95 <      PRESSURE_TENSOR_ZX,
96 <      PRESSURE_TENSOR_ZY,
97 <      PRESSURE_TENSOR_ZZ,
98 <      BOX_DIPOLE_X,
99 <      BOX_DIPOLE_Y,
100 <      BOX_DIPOLE_Z,
91 >      RAW_POTENTIAL,
92 >      RESTRAINT_POTENTIAL,
93 >      PRESSURE_TENSOR,
94 >      SYSTEM_DIPOLE,
95        TAGGED_PAIR_DISTANCE,
96        RNEMD_EXCHANGE_TOTAL,
97        SHADOWH,
98 +      HELFANDMOMENT,
99 +      HEATFLUX,  
100 +      ELECTRONIC_TEMPERATURE,
101        ENDINDEX  //internal use
102      };
103  
104 <    Stats();
105 <    const RealType& operator [](int index) const {
106 <      assert(index >=0 && index < ENDINDEX);
107 <      return data_[index];
108 <    }
104 >    struct StatsData {
105 >      string title;
106 >      string units;
107 >      string dataType;
108 >      Accumulator* accumulator;
109 >    };
110 >    
111 >    typedef bitset<ENDINDEX-BEGININDEX> StatsBitSet;
112 >    typedef map<string, StatsIndex> StatsMapType;
113  
114 <    RealType& operator [](int index){
115 <      assert(index >=0 && index < ENDINDEX);            
116 <      return data_[index];
116 <    }
117 <        
118 <    static std::string getTitle(int index) {
119 <      assert(index >=0 && index < ENDINDEX);
120 <      return title_[index];
121 <    }
114 >    Stats(SimInfo* info);
115 >    void parseStatFileFormat(const std::string& format);
116 >    void collectStats();
117  
118 <    static std::string getUnits(int index) {
119 <      assert(index >=0 && index < ENDINDEX);
120 <      return units_[index];
126 <    }
118 >    StatsBitSet  getStatsMask();
119 >    StatsMapType getStatsMap();
120 >    void         setStatsMask(StatsBitSet mask);
121  
122 <    typedef std::map<std::string, Stats::StatsIndex> StatsMapType;
123 <    static  StatsMapType statsMap;
124 <  
122 >    string    getTitle(int index);
123 >    string    getUnits(int index);
124 >    string    getDataType(int index);
125 >
126 >    int       getIntData(int index);
127 >    RealType  getRealData(int index);
128 >    Vector3d  getVectorData(int index);
129 >    Mat3x3d   getMatrixData(int index);
130 >    
131    private:
132 <    static void init();
133 <    static bool isInit_;
134 <    RealType data_[ENDINDEX - BEGININDEX];
135 <    static std::string title_[ENDINDEX - BEGININDEX];
136 <    static std::string units_[ENDINDEX - BEGININDEX];
132 >    SimInfo* info_;
133 >    void init();
134 >    bool isInit_;
135 >    vector<StatsData> data_;
136 >    StatsBitSet statsMask_;
137 >    StatsMapType statsMap_;
138    };
138
139
140
139   } //end namespace OpenMD
140   #endif //BRAINS_STATS_HPP

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines