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 1723 by gezelter, Thu May 24 20:59:54 2012 UTC vs.
Revision 1777 by gezelter, Thu Aug 9 18:35:09 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,
102      RNEMD_EXCHANGE_TOTAL,
96        SHADOWH,
97 <      THERMAL_HELFANDMOMENT_X,
98 <      THERMAL_HELFANDMOMENT_Y,
99 <      THERMAL_HELFANDMOMENT_Z,
107 <      HEATFLUX_X,
108 <      HEATFLUX_Y,
109 <      HEATFLUX_Z,  
97 >      HELFANDMOMENT,
98 >      HEATFLUX,  
99 >      ELECTRONIC_TEMPERATURE,
100        ENDINDEX  //internal use
101      };
102  
103 <    Stats();
104 <    const RealType& operator [](int index) const {
105 <      assert(index >=0 && index < ENDINDEX);
106 <      return data_[index];
107 <    }
103 >    struct StatsData {
104 >      string title;
105 >      string units;
106 >      string dataType;
107 >      Accumulator* accumulator;
108 >    };
109 >    
110 >    typedef bitset<ENDINDEX-BEGININDEX> StatsBitSet;
111 >    typedef map<string, StatsIndex> StatsMapType;
112  
113 <    RealType& operator [](int index){
114 <      assert(index >=0 && index < ENDINDEX);            
115 <      return data_[index];
122 <    }
123 <        
124 <    static std::string getTitle(int index) {
125 <      assert(index >=0 && index < ENDINDEX);
126 <      return title_[index];
127 <    }
113 >    Stats(SimInfo* info);
114 >    void parseStatFileFormat(const std::string& format);
115 >    void collectStats();
116  
117 <    static std::string getUnits(int index) {
118 <      assert(index >=0 && index < ENDINDEX);
119 <      return units_[index];
132 <    }
117 >    StatsBitSet  getStatsMask();
118 >    StatsMapType getStatsMap();
119 >    void         setStatsMask(StatsBitSet mask);
120  
121 <    typedef std::map<std::string, Stats::StatsIndex> StatsMapType;
122 <    static  StatsMapType statsMap;
123 <  
121 >    string    getTitle(int index);
122 >    string    getUnits(int index);
123 >    string    getDataType(int index);
124 >
125 >    int       getIntData(int index);
126 >    RealType  getRealData(int index);
127 >    Vector3d  getVectorData(int index);
128 >    Mat3x3d   getMatrixData(int index);
129 >    
130    private:
131 <    static void init();
132 <    static bool isInit_;
133 <    RealType data_[ENDINDEX - BEGININDEX];
134 <    static std::string title_[ENDINDEX - BEGININDEX];
135 <    static std::string units_[ENDINDEX - BEGININDEX];
131 >    SimInfo* info_;
132 >    void init();
133 >    bool isInit_;
134 >    vector<StatsData> data_;
135 >    StatsBitSet statsMask_;
136 >    StatsMapType statsMap_;
137    };
144
145
146
138   } //end namespace OpenMD
139   #endif //BRAINS_STATS_HPP

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines