AmountOfSubstance.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 _AmountOfSubstance_h
00028 #define _AmountOfSubstance_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 amountOfSubstance {
00037 
00039 class Class;
00040 
00042 class Unit;
00043 
00044 /* declaration of AmountOfSubstance units */
00045 class MoleUnits;
00046 
00048 typedef unit::Prefixable<Unit, MoleUnits> Moles;
00049 
00051 typedef unit::Prefixed<Moles> Mole;
00052 
00054 typedef unit::Prefixed<Moles, unit::Milli> MilliMole;
00055 
00057 typedef Moles::Units Units;
00058 
00059 /* declare some abbreviated AmountOfSubstance  units */
00060 
00061 typedef Mole mol;
00062 typedef MilliMole mmol;
00063 
00064 /* AmountOfSubstance Quantity */
00065 
00066 typedef Quantity<Class> Quantity;
00067 
00068 class DerivedAmountOfSubstance;
00069 
00070   } // end namespace amountOfSubstance
00071 
00073 
00075   template<typename ST>
00076     struct Standard<amountOfSubstance::Moles, ST>
00077     {
00078       static const ST ratio;
00079       static const bool exact;
00080     };
00081 
00083 template<typename ST> const ST Standard<amountOfSubstance::Moles, ST>::ratio = 1.0;
00084 
00086 template<typename ST> const bool Standard<amountOfSubstance::Moles, ST>::exact = true;
00087 
00089 template<>
00090   struct QuantityTraits<amountOfSubstance::Class>
00091   {
00092     typedef
00093       dimension::Dimension<BSUtilities::Rational<0>,
00094         BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00095           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00096             BSUtilities::Rational<1>, BSUtilities::Rational<0> > Dimension;
00097     typedef amountOfSubstance::Unit UnitType;
00098     typedef amountOfSubstance::Units UnitList;
00099     typedef amountOfSubstance::Mole DefaultUnit;
00100 
00101     typedef amountOfSubstance::DerivedAmountOfSubstance DefaultDerivedQuantityType;
00102 
00103     static const std::string NameString;
00104     static const std::string SymbolString;
00105 
00106   };
00107 
00108 // the derived quantity traits template for derived AmountOfSubstances
00109 template<>
00110   struct DerivedQuantityTraits<amountOfSubstance::Class, amountOfSubstance::DerivedAmountOfSubstance>
00111   {
00112     static const bool OverwriteName = false;
00113     static const bool OverwriteSymbol = false;
00114 
00115     static const std::string NameString;
00116     static const std::string SymbolString;
00117 
00118   };
00119 
00121 typedef Variable<amountOfSubstance::Quantity> AmountOfSubstance;
00122 
00124 typedef Constant<amountOfSubstance::Quantity> AmountOfSubstanceConstant;
00125 
00127 typedef QuantityVector<Variable, amountOfSubstance::Quantity> AmountOfSubstanceVector;
00128 
00129 }
00130 
00131 #endif /* _AmountOfSubstance_h */

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