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 "Quantities/Quantity/UniqueConstant.h"
00033 #include "Quantities/PhysicalQuantities/AmountOfSubstance.h"
00034 #include "Quantities/PhysicalQuantities/Energy.h"
00035 #include "Quantities/PhysicalQuantities/ThermodynamicTemperature.h"
00036
00037 namespace quantity {
00038 namespace gasConstant {
00039
00041 class Class;
00042
00044 class Unit;
00045
00046
00047
00049 typedef unit::Component<energy::Units,
00050 BSUtilities::Rational<1> > EnergyComponent;
00051
00053 typedef unit::Component<amountOfSubstance::Units,
00054 BSUtilities::Rational<-1> > AmountOfSubstanceComponent;
00055
00057 typedef
00058 unit::Component<thermodynamicTemperature::Units,
00059 BSUtilities::Rational<-1> > ThermodynamicTemperatureComponent;
00060
00061 typedef unit::ComposeBase<Unit,
00062 Loki::Typelist<EnergyComponent, Loki::Typelist<AmountOfSubstanceComponent,
00063 Loki::Typelist<ThermodynamicTemperatureComponent, Loki::NullType> > > >
00064 GasConstantComposedUnit;
00065
00066 typedef unit::Composed<GasConstantComposedUnit,
00067 Loki::Typelist<energy::Joule, Loki::Typelist<amountOfSubstance::Mole,
00068 Loki::Typelist<thermodynamicTemperature::Kelvin, Loki::NullType> > > >
00069 JoulePerKelvinMole;
00070
00072 typedef Loki::Typelist<GasConstantComposedUnit, Loki::NullType> Units;
00073
00074
00075
00076 typedef Quantity<Class> Quantity;
00077
00078 class DerivedGasConstant;
00079
00080 }
00081
00083 template<>
00084 struct QuantityTraits<gasConstant::Class>
00085 {
00086 typedef
00087 dimension::Dimension<BSUtilities::Rational<2>,
00088 BSUtilities::Rational<1>, BSUtilities::Rational<-2>,
00089 BSUtilities::Rational<0>, BSUtilities::Rational<-1>,
00090 BSUtilities::Rational<-1>, BSUtilities::Rational<0> > Dimension;
00091 typedef gasConstant::Unit UnitType;
00092 typedef gasConstant::Units UnitList;
00093 typedef gasConstant::JoulePerKelvinMole DefaultUnit;
00094
00095 typedef gasConstant::DerivedGasConstant DefaultDerivedQuantityType;
00096
00097 static const std::string NameString ();
00098 static const std::string SymbolString ();
00099
00100 };
00101
00102
00103 template<>
00104 struct DerivedQuantityTraits<gasConstant::Class, gasConstant::DerivedGasConstant>
00105 {
00106 static const bool OverwriteName = false;
00107 static const bool OverwriteSymbol = false;
00108
00109 static const std::string NameString ();
00110 static const std::string SymbolString ();
00111
00112 };
00113
00114
00116 typedef Loki::SingletonHolder<UniqueConstant <gasConstant::Quantity> > GasConstant;
00117
00119 #define GASCONSTANT GasConstant::Instance()
00120
00121 }
00122
00123 #endif