00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _GasConstant_h
00029 #define _GasConstant_h
00030
00031
00032 #include "Quantity/UniqueConstant.h"
00033 #include "PhysicalQuantities/AmountOfSubstance.h"
00034 #include "PhysicalQuantities/Energy.h"
00035 #include "PhysicalQuantities/ThermodynamicTemperature.h"
00036
00037 namespace quantity {
00038 namespace gasConstant {
00039
00041 class Class;
00042
00044 class Unit;
00045
00046
00047
00048 typedef LOKI_TYPELIST_1(energy::Joule) EnergyList;
00049
00051 typedef unit::ComposeElement<Unit, EnergyList,
00052 BSUtilities::Rational<1> > EnergyElement;
00053
00054 typedef LOKI_TYPELIST_2(amountOfSubstance::Mole,
00055 amountOfSubstance::MilliMole) AmountOfSubstanceList;
00056
00058 typedef unit::ComposeElement<Unit, AmountOfSubstanceList,
00059 BSUtilities::Rational<-1> > AmountOfSubstanceElement;
00060
00061 typedef LOKI_TYPELIST_1(thermodynamicTemperature::Kelvin)
00062 ThermodynamicTemperatureList;
00063
00065 typedef
00066 unit::ComposeElement<Unit, ThermodynamicTemperatureList,
00067 BSUtilities::Rational<-1> > ThermodynamicTemperatureElement;
00068
00069 typedef unit::ComposeBase<Unit,
00070 LOKI_TYPELIST_3(EnergyElement, AmountOfSubstanceElement,
00071 ThermodynamicTemperatureElement)> GasConstantComposedUnit;
00072
00073 typedef unit::Composed<GasConstantComposedUnit,
00074 LOKI_TYPELIST_3(energy::Joule, amountOfSubstance::Mole,
00075 thermodynamicTemperature::Kelvin)> JoulePerKelvinMole;
00076
00078 typedef LOKI_TYPELIST_1(JoulePerKelvinMole) Units;
00079
00080
00081
00082 typedef Quantity<Class> Quantity;
00083
00084 class DerivedGasConstant;
00085
00086 }
00087
00089
00091 template<typename ST>
00092 struct Standard<gasConstant::GasConstantComposedUnit, ST>
00093 {
00094 static const ST ratio;
00095 static const bool exact;
00096 };
00097
00099 template<typename ST> const ST Standard<gasConstant::GasConstantComposedUnit, ST>::ratio
00100 = 1.0;
00101
00103 template<typename ST> const bool Standard<gasConstant::GasConstantComposedUnit, ST>::exact
00104 = true;
00105
00107 template<>
00108 struct QuantityTraits<gasConstant::Class>
00109 {
00110 typedef
00111 dimension::Dimension<BSUtilities::Rational<2>,
00112 BSUtilities::Rational<1>, BSUtilities::Rational<-2>,
00113 BSUtilities::Rational<0>, BSUtilities::Rational<-1>,
00114 BSUtilities::Rational<-1>, BSUtilities::Rational<0> > Dimension;
00115 typedef gasConstant::Unit UnitType;
00116 typedef gasConstant::Units UnitList;
00117 typedef gasConstant::JoulePerKelvinMole DefaultUnit;
00118
00119 typedef gasConstant::DerivedGasConstant DefaultDerivedQuantityType;
00120
00121 static const std::string NameString;
00122 static const std::string SymbolString;
00123
00124 };
00125
00126
00127 template<>
00128 struct DerivedQuantityTraits<gasConstant::Class, gasConstant::DerivedGasConstant>
00129 {
00130 static const bool OverwriteName = false;
00131 static const bool OverwriteSymbol = false;
00132
00133 static const std::string NameString;
00134 static const std::string SymbolString;
00135
00136 };
00137
00138
00140 typedef Loki::SingletonHolder<UniqueConstant <gasConstant::Quantity> > GasConstant;
00141
00143 #define GASCONSTANT GasConstant::Instance()
00144
00145 }
00146
00147 #endif