ThermodynamicTemperature.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002 - 2009, Bernd Speiser */
00008 
00009 /* This file is part of Quantities.
00010 
00011 PhysicalQuantities is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 PhysicalQuantities is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020   
00021 You should have received a copy of the GNU General Public License
00022 along with this program; if not, write to the Free Software
00023 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024 02111-1307, USA.
00025 */
00026 
00027 #ifndef thermodynamicTemperature_h
00028 #define thermodynamicTemperature_h
00029 
00030 // Quantity includes
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "Quantity/QuantityCluster.h"
00034 
00035 namespace quantity {
00036     namespace thermodynamicTemperature {
00037 
00039 class Class;
00040 
00042 class Unit;
00043 
00044 /* declaration of ThermodynamicTemperature units */
00045 class KelvinUnits;
00046 class DegreeRankineUnit;
00047 
00049 typedef unit::Prefixable<Unit, KelvinUnits> Kelvins;
00050 
00052 typedef unit::Prefixed<Kelvins> Kelvin;
00053 
00055 typedef unit::Prefixed<Kelvins, unit::Milli> MilliKelvin;
00056 
00058 typedef unit::NonPrefixable<Unit, DegreeRankineUnit> DegreeRankine;
00059 
00061 typedef Loki::TL::Append<Kelvins::Units, 
00062                           LOKI_TYPELIST_1(DegreeRankine)>::Result Units;
00063 
00064 /* declare some abbreviated temperature units */
00065 typedef Kelvin K;
00066 
00067 
00068 /* ThermodynamicTemperature quantity */
00069 
00070 typedef Quantity<Class> Quantity;
00071 
00072 class DerivedThermodynamicTemperature;
00073 
00074   } // end namespace thermodynamicTemperature
00075 
00077 
00079   template<typename ST>
00080     struct Standard<thermodynamicTemperature::Kelvins, ST>
00081     {
00082       static const ST ratio;
00083       static const bool exact;
00084     };
00085 
00087 template<typename ST> const ST Standard<thermodynamicTemperature::Kelvins, ST>::ratio = 1.0;
00088 
00090 template<typename ST> const bool Standard<thermodynamicTemperature::Kelvins, ST>::exact = true;
00091 
00093 
00095   template<typename ST>
00096     struct Standard<thermodynamicTemperature::DegreeRankine, ST>
00097     {
00098       static const ST ratio;
00099       static const bool exact;
00100     };
00101 
00103 template<typename ST> const ST Standard<thermodynamicTemperature::DegreeRankine, ST>::ratio = 5./9.;
00104 
00106 template<typename ST> const bool Standard<thermodynamicTemperature::DegreeRankine, ST>::exact = true;
00107 
00109 template<>
00110   struct QuantityTraits<thermodynamicTemperature::Class>
00111   {
00112     typedef
00113       dimension::Dimension<BSUtilities::Rational<0>,
00114         BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00115           BSUtilities::Rational<0>, BSUtilities::Rational<1>,
00116             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00117     typedef thermodynamicTemperature::Unit UnitType;
00118     typedef thermodynamicTemperature::Units UnitList;
00119     typedef thermodynamicTemperature::Kelvin DefaultUnit;
00120 
00121     typedef thermodynamicTemperature::DerivedThermodynamicTemperature DefaultDerivedQuantityType;
00122 
00123     static const std::string NameString;
00124     static const std::string SymbolString;
00125 
00126   };
00127 
00128 // the derived quantity traits template for Kelvin Thermodynamic Temperature
00129 template<>
00130   struct DerivedQuantityTraits<thermodynamicTemperature::Class, 
00131                                 thermodynamicTemperature::DerivedThermodynamicTemperature>
00132   {
00133     static const bool OverwriteName = false;
00134     static const bool OverwriteSymbol = false;
00135 
00136     static const std::string NameString;
00137     static const std::string SymbolString;
00138 
00139   };
00140 
00141 
00143 typedef Variable<thermodynamicTemperature::Quantity> ThermodynamicTemperature;
00144 
00146 typedef Constant<thermodynamicTemperature::Quantity> ThermodynamicTemperatureConstant;
00147 
00149 typedef QuantityVector<Variable, thermodynamicTemperature::Quantity> 
00150                                          ThermodynamicTemperatureVector;
00151 
00152 }
00153 
00154 #endif /* thermodynamicTemperature_h */

Generated on Mon Jul 27 15:55:45 2009 for Quantities by  doxygen 1.5.3