| 1 | tim | 1710 | /* | 
| 2 |  |  | * Copyright (C) 2000-2004  Object Oriented Parallel Simulation Engine (OOPSE) project | 
| 3 |  |  | * | 
| 4 |  |  | * Contact: oopse@oopse.org | 
| 5 |  |  | * | 
| 6 |  |  | * This program is free software; you can redistribute it and/or | 
| 7 |  |  | * modify it under the terms of the GNU Lesser General Public License | 
| 8 |  |  | * as published by the Free Software Foundation; either version 2.1 | 
| 9 |  |  | * of the License, or (at your option) any later version. | 
| 10 |  |  | * All we ask is that proper credit is given for our work, which includes | 
| 11 |  |  | * - but is not limited to - adding the above copyright notice to the beginning | 
| 12 |  |  | * of your source code files, and to any copyright notice that you may distribute | 
| 13 |  |  | * with programs based on this work. | 
| 14 |  |  | * | 
| 15 |  |  | * This program is distributed in the hope that it will be useful, | 
| 16 |  |  | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 17 |  |  | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| 18 |  |  | * GNU Lesser General Public License for more details. | 
| 19 |  |  | * | 
| 20 |  |  | * You should have received a copy of the GNU Lesser General Public License | 
| 21 |  |  | * along with this program; if not, write to the Free Software | 
| 22 |  |  | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. | 
| 23 |  |  | * | 
| 24 |  |  | */ | 
| 25 |  |  |  | 
| 26 |  |  | /** | 
| 27 |  |  | * @file Stats.cpp | 
| 28 |  |  | * @author tlin | 
| 29 |  |  | * @date 11/04/2004 | 
| 30 |  |  | * @time 14:26am | 
| 31 |  |  | * @version 1.0 | 
| 32 |  |  | */ | 
| 33 |  |  |  | 
| 34 |  |  | #include "brains/Stats.hpp" | 
| 35 |  |  |  | 
| 36 |  |  | namespace oopse { | 
| 37 |  |  |  | 
| 38 | tim | 1804 | bool Stats::isInit_ = false; | 
| 39 | tim | 1833 | std::string Stats::title_[Stats::ENDINDEX - Stats::BEGININDEX]; | 
| 40 |  |  | std::string Stats::units_[Stats::ENDINDEX - Stats::BEGININDEX]; | 
| 41 | tim | 1710 |  | 
| 42 | tim | 1804 | Stats::Stats() { | 
| 43 |  |  |  | 
| 44 |  |  | if (!isInit_) { | 
| 45 |  |  | init(); | 
| 46 | tim | 1832 | isInit_ = true; | 
| 47 | tim | 1804 | } | 
| 48 |  |  |  | 
| 49 | tim | 1710 | } | 
| 50 | tim | 1804 |  | 
| 51 |  |  | void Stats::init() { | 
| 52 |  |  |  | 
| 53 | tim | 1832 | Stats::title_[TIME] = "Time"; | 
| 54 |  |  | Stats::title_[TOTAL_ENERGY] = "Total Energy"; | 
| 55 |  |  | Stats::title_[POTENTIAL_ENERGY] = "Potential Energy"; | 
| 56 |  |  | Stats::title_[KINETIC_ENERGY] = "Kinetic Energy"; | 
| 57 |  |  | Stats::title_[TEMPERATURE] = "Temperature"; | 
| 58 |  |  | Stats::title_[PRESSURE] = "Pressure"; | 
| 59 |  |  | Stats::title_[VOLUME] = "Volume"; | 
| 60 |  |  | Stats::title_[CONSERVED_QUANTITY] = "Conserved Quantity"; | 
| 61 |  |  | Stats::title_[TRANSLATIONAL_KINETIC] = "Translational Kinetic"; | 
| 62 |  |  | Stats::title_[ROTATIONAL_KINETIC] = "Rotational Kinetic"; | 
| 63 |  |  | Stats::title_[LONG_RANGE_POTENTIAL] = "Long Range Potential"; | 
| 64 |  |  | Stats::title_[SHORT_RANGE_POTENTIAL] = "Short Range Potential"; | 
| 65 |  |  | Stats::title_[VANDERWAALS_POTENTIAL] = "van der waals Potential"; | 
| 66 |  |  | Stats::title_[BOND_POTENTIAL] = "Bond Potential"; | 
| 67 |  |  | Stats::title_[BEND_POTENTIAL] = "Bend Potential"; | 
| 68 |  |  | Stats::title_[DIHEDRAL_POTENTIAL] = "Dihedral Potential"; | 
| 69 |  |  | Stats::title_[IMPROPER_POTENTIAL] = "Improper Potential"; | 
| 70 |  |  | Stats::title_[VRAW] = "Raw Potential"; | 
| 71 |  |  | Stats::title_[VHARM] = "Harmonic Potential"; | 
| 72 | tim | 1804 |  | 
| 73 | tim | 1832 | Stats::units_[TIME] = "fs"; | 
| 74 |  |  | Stats::units_[TOTAL_ENERGY] = "kcal/mol"; | 
| 75 |  |  | Stats::units_[POTENTIAL_ENERGY] = "kcal/mol"; | 
| 76 |  |  | Stats::units_[KINETIC_ENERGY] = "kcal/mol"; | 
| 77 |  |  | Stats::units_[TEMPERATURE] = "K"; | 
| 78 |  |  | Stats::units_[PRESSURE] = "atm"; | 
| 79 |  |  | Stats::units_[VOLUME] = "A^3"; | 
| 80 |  |  | Stats::units_[CONSERVED_QUANTITY] = "kcal/mol"; | 
| 81 |  |  | Stats::units_[TRANSLATIONAL_KINETIC] = "kcal/mol"; | 
| 82 |  |  | Stats::units_[ROTATIONAL_KINETIC] = "kcal/mol"; | 
| 83 |  |  | Stats::units_[LONG_RANGE_POTENTIAL] = "kcal/mol"; | 
| 84 |  |  | Stats::units_[SHORT_RANGE_POTENTIAL] = "kcal/mol"; | 
| 85 |  |  | Stats::units_[VANDERWAALS_POTENTIAL] = "kcal/mol"; | 
| 86 |  |  | Stats::units_[BOND_POTENTIAL] = "kcal/mol"; | 
| 87 |  |  | Stats::units_[BEND_POTENTIAL] = "kcal/mol"; | 
| 88 |  |  | Stats::units_[DIHEDRAL_POTENTIAL] = "kcal/mol"; | 
| 89 |  |  | Stats::units_[IMPROPER_POTENTIAL] = "kcal/mol"; | 
| 90 |  |  | Stats::units_[VRAW] = "kcal/mol"; | 
| 91 |  |  | Stats::units_[VHARM] = "kcal/mol"; | 
| 92 | tim | 1804 | } | 
| 93 |  |  |  | 
| 94 |  |  | } |