| 1 | gezelter | 1710 | /* | 
| 2 |  |  | * Copyright (c) 2005, 2009 The University of Notre Dame. All Rights Reserved. | 
| 3 |  |  | * | 
| 4 |  |  | * The University of Notre Dame grants you ("Licensee") a | 
| 5 |  |  | * non-exclusive, royalty free, license to use, modify and | 
| 6 |  |  | * redistribute this software in source and binary code form, provided | 
| 7 |  |  | * that the following conditions are met: | 
| 8 |  |  | * | 
| 9 |  |  | * 1. Redistributions of source code must retain the above copyright | 
| 10 |  |  | *    notice, this list of conditions and the following disclaimer. | 
| 11 |  |  | * | 
| 12 |  |  | * 2. Redistributions in binary form must reproduce the above copyright | 
| 13 |  |  | *    notice, this list of conditions and the following disclaimer in the | 
| 14 |  |  | *    documentation and/or other materials provided with the | 
| 15 |  |  | *    distribution. | 
| 16 |  |  | * | 
| 17 |  |  | * This software is provided "AS IS," without a warranty of any | 
| 18 |  |  | * kind. All express or implied conditions, representations and | 
| 19 |  |  | * warranties, including any implied warranty of merchantability, | 
| 20 |  |  | * fitness for a particular purpose or non-infringement, are hereby | 
| 21 |  |  | * excluded.  The University of Notre Dame and its licensors shall not | 
| 22 |  |  | * be liable for any damages suffered by licensee as a result of | 
| 23 |  |  | * using, modifying or distributing the software or its | 
| 24 |  |  | * derivatives. In no event will the University of Notre Dame or its | 
| 25 |  |  | * licensors be liable for any lost revenue, profit or data, or for | 
| 26 |  |  | * direct, indirect, special, consequential, incidental or punitive | 
| 27 |  |  | * damages, however caused and regardless of the theory of liability, | 
| 28 |  |  | * arising out of the use of or inability to use software, even if the | 
| 29 |  |  | * University of Notre Dame has been advised of the possibility of | 
| 30 |  |  | * such damages. | 
| 31 |  |  | * | 
| 32 |  |  | * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your | 
| 33 |  |  | * research, please cite the appropriate papers when you publish your | 
| 34 |  |  | * work.  Good starting points are: | 
| 35 |  |  | * | 
| 36 |  |  | * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). | 
| 37 |  |  | * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). | 
| 38 |  |  | * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). | 
| 39 |  |  | * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010). | 
| 40 |  |  | * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | 
| 41 |  |  | */ | 
| 42 |  |  |  | 
| 43 |  |  | /** | 
| 44 |  |  | * @file Stats.cpp | 
| 45 |  |  | * @author tlin | 
| 46 |  |  | * @date 11/04/2004 | 
| 47 |  |  | * @time 14:26am | 
| 48 |  |  | * @version 1.0 | 
| 49 |  |  | */ | 
| 50 |  |  |  | 
| 51 |  |  | #include "brains/Stats.hpp" | 
| 52 |  |  |  | 
| 53 |  |  | namespace OpenMD { | 
| 54 |  |  |  | 
| 55 |  |  | bool Stats::isInit_ = false; | 
| 56 |  |  | std::string Stats::title_[Stats::ENDINDEX - Stats::BEGININDEX]; | 
| 57 |  |  | std::string Stats::units_[Stats::ENDINDEX - Stats::BEGININDEX]; | 
| 58 |  |  | Stats::StatsMapType Stats::statsMap; | 
| 59 |  |  | Stats::Stats() { | 
| 60 |  |  |  | 
| 61 |  |  | if (!isInit_) { | 
| 62 |  |  | init(); | 
| 63 |  |  | isInit_ = true; | 
| 64 |  |  | } | 
| 65 |  |  |  | 
| 66 |  |  | } | 
| 67 |  |  |  | 
| 68 |  |  | void Stats::init() { | 
| 69 |  |  |  | 
| 70 |  |  | Stats::title_[TIME] = "Time"; | 
| 71 |  |  | Stats::title_[TOTAL_ENERGY] = "Total Energy"; | 
| 72 |  |  | Stats::title_[POTENTIAL_ENERGY] = "Potential Energy"; | 
| 73 |  |  | Stats::title_[KINETIC_ENERGY] = "Kinetic Energy"; | 
| 74 |  |  | Stats::title_[TEMPERATURE] = "Temperature"; | 
| 75 |  |  | Stats::title_[PRESSURE] = "Pressure"; | 
| 76 |  |  | Stats::title_[VOLUME] = "Volume"; | 
| 77 |  |  | Stats::title_[HULLVOLUME] = "Hull Volume"; | 
| 78 |  |  | Stats::title_[GYRVOLUME] = "Gyrational Volume"; | 
| 79 |  |  | Stats::title_[CONSERVED_QUANTITY] = "Conserved Quantity"; | 
| 80 |  |  | Stats::title_[TRANSLATIONAL_KINETIC] = "Translational Kinetic"; | 
| 81 |  |  | Stats::title_[ROTATIONAL_KINETIC] = "Rotational Kinetic"; | 
| 82 |  |  | Stats::title_[LONG_RANGE_POTENTIAL] = "Long Range Potential"; | 
| 83 | gezelter | 1760 | Stats::title_[VANDERWAALS_POTENTIAL] = "van der Waals Potential"; | 
| 84 |  |  | Stats::title_[ELECTROSTATIC_POTENTIAL] = "Electrostatic Potential"; | 
| 85 |  |  | Stats::title_[METALLIC_POTENTIAL] = "Metallic Potential"; | 
| 86 |  |  | Stats::title_[HYDROGENBONDING_POTENTIAL] = "Hydrogen Bonding Potential"; | 
| 87 | gezelter | 1710 | Stats::title_[SHORT_RANGE_POTENTIAL] = "Short Range Potential"; | 
| 88 |  |  | Stats::title_[BOND_POTENTIAL] = "Bond Potential"; | 
| 89 |  |  | Stats::title_[BEND_POTENTIAL] = "Bend Potential"; | 
| 90 |  |  | Stats::title_[DIHEDRAL_POTENTIAL] = "Dihedral Potential"; | 
| 91 |  |  | Stats::title_[INVERSION_POTENTIAL] = "Inversion Potential"; | 
| 92 | gezelter | 1760 | Stats::title_[RAW_POTENTIAL] = "Raw Potential"; | 
| 93 |  |  | Stats::title_[RESTRAINT_POTENTIAL] = "Restraint Potential"; | 
| 94 | gezelter | 1710 | Stats::title_[SHADOWH] = "Shadow Hamiltonian"; | 
| 95 |  |  | Stats::title_[PRESSURE_TENSOR_XX] = "P_xx"; | 
| 96 |  |  | Stats::title_[PRESSURE_TENSOR_XY] = "P_xy"; | 
| 97 |  |  | Stats::title_[PRESSURE_TENSOR_XZ] = "P_xz"; | 
| 98 |  |  | Stats::title_[PRESSURE_TENSOR_YX] = "P_yx"; | 
| 99 |  |  | Stats::title_[PRESSURE_TENSOR_YY] = "P_yy"; | 
| 100 |  |  | Stats::title_[PRESSURE_TENSOR_YZ] = "P_yz"; | 
| 101 |  |  | Stats::title_[PRESSURE_TENSOR_ZX] = "P_zx"; | 
| 102 |  |  | Stats::title_[PRESSURE_TENSOR_ZY] = "P_zy"; | 
| 103 |  |  | Stats::title_[PRESSURE_TENSOR_ZZ] = "P_zz"; | 
| 104 |  |  | Stats::title_[BOX_DIPOLE_X] = "box dipole x"; | 
| 105 |  |  | Stats::title_[BOX_DIPOLE_Y] = "box dipole y"; | 
| 106 |  |  | Stats::title_[BOX_DIPOLE_Z] = "box dipole z"; | 
| 107 |  |  | Stats::title_[TAGGED_PAIR_DISTANCE] = "Tagged_Pair_Distance"; | 
| 108 |  |  | Stats::title_[RNEMD_EXCHANGE_TOTAL] = "RNEMD_exchange_total"; | 
| 109 | gezelter | 1723 | Stats::title_[THERMAL_HELFANDMOMENT_X] = "Thermal Helfand Moment x"; | 
| 110 |  |  | Stats::title_[THERMAL_HELFANDMOMENT_Y] = "Thermal Helfand Moment y"; | 
| 111 |  |  | Stats::title_[THERMAL_HELFANDMOMENT_Z] = "Thermal Helfand Moment z"; | 
| 112 |  |  | Stats::title_[HEATFLUX_X]= "Heat Flux x component"; | 
| 113 |  |  | Stats::title_[HEATFLUX_Y]= "Heat Flux y component"; | 
| 114 |  |  | Stats::title_[HEATFLUX_Z]= "Heat Flux z component"; | 
| 115 |  |  |  | 
| 116 | gezelter | 1710 | Stats::units_[TIME] = "fs"; | 
| 117 |  |  | Stats::units_[TOTAL_ENERGY] = "kcal/mol"; | 
| 118 |  |  | Stats::units_[POTENTIAL_ENERGY] = "kcal/mol"; | 
| 119 |  |  | Stats::units_[KINETIC_ENERGY] = "kcal/mol"; | 
| 120 |  |  | Stats::units_[TEMPERATURE] = "K"; | 
| 121 |  |  | Stats::units_[PRESSURE] = "atm"; | 
| 122 |  |  | Stats::units_[VOLUME] = "A^3"; | 
| 123 |  |  | Stats::units_[HULLVOLUME] = "A^3"; | 
| 124 |  |  | Stats::units_[GYRVOLUME] = "A^3"; | 
| 125 |  |  | Stats::units_[CONSERVED_QUANTITY] = "kcal/mol"; | 
| 126 |  |  | Stats::units_[TRANSLATIONAL_KINETIC] = "kcal/mol"; | 
| 127 |  |  | Stats::units_[ROTATIONAL_KINETIC] = "kcal/mol"; | 
| 128 |  |  | Stats::units_[LONG_RANGE_POTENTIAL] = "kcal/mol"; | 
| 129 |  |  | Stats::units_[VANDERWAALS_POTENTIAL] = "kcal/mol"; | 
| 130 |  |  | Stats::units_[ELECTROSTATIC_POTENTIAL] = "kcal/mol"; | 
| 131 | gezelter | 1760 | Stats::units_[METALLIC_POTENTIAL] = "kcal/mol"; | 
| 132 |  |  | Stats::units_[HYDROGENBONDING_POTENTIAL] = "kcal/mol"; | 
| 133 |  |  | Stats::units_[SHORT_RANGE_POTENTIAL] = "kcal/mol"; | 
| 134 | gezelter | 1710 | Stats::units_[BOND_POTENTIAL] = "kcal/mol"; | 
| 135 |  |  | Stats::units_[BEND_POTENTIAL] = "kcal/mol"; | 
| 136 |  |  | Stats::units_[DIHEDRAL_POTENTIAL] = "kcal/mol"; | 
| 137 |  |  | Stats::units_[INVERSION_POTENTIAL] = "kcal/mol"; | 
| 138 | gezelter | 1760 | Stats::units_[RAW_POTENTIAL] = "kcal/mol"; | 
| 139 |  |  | Stats::units_[RESTRAINT_POTENTIAL] = "kcal/mol"; | 
| 140 | gezelter | 1710 | Stats::units_[SHADOWH] = "kcal/mol"; | 
| 141 |  |  | Stats::units_[PRESSURE_TENSOR_XX] = "amu*fs^-2*Ang^-1"; | 
| 142 |  |  | Stats::units_[PRESSURE_TENSOR_XY] = "amu*fs^-2*Ang^-1"; | 
| 143 |  |  | Stats::units_[PRESSURE_TENSOR_XZ] = "amu*fs^-2*Ang^-1"; | 
| 144 |  |  | Stats::units_[PRESSURE_TENSOR_YX] = "amu*fs^-2*Ang^-1"; | 
| 145 |  |  | Stats::units_[PRESSURE_TENSOR_YY] = "amu*fs^-2*Ang^-1"; | 
| 146 |  |  | Stats::units_[PRESSURE_TENSOR_YZ] = "amu*fs^-2*Ang^-1"; | 
| 147 |  |  | Stats::units_[PRESSURE_TENSOR_ZX] = "amu*fs^-2*Ang^-1"; | 
| 148 |  |  | Stats::units_[PRESSURE_TENSOR_ZY] = "amu*fs^-2*Ang^-1"; | 
| 149 |  |  | Stats::units_[PRESSURE_TENSOR_ZZ] = "amu*fs^-2*Ang^-1"; | 
| 150 |  |  | Stats::units_[BOX_DIPOLE_X] = "C*m"; | 
| 151 |  |  | Stats::units_[BOX_DIPOLE_Y] = "C*m"; | 
| 152 |  |  | Stats::units_[BOX_DIPOLE_Z] = "C*m"; | 
| 153 |  |  | Stats::units_[TAGGED_PAIR_DISTANCE] = "Ang"; | 
| 154 |  |  | Stats::units_[RNEMD_EXCHANGE_TOTAL] = "Variable"; | 
| 155 | gezelter | 1723 | Stats::units_[THERMAL_HELFANDMOMENT_X] = "Ang*kcal/mol"; | 
| 156 |  |  | Stats::units_[THERMAL_HELFANDMOMENT_Y] = "Ang*kcal/mol"; | 
| 157 |  |  | Stats::units_[THERMAL_HELFANDMOMENT_Z] = "Ang*kcal/mol"; | 
| 158 |  |  | Stats::units_[HEATFLUX_X]="amu/fs^3"; | 
| 159 |  |  | Stats::units_[HEATFLUX_Y]="amu/fs^3"; | 
| 160 |  |  | Stats::units_[HEATFLUX_Z]="amu/fs^3"; | 
| 161 | gezelter | 1710 |  | 
| 162 |  |  | Stats::statsMap.insert(StatsMapType::value_type("TIME", TIME)); | 
| 163 |  |  | Stats::statsMap.insert(StatsMapType::value_type("TOTAL_ENERGY", TOTAL_ENERGY)); | 
| 164 |  |  | Stats::statsMap.insert(StatsMapType::value_type("POTENTIAL_ENERGY", POTENTIAL_ENERGY)); | 
| 165 |  |  | Stats::statsMap.insert(StatsMapType::value_type("KINETIC_ENERGY", KINETIC_ENERGY)); | 
| 166 |  |  | Stats::statsMap.insert(StatsMapType::value_type("TEMPERATURE", TEMPERATURE)); | 
| 167 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE", PRESSURE)); | 
| 168 |  |  | Stats::statsMap.insert(StatsMapType::value_type("VOLUME", VOLUME)); | 
| 169 |  |  | Stats::statsMap.insert(StatsMapType::value_type("HULLVOLUME", HULLVOLUME)); | 
| 170 |  |  | Stats::statsMap.insert(StatsMapType::value_type("GYRVOLUME", GYRVOLUME)); | 
| 171 |  |  | Stats::statsMap.insert(StatsMapType::value_type("CONSERVED_QUANTITY", CONSERVED_QUANTITY)); | 
| 172 |  |  | Stats::statsMap.insert(StatsMapType::value_type("TRANSLATIONAL_KINETIC", TRANSLATIONAL_KINETIC)); | 
| 173 |  |  | Stats::statsMap.insert(StatsMapType::value_type("ROTATIONAL_KINETIC", ROTATIONAL_KINETIC)); | 
| 174 |  |  | Stats::statsMap.insert(StatsMapType::value_type("LONG_RANGE_POTENTIAL", LONG_RANGE_POTENTIAL)); | 
| 175 |  |  | Stats::statsMap.insert(StatsMapType::value_type("VANDERWAALS_POTENTIAL", VANDERWAALS_POTENTIAL)); | 
| 176 |  |  | Stats::statsMap.insert(StatsMapType::value_type("ELECTROSTATIC_POTENTIAL", ELECTROSTATIC_POTENTIAL)); | 
| 177 | gezelter | 1760 | Stats::statsMap.insert(StatsMapType::value_type("METALLIC_POTENTIAL", METALLIC_POTENTIAL)); | 
| 178 |  |  | Stats::statsMap.insert(StatsMapType::value_type("HYDROGENBONDING_POTENTIAL", HYDROGENBONDING_POTENTIAL)); | 
| 179 |  |  | Stats::statsMap.insert(StatsMapType::value_type("SHORT_RANGE_POTENTIAL", SHORT_RANGE_POTENTIAL)); | 
| 180 | gezelter | 1710 | Stats::statsMap.insert(StatsMapType::value_type("BOND_POTENTIAL", BOND_POTENTIAL)); | 
| 181 |  |  | Stats::statsMap.insert(StatsMapType::value_type("BEND_POTENTIAL", BEND_POTENTIAL)); | 
| 182 |  |  | Stats::statsMap.insert(StatsMapType::value_type("DIHEDRAL_POTENTIAL", DIHEDRAL_POTENTIAL)); | 
| 183 |  |  | Stats::statsMap.insert(StatsMapType::value_type("INVERSION_POTENTIAL", INVERSION_POTENTIAL)); | 
| 184 | gezelter | 1760 | Stats::statsMap.insert(StatsMapType::value_type("RAW_POTENTIAL", RAW_POTENTIAL)); | 
| 185 |  |  | Stats::statsMap.insert(StatsMapType::value_type("RESTRAINT_POTENTIAL", RESTRAINT_POTENTIAL)); | 
| 186 | gezelter | 1710 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_XX", PRESSURE_TENSOR_XX)); | 
| 187 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_XY", PRESSURE_TENSOR_XY)); | 
| 188 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_XZ", PRESSURE_TENSOR_XZ)); | 
| 189 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_YX", PRESSURE_TENSOR_YX)); | 
| 190 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_YY", PRESSURE_TENSOR_YY)); | 
| 191 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_YZ", PRESSURE_TENSOR_YZ)); | 
| 192 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_ZX", PRESSURE_TENSOR_ZX)); | 
| 193 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_ZY", PRESSURE_TENSOR_ZY)); | 
| 194 |  |  | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_ZZ", PRESSURE_TENSOR_ZZ)); | 
| 195 |  |  | Stats::statsMap.insert(StatsMapType::value_type("BOX_DIPOLE_X", BOX_DIPOLE_X)); | 
| 196 |  |  | Stats::statsMap.insert(StatsMapType::value_type("BOX_DIPOLE_Y", BOX_DIPOLE_Y)); | 
| 197 |  |  | Stats::statsMap.insert(StatsMapType::value_type("BOX_DIPOLE_Z", BOX_DIPOLE_Z)); | 
| 198 |  |  | Stats::statsMap.insert(StatsMapType::value_type("TAGGED_PAIR_DISTANCE", TAGGED_PAIR_DISTANCE)); | 
| 199 |  |  | Stats::statsMap.insert(StatsMapType::value_type("RNEMD_EXCHANGE_TOTAL", RNEMD_EXCHANGE_TOTAL)); | 
| 200 | gezelter | 1723 | Stats::statsMap.insert(StatsMapType::value_type("SHADOWH", SHADOWH)); | 
| 201 |  |  | Stats::statsMap.insert(StatsMapType::value_type("THERMAL_HELFANDMOMENT_X",THERMAL_HELFANDMOMENT_X)); | 
| 202 |  |  | Stats::statsMap.insert(StatsMapType::value_type("THERMAL_HELFANDMOMENT_Y",THERMAL_HELFANDMOMENT_Y)); | 
| 203 |  |  | Stats::statsMap.insert(StatsMapType::value_type("THERMAL_HELFANDMOMENT_Z",THERMAL_HELFANDMOMENT_Z)); | 
| 204 |  |  | Stats::statsMap.insert(StatsMapType::value_type("HEATFLUX_X",HEATFLUX_X)); | 
| 205 |  |  | Stats::statsMap.insert(StatsMapType::value_type("HEATFLUX_Y",HEATFLUX_Y)); | 
| 206 |  |  | Stats::statsMap.insert(StatsMapType::value_type("HEATFLUX_Z",HEATFLUX_Z)); | 
| 207 | gezelter | 1710 | } | 
| 208 |  |  |  | 
| 209 |  |  | } |