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 1808 by gezelter, Mon Oct 22 20:42:10 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines