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

Energy.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2002-2004, Bernd Speiser */
00006 /* This file is part of Quantities.
00007 
00008 PhysicalQuantities is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 PhysicalQuantities is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017   
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00021 02111-1307, USA.
00022 */
00023 
00024 #ifndef _Energy_h
00025 #define _Energy_h
00026 
00027 #include "Quantity/Variable.h"
00028 #include "Quantity/Constant.h"
00029 #include "Quantity/QuantityCluster.h"
00030 
00031 namespace Quantities {
00032 
00033 /* Energy dimension */
00034 typedef BSUtilities::Rational<2> Energy_LE;
00035 typedef BSUtilities::Rational<1> Energy_M;
00036 typedef BSUtilities::Rational<-2> Energy_TI;
00037 typedef BSUtilities::Rational<0> Energy_E;
00038 typedef BSUtilities::Rational<0> Energy_TE;
00039 typedef BSUtilities::Rational<0> Energy_A;
00040 typedef BSUtilities::Rational<0> Energy_LU;
00041 class EnergyGroup
00042   {
00043     public:
00044       typedef TYPELIST_7(Energy_LE, Energy_M, Energy_TI, Energy_E,
00045                                   Energy_TE, Energy_A, Energy_LU) DimTL;
00046   };
00047 
00048 
00049   namespace EnergyUnits {
00050 
00051 /* declaration of Energy unit base class */
00052 typedef Units::Unit<EnergyGroup> EnergyUnit;
00053 
00054 /* declaration of Energy units */
00055 class JouleUnits;
00056 class ErgUnit;
00057 class HartreeUnit;
00058 class RydbergUnit;
00059 class ElectronVoltUnit;
00060 class ThermochemicalCaloryUnit;
00061 class InternationalCaloryUnit;
00062 class FifteenDegreeCaloryUnit;
00063 class LitreAtmosphereUnit;
00064 class BritishThermalUnitUnit;
00065 
00066 /* the Joule and prefixed Joules */
00067 
00068 typedef Units::Prefixable<EnergyGroup, JouleUnits> Joules;
00069 
00070 typedef Units::Prefixed<Joules> Joule;
00071 typedef Units::Prefixed<Joules, Units::Kilo> KiloJoule;
00072 
00073 /* the erg */
00074 
00075 typedef Units::NonPrefixable<EnergyGroup, ErgUnit> Erg;
00076 
00077 /* the Hartree */
00078 
00079 typedef Units::NonPrefixable<EnergyGroup, HartreeUnit> Hartree;
00080 
00081 /* the Rydberg */
00082 
00083 typedef Units::NonPrefixable<EnergyGroup, RydbergUnit> Rydberg;
00084 
00085 /* the electron volt */
00086 
00087 typedef 
00088        Units::NonPrefixable<EnergyGroup, ElectronVoltUnit> ElectronVolt;
00089 
00090 /* the thermochemical calory */
00091 
00092 typedef Units::NonPrefixable<EnergyGroup, ThermochemicalCaloryUnit> 
00093                                                    ThermochemicalCalory;
00094 
00095 /* the international calory */
00096 
00097 typedef Units::NonPrefixable<EnergyGroup, InternationalCaloryUnit> 
00098                                                    InternationalCalory;
00099 
00100 /* the 15 degree calory */
00101 
00102 typedef Units::NonPrefixable<EnergyGroup, FifteenDegreeCaloryUnit> 
00103                                                    FifteenDegreeCalory;
00104 
00105 /* the litre atmosphere */
00106 
00107 typedef 
00108   Units::NonPrefixable<EnergyGroup, LitreAtmosphereUnit> 
00109                                                         LitreAtmosphere;
00110 
00111 /* the british thermal unit */
00112 
00113 typedef Units::NonPrefixable<EnergyGroup, BritishThermalUnitUnit> 
00114                                                      BritishThermalUnit;
00115 
00116 typedef Loki::TL::Append<Joules::Units,
00117   TYPELIST_9(Erg, Hartree, Rydberg, ElectronVolt, ThermochemicalCalory,
00118              InternationalCalory, FifteenDegreeCalory, LitreAtmosphere,
00119                                BritishThermalUnit)>::Result EnergyUnits;
00120 
00121 /* declare some abbreviated time units */
00122 
00123 typedef Joule J;
00124 
00125   }
00126 
00127 /* declaration of Energy dimension */
00128 
00129 typedef Dimensions::Dimension<EnergyGroup> EnergyDimension;
00130 
00131 /* Energy Quantity */
00132 
00133 typedef Quantity<EnergyGroup, EnergyUnits::EnergyUnits,
00134                                    EnergyUnits::Joule> EnergyQuantities;
00135 
00136 typedef Variable<EnergyQuantities> Energy;
00137 typedef Constant<EnergyQuantities> EnergyConstant;
00138 
00139 typedef VariableVector<EnergyQuantities> EnergyVector;
00140 
00141 }
00142 
00143 #endif /* _Energy_h */

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