| 1 | /* | 
| 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 | Stats::title_[SHORT_RANGE_POTENTIAL] = "Short Range Potential"; | 
| 84 | Stats::title_[VANDERWAALS_POTENTIAL] = "van der waals Potential"; | 
| 85 | Stats::title_[ELECTROSTATIC_POTENTIAL] = "Electrostatic Potential"; | 
| 86 | Stats::title_[BOND_POTENTIAL] = "Bond Potential"; | 
| 87 | Stats::title_[BEND_POTENTIAL] = "Bend Potential"; | 
| 88 | Stats::title_[DIHEDRAL_POTENTIAL] = "Dihedral Potential"; | 
| 89 | Stats::title_[INVERSION_POTENTIAL] = "Inversion Potential"; | 
| 90 | Stats::title_[VRAW] = "Raw Potential"; | 
| 91 | Stats::title_[VHARM] = "Harmonic Potential"; | 
| 92 | Stats::title_[SHADOWH] = "Shadow Hamiltonian"; | 
| 93 | Stats::title_[PRESSURE_TENSOR_XX] = "P_xx"; | 
| 94 | Stats::title_[PRESSURE_TENSOR_XY] = "P_xy"; | 
| 95 | Stats::title_[PRESSURE_TENSOR_XZ] = "P_xz"; | 
| 96 | Stats::title_[PRESSURE_TENSOR_YX] = "P_yx"; | 
| 97 | Stats::title_[PRESSURE_TENSOR_YY] = "P_yy"; | 
| 98 | Stats::title_[PRESSURE_TENSOR_YZ] = "P_yz"; | 
| 99 | Stats::title_[PRESSURE_TENSOR_ZX] = "P_zx"; | 
| 100 | Stats::title_[PRESSURE_TENSOR_ZY] = "P_zy"; | 
| 101 | Stats::title_[PRESSURE_TENSOR_ZZ] = "P_zz"; | 
| 102 | Stats::title_[BOX_DIPOLE_X] = "box dipole x"; | 
| 103 | Stats::title_[BOX_DIPOLE_Y] = "box dipole y"; | 
| 104 | Stats::title_[BOX_DIPOLE_Z] = "box dipole z"; | 
| 105 | Stats::title_[TAGGED_PAIR_DISTANCE] = "Tagged_Pair_Distance"; | 
| 106 | Stats::title_[RNEMD_EXCHANGE_TOTAL] = "RNEMD_exchange_total"; | 
| 107 | Stats::title_[THERMAL_HELFANDMOMENT_X] = "Thermal Helfand Moment x"; | 
| 108 | Stats::title_[THERMAL_HELFANDMOMENT_Y] = "Thermal Helfand Moment y"; | 
| 109 | Stats::title_[THERMAL_HELFANDMOMENT_Z] = "Thermal Helfand Moment z"; | 
| 110 | Stats::title_[HEATFLUX_X]= "Heat Flux x component"; | 
| 111 | Stats::title_[HEATFLUX_Y]= "Heat Flux y component"; | 
| 112 | Stats::title_[HEATFLUX_Z]= "Heat Flux z component"; | 
| 113 |  | 
| 114 | Stats::units_[TIME] = "fs"; | 
| 115 | Stats::units_[TOTAL_ENERGY] = "kcal/mol"; | 
| 116 | Stats::units_[POTENTIAL_ENERGY] = "kcal/mol"; | 
| 117 | Stats::units_[KINETIC_ENERGY] = "kcal/mol"; | 
| 118 | Stats::units_[TEMPERATURE] = "K"; | 
| 119 | Stats::units_[PRESSURE] = "atm"; | 
| 120 | Stats::units_[VOLUME] = "A^3"; | 
| 121 | Stats::units_[HULLVOLUME] = "A^3"; | 
| 122 | Stats::units_[GYRVOLUME] = "A^3"; | 
| 123 | Stats::units_[CONSERVED_QUANTITY] = "kcal/mol"; | 
| 124 | Stats::units_[TRANSLATIONAL_KINETIC] = "kcal/mol"; | 
| 125 | Stats::units_[ROTATIONAL_KINETIC] = "kcal/mol"; | 
| 126 | Stats::units_[LONG_RANGE_POTENTIAL] = "kcal/mol"; | 
| 127 | Stats::units_[SHORT_RANGE_POTENTIAL] = "kcal/mol"; | 
| 128 | Stats::units_[VANDERWAALS_POTENTIAL] = "kcal/mol"; | 
| 129 | Stats::units_[ELECTROSTATIC_POTENTIAL] = "kcal/mol"; | 
| 130 | Stats::units_[BOND_POTENTIAL] = "kcal/mol"; | 
| 131 | Stats::units_[BEND_POTENTIAL] = "kcal/mol"; | 
| 132 | Stats::units_[DIHEDRAL_POTENTIAL] = "kcal/mol"; | 
| 133 | Stats::units_[INVERSION_POTENTIAL] = "kcal/mol"; | 
| 134 | Stats::units_[VRAW] = "kcal/mol"; | 
| 135 | Stats::units_[VHARM] = "kcal/mol"; | 
| 136 | Stats::units_[SHADOWH] = "kcal/mol"; | 
| 137 | Stats::units_[PRESSURE_TENSOR_XX] = "amu*fs^-2*Ang^-1"; | 
| 138 | Stats::units_[PRESSURE_TENSOR_XY] = "amu*fs^-2*Ang^-1"; | 
| 139 | Stats::units_[PRESSURE_TENSOR_XZ] = "amu*fs^-2*Ang^-1"; | 
| 140 | Stats::units_[PRESSURE_TENSOR_YX] = "amu*fs^-2*Ang^-1"; | 
| 141 | Stats::units_[PRESSURE_TENSOR_YY] = "amu*fs^-2*Ang^-1"; | 
| 142 | Stats::units_[PRESSURE_TENSOR_YZ] = "amu*fs^-2*Ang^-1"; | 
| 143 | Stats::units_[PRESSURE_TENSOR_ZX] = "amu*fs^-2*Ang^-1"; | 
| 144 | Stats::units_[PRESSURE_TENSOR_ZY] = "amu*fs^-2*Ang^-1"; | 
| 145 | Stats::units_[PRESSURE_TENSOR_ZZ] = "amu*fs^-2*Ang^-1"; | 
| 146 | Stats::units_[BOX_DIPOLE_X] = "C*m"; | 
| 147 | Stats::units_[BOX_DIPOLE_Y] = "C*m"; | 
| 148 | Stats::units_[BOX_DIPOLE_Z] = "C*m"; | 
| 149 | Stats::units_[TAGGED_PAIR_DISTANCE] = "Ang"; | 
| 150 | Stats::units_[RNEMD_EXCHANGE_TOTAL] = "Variable"; | 
| 151 | Stats::units_[THERMAL_HELFANDMOMENT_X] = "Ang*kcal/mol"; | 
| 152 | Stats::units_[THERMAL_HELFANDMOMENT_Y] = "Ang*kcal/mol"; | 
| 153 | Stats::units_[THERMAL_HELFANDMOMENT_Z] = "Ang*kcal/mol"; | 
| 154 | Stats::units_[HEATFLUX_X]="amu/fs^3"; | 
| 155 | Stats::units_[HEATFLUX_Y]="amu/fs^3"; | 
| 156 | Stats::units_[HEATFLUX_Z]="amu/fs^3"; | 
| 157 |  | 
| 158 | Stats::statsMap.insert(StatsMapType::value_type("TIME", TIME)); | 
| 159 | Stats::statsMap.insert(StatsMapType::value_type("TOTAL_ENERGY", TOTAL_ENERGY)); | 
| 160 | Stats::statsMap.insert(StatsMapType::value_type("POTENTIAL_ENERGY", POTENTIAL_ENERGY)); | 
| 161 | Stats::statsMap.insert(StatsMapType::value_type("KINETIC_ENERGY", KINETIC_ENERGY)); | 
| 162 | Stats::statsMap.insert(StatsMapType::value_type("TEMPERATURE", TEMPERATURE)); | 
| 163 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE", PRESSURE)); | 
| 164 | Stats::statsMap.insert(StatsMapType::value_type("VOLUME", VOLUME)); | 
| 165 | Stats::statsMap.insert(StatsMapType::value_type("HULLVOLUME", HULLVOLUME)); | 
| 166 | Stats::statsMap.insert(StatsMapType::value_type("GYRVOLUME", GYRVOLUME)); | 
| 167 | Stats::statsMap.insert(StatsMapType::value_type("CONSERVED_QUANTITY", CONSERVED_QUANTITY)); | 
| 168 | Stats::statsMap.insert(StatsMapType::value_type("TRANSLATIONAL_KINETIC", TRANSLATIONAL_KINETIC)); | 
| 169 | Stats::statsMap.insert(StatsMapType::value_type("ROTATIONAL_KINETIC", ROTATIONAL_KINETIC)); | 
| 170 | Stats::statsMap.insert(StatsMapType::value_type("LONG_RANGE_POTENTIAL", LONG_RANGE_POTENTIAL)); | 
| 171 | Stats::statsMap.insert(StatsMapType::value_type("SHORT_RANGE_POTENTIAL", SHORT_RANGE_POTENTIAL)); | 
| 172 | Stats::statsMap.insert(StatsMapType::value_type("VANDERWAALS_POTENTIAL", VANDERWAALS_POTENTIAL)); | 
| 173 | Stats::statsMap.insert(StatsMapType::value_type("ELECTROSTATIC_POTENTIAL", ELECTROSTATIC_POTENTIAL)); | 
| 174 | Stats::statsMap.insert(StatsMapType::value_type("BOND_POTENTIAL", BOND_POTENTIAL)); | 
| 175 | Stats::statsMap.insert(StatsMapType::value_type("BEND_POTENTIAL", BEND_POTENTIAL)); | 
| 176 | Stats::statsMap.insert(StatsMapType::value_type("DIHEDRAL_POTENTIAL", DIHEDRAL_POTENTIAL)); | 
| 177 | Stats::statsMap.insert(StatsMapType::value_type("INVERSION_POTENTIAL", INVERSION_POTENTIAL)); | 
| 178 | Stats::statsMap.insert(StatsMapType::value_type("VRAW", VRAW)); | 
| 179 | Stats::statsMap.insert(StatsMapType::value_type("VHARM", VHARM)); | 
| 180 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_XX", PRESSURE_TENSOR_XX)); | 
| 181 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_XY", PRESSURE_TENSOR_XY)); | 
| 182 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_XZ", PRESSURE_TENSOR_XZ)); | 
| 183 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_YX", PRESSURE_TENSOR_YX)); | 
| 184 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_YY", PRESSURE_TENSOR_YY)); | 
| 185 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_YZ", PRESSURE_TENSOR_YZ)); | 
| 186 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_ZX", PRESSURE_TENSOR_ZX)); | 
| 187 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_ZY", PRESSURE_TENSOR_ZY)); | 
| 188 | Stats::statsMap.insert(StatsMapType::value_type("PRESSURE_TENSOR_ZZ", PRESSURE_TENSOR_ZZ)); | 
| 189 | Stats::statsMap.insert(StatsMapType::value_type("BOX_DIPOLE_X", BOX_DIPOLE_X)); | 
| 190 | Stats::statsMap.insert(StatsMapType::value_type("BOX_DIPOLE_Y", BOX_DIPOLE_Y)); | 
| 191 | Stats::statsMap.insert(StatsMapType::value_type("BOX_DIPOLE_Z", BOX_DIPOLE_Z)); | 
| 192 | Stats::statsMap.insert(StatsMapType::value_type("TAGGED_PAIR_DISTANCE", TAGGED_PAIR_DISTANCE)); | 
| 193 | Stats::statsMap.insert(StatsMapType::value_type("RNEMD_EXCHANGE_TOTAL", RNEMD_EXCHANGE_TOTAL)); | 
| 194 | Stats::statsMap.insert(StatsMapType::value_type("SHADOWH", SHADOWH)); | 
| 195 | Stats::statsMap.insert(StatsMapType::value_type("THERMAL_HELFANDMOMENT_X",THERMAL_HELFANDMOMENT_X)); | 
| 196 | Stats::statsMap.insert(StatsMapType::value_type("THERMAL_HELFANDMOMENT_Y",THERMAL_HELFANDMOMENT_Y)); | 
| 197 | Stats::statsMap.insert(StatsMapType::value_type("THERMAL_HELFANDMOMENT_Z",THERMAL_HELFANDMOMENT_Z)); | 
| 198 | Stats::statsMap.insert(StatsMapType::value_type("HEATFLUX_X",HEATFLUX_X)); | 
| 199 | Stats::statsMap.insert(StatsMapType::value_type("HEATFLUX_Y",HEATFLUX_Y)); | 
| 200 | Stats::statsMap.insert(StatsMapType::value_type("HEATFLUX_Z",HEATFLUX_Z)); | 
| 201 | } | 
| 202 |  | 
| 203 | } |