Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

GasConstant.h

Go to the documentation of this file.
00001 
00008 /* Copyright (C) 2002-2004, 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 Quantities {
00038 
00039 /* GasConstant dimension */
00040 typedef BSUtilities::Rational<2> GasConstant_LE;
00041 typedef BSUtilities::Rational<1> GasConstant_M;
00042 typedef BSUtilities::Rational<-2> GasConstant_TI;
00043 typedef BSUtilities::Rational<0> GasConstant_E;
00044 typedef BSUtilities::Rational<-1> GasConstant_TE;
00045 typedef BSUtilities::Rational<-1> GasConstant_A;
00046 typedef BSUtilities::Rational<0> GasConstant_LU;
00047 class GasConstantGroup
00048   {
00049     public:
00050       typedef TYPELIST_7(GasConstant_LE, GasConstant_M,
00051                          GasConstant_TI, GasConstant_E,
00052                          GasConstant_TE, GasConstant_A,
00053                                                   GasConstant_LU) DimTL;
00054   };
00055 
00057   namespace GasConstantUnits {
00058 
00059 /* declaration of GasConstant unit base class */
00060 typedef Units::Unit<GasConstantGroup> GasConstantUnit;
00061 
00062 /* declaration of GasConstant unit base class */
00063 class JoulePerKelvinMoleUnit;
00064 
00065 /* the JoulePerKelvinMoleUnit and prefixed variants */
00066 
00067 typedef TYPELIST_1(EnergyUnits::Joule) EnergyList;
00068 
00069 typedef Units::CompoundElement<GasConstantGroup, EnergyList,
00070                                BSUtilities::Rational<1> > EnergyElement;
00071 
00072 typedef TYPELIST_2(AmountOfSubstanceUnits::Mole,
00073                AmountOfSubstanceUnits::MilliMole) AmountOfSubstanceList;
00074 
00075 typedef Units::CompoundElement<GasConstantGroup, AmountOfSubstanceList,
00076                    BSUtilities::Rational<-1> > AmountOfSubstanceElement;
00077 
00078 typedef 
00079   TYPELIST_1(ThermodynamicTemperatureUnits::Kelvin) 
00080                                            ThermodynamicTemperatureList;
00081 
00082 typedef 
00083   Units::CompoundElement<GasConstantGroup, ThermodynamicTemperatureList,
00084             BSUtilities::Rational<-1> > ThermodynamicTemperatureElement;
00085 
00086 typedef 
00087   TYPELIST_3(EnergyElement, AmountOfSubstanceElement, 
00088                ThermodynamicTemperatureElement) GasConstantCompoundList;
00089 
00090 typedef Units::Compound<GasConstantGroup, GasConstantCompoundList>
00091                                               GasConstantCompoundUnits;
00092 
00093 typedef Units::Composed<GasConstantCompoundUnits, 
00094   TYPELIST_3(EnergyUnits::Joule, AmountOfSubstanceUnits::Mole, 
00095              ThermodynamicTemperatureUnits::Kelvin)> JoulePerKelvinMole;
00096 
00098 typedef TYPELIST_1(JoulePerKelvinMole) GasConstantUnits;
00099   }
00100 
00101 /* declaration of GasConstant dimension */
00102 
00103 typedef Dimensions::Dimension<GasConstantGroup> GasConstantDimension;
00104 
00105 /* GasConstant quantity */
00106 
00107 typedef Quantity<GasConstantGroup,
00108   GasConstantUnits::GasConstantUnits,
00109             GasConstantUnits::JoulePerKelvinMole> GasConstantQuantities;
00110 
00111 typedef Loki::SingletonHolder<UniqueConstant
00112                                   <GasConstantQuantities> > GasConstant;
00113 
00114 #define GASCONSTANT GasConstant::Instance()
00115 
00116 }
00117 
00118 #endif /* _GasConstant_h */

Generated on Sun Jan 15 13:58:03 2006 for PhysicalQuantities by doxygen 1.3.6