00001 00005 /* Copyright (C) 2002 - 2009, Bernd Speiser */ 00006 00007 /* This file is part of PhysicalQuantities. 00008 00009 PhysicalQuantities is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either version 2 00012 of the License, or (at your option) any later version. 00013 00014 PhysicalQuantities is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00022 02111-1307, USA. 00023 */ 00024 00025 #ifndef _Mass_cc 00026 #define _Mass_cc 00027 00028 // Quantity includes 00029 #include "Quantities/PhysicalQuantities/Mass.h" 00030 00031 namespace quantity { 00032 namespace mass { 00033 00034 /* definition of Mass units */ 00035 /* the gram and prefixed grams; the SI unit is the kilogramn */ 00036 00037 template<> const std::string Grams::Basename = "gram"; 00038 template<> const std::string Grams::Basesymbol = "g"; 00039 template<> const bool Grams::SI = true; 00040 template<> const bool Grams::Exact = true; 00041 template<> const double Grams::StandardFactor = 0.001; 00042 00043 /* the electron mass */ 00044 00045 template<> const std::string ElectronMass::Namestring = "electron mass"; 00046 template<> const std::string ElectronMass::Symbolstring = "m_e"; 00047 template<> const bool ElectronMass::SI = false; 00048 template<> const bool ElectronMass::Exact = false; 00049 template<> const double ElectronMass::StandardFactor = 9.10939e-31; 00050 00051 /* the Dalton */ 00052 00053 template<> const std::string Dalton::Namestring = "dalton"; 00054 template<> const std::string Dalton::Symbolstring = "Da"; 00055 template<> const bool Dalton::SI = false; 00056 template<> const bool Dalton::Exact = false; 00057 template<> const double Dalton::StandardFactor = 1.660540e-27; 00058 00059 /* the u mass unit */ 00060 00061 template<> const std::string U::Namestring = "u"; 00062 template<> const std::string U::Symbolstring = "u"; 00063 template<> const bool U::SI = false; 00064 template<> const bool U::Exact = false; 00065 template<> const double U::StandardFactor = 1.660540e-27; 00066 00067 /* the gamma */ 00068 00069 template<> const std::string Gamma::Namestring = "gamma"; 00070 template<> const std::string Gamma::Symbolstring = "gamma"; 00071 template<> const bool Gamma::SI = false; 00072 template<> const bool Gamma::Exact = true; 00073 template<> const double Gamma::StandardFactor = 1.0e-9; 00074 00075 /* the tonne */ 00076 00077 template<> const std::string Tonnes::Basename = "Tonne"; 00078 template<> const std::string Tonnes::Basesymbol = "t"; 00079 template<> const bool Tonnes::SI = false; 00080 template<> const bool Tonnes::Exact = true; 00081 template<> const double Tonnes::StandardFactor = 1000.; 00082 00083 /* the pound */ 00084 00085 template<> const std::string Pound::Namestring = "pound"; 00086 template<> const std::string Pound::Symbolstring = "lb"; 00087 template<> const bool Pound::SI = false; 00088 template<> const bool Pound::Exact = true; 00089 template<> const double Pound::StandardFactor = 0.45359237; 00090 00091 /* the ounce */ 00092 00093 template<> const std::string Ounce::Namestring = "ounce"; 00094 template<> const std::string Ounce::Symbolstring = "oz"; 00095 template<> const bool Ounce::SI = false; 00096 template<> const bool Ounce::Exact = false; 00097 template<> const double Ounce::StandardFactor = 0.0283495; 00098 00099 /* the troy ounce */ 00100 00101 template<> const std::string TroyOunce::Namestring = "troy ounce"; 00102 template<> const std::string TroyOunce::Symbolstring = "oz (troy)"; 00103 template<> const bool TroyOunce::SI = false; 00104 template<> const bool TroyOunce::Exact = false; 00105 template<> const double TroyOunce::StandardFactor = 0.0311035; 00106 00107 /* the grain */ 00108 00109 template<> const std::string Grain::Namestring = "grain"; 00110 template<> const std::string Grain::Symbolstring = "gr"; 00111 template<> const bool Grain::SI = false; 00112 template<> const bool Grain::Exact = true; 00113 template<> const double Grain::StandardFactor = 6.479891e-5; 00114 00115 } 00116 00117 const std::string QuantityTraits<mass::Class>::NameString (void) 00118 {return "mass";} 00119 const std::string QuantityTraits<mass::Class>::SymbolString (void) {return "m";} 00120 00121 } 00122 00123 #endif /* _Mass_cc */