Main Page | Class Hierarchy | Class List | File List

GasConstant.h

Go to the documentation of this file.
00001 
00008 /* Copyright (C) 2002 - 2006, Bernd Speiser */
00009 
00010 /* This file is part of Quantities.
00011 
00012 PhysicalQuantities is free software; you can redistribute it and/or
00013 modify it under the terms of the GNU General Public License
00014 as published by the Free Software Foundation; either version 2
00015 of the License, or (at your option) any later version.
00016 
00017 PhysicalQuantities is distributed in the hope that it will be useful,
00018 but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 GNU General Public License for more details.
00021   
00022 You should have received a copy of the GNU General Public License
00023 along with this program; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00025 02111-1307, USA.
00026 */
00027 
00028 #ifndef _GasConstant_h
00029 #define _GasConstant_h
00030 
00031 #include "Quantity/UniqueConstant.h"
00032 
00033 #include "PhysicalQuantities/AmountOfSubstance.h"
00034 #include "PhysicalQuantities/Energy.h"
00035 #include "PhysicalQuantities/ThermodynamicTemperature.h"
00036 
00037 namespace quantity {
00038   namespace gasConstant {
00039 
00040 /* GasConstant dimension */
00041 typedef BSUtilities::Rational<2> LE;
00042 typedef BSUtilities::Rational<1> M;
00043 typedef BSUtilities::Rational<-2> TI;
00044 typedef BSUtilities::Rational<0> E;
00045 typedef BSUtilities::Rational<-1> TE;
00046 typedef BSUtilities::Rational<-1> A;
00047 typedef BSUtilities::Rational<0> LU;
00048 
00049 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00050 
00052 class Unit;
00053 
00054 /* declaration of GasConstant unit base class */
00055 class JoulePerKelvinMoleUnit;
00056 
00057 /* the JoulePerKelvinMoleUnit and prefixed variants */
00058 
00059 typedef LOKI_TYPELIST_1(energy::Joule) EnergyList;
00060 
00061 typedef unit::ComposeElement<Unit, EnergyList,
00062                                BSUtilities::Rational<1> > EnergyElement;
00063 
00064 typedef LOKI_TYPELIST_2(amountOfSubstance::Mole,
00065                     amountOfSubstance::MilliMole) AmountOfSubstanceList;
00066 
00067 typedef unit::ComposeElement<Unit, AmountOfSubstanceList,
00068                    BSUtilities::Rational<-1> > AmountOfSubstanceElement;
00069 
00070 typedef LOKI_TYPELIST_1(thermodynamicTemperature::Kelvin) 
00071                                            ThermodynamicTemperatureList;
00072 
00073 typedef 
00074   unit::ComposeElement<Unit, ThermodynamicTemperatureList,
00075             BSUtilities::Rational<-1> > ThermodynamicTemperatureElement;
00076 
00077 typedef unit::ComposeBase<Unit, 
00078   LOKI_TYPELIST_3(EnergyElement, AmountOfSubstanceElement, 
00079               ThermodynamicTemperatureElement)> GasConstantComposedUnit;
00080 
00081 typedef unit::Composed<GasConstantComposedUnit, 
00082   LOKI_TYPELIST_3(energy::Joule, amountOfSubstance::Mole, 
00083                   thermodynamicTemperature::Kelvin)> JoulePerKelvinMole;
00084 
00086 typedef LOKI_TYPELIST_1(JoulePerKelvinMole) Units;
00087 /* GasConstant quantity */
00088 
00089 typedef Quantity<Dimension, Unit, Units, JoulePerKelvinMole> Quantity;
00090 
00091   }
00092 
00093 typedef Loki::SingletonHolder<UniqueConstant <gasConstant::Quantity> > 
00094                                                             GasConstant;
00095 
00096 #define GASCONSTANT GasConstant::Instance()
00097 
00098 }
00099 
00100 #endif /* _GasConstant_h */

Generated on Mon Feb 12 18:48:49 2007 for PhysicalQuantities by doxygen 1.3.6