SurfaceConcentration.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2004 - 2009, Kai Ludwig, Bernd Speiser */
00006 /* This file is part of PhysicalQuantities.
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 _SurfaceConcentration_h
00025 #define _SurfaceConcentration_h
00026 
00027 // Quantity includes
00028 #include "Quantity/Variable.h"
00029 #include "Quantity/Constant.h"
00030 #include "Quantity/QuantityCluster.h"
00031 #include "PhysicalQuantities/AmountOfSubstance.h"
00032 #include "PhysicalQuantities/Volume.h"
00033 
00034 namespace quantity {
00035   namespace surfaceConcentration {
00036 
00038 class Class;
00039 
00041 class Unit;
00042 
00043 /* MolePerSquareMetre and prefixed variants */
00044 
00045 typedef LOKI_TYPELIST_2(amountOfSubstance::Mole, 
00046                    amountOfSubstance::MilliMole) AmountOfSubstanceList;
00047 
00049 typedef unit::ComposeElement<Unit, 
00050   AmountOfSubstanceList, BSUtilities::Rational<1> > 
00051                                                AmountOfSubstanceElement;
00052 
00053 typedef LOKI_TYPELIST_2(length::Metre, length::CentiMetre) LengthList;
00054 
00056 typedef unit::ComposeElement<Unit, LengthList, 
00057                               BSUtilities::Rational<-2> > LengthElement;
00058 
00059 typedef unit::ComposeBase<Unit, 
00060   LOKI_TYPELIST_2(AmountOfSubstanceElement, LengthElement)> 
00061                                        SurfaceConcentrationComposedUnit;
00062 
00063 typedef unit::Composed<SurfaceConcentrationComposedUnit, 
00064   LOKI_TYPELIST_2(amountOfSubstance::Mole, length::Metre)> 
00065                                                      MolePerSquareMetre;
00066 
00067 typedef unit::Composed<SurfaceConcentrationComposedUnit, 
00068   LOKI_TYPELIST_2(amountOfSubstance::Mole, length::CentiMetre)> 
00069                                                 MolePerSquareCentiMetre;
00070 
00071 
00072 typedef unit::Composed<SurfaceConcentrationComposedUnit,
00073   LOKI_TYPELIST_2(amountOfSubstance::MilliMole, length::Metre)> 
00074                                                 MilliMolePerSquareMetre;
00075 
00076 typedef unit::Composed<SurfaceConcentrationComposedUnit,
00077   LOKI_TYPELIST_2(amountOfSubstance::MilliMole, 
00078                      length::CentiMetre)> MilliMolePerSquareCentiMetre;
00079 
00081 typedef LOKI_TYPELIST_4(MolePerSquareMetre, MolePerSquareCentiMetre, 
00082            MilliMolePerSquareMetre, MilliMolePerSquareCentiMetre) Units;
00083 
00084 /* SurfaceConcentration quantity */
00085 
00086 typedef Quantity<Class> Quantity;
00087 
00088 class DerivedSurfaceConcentration;
00089 
00090   } // end namespace surfaceConcentration
00091 
00093 
00095   template<typename ST>
00096     struct Standard<surfaceConcentration::SurfaceConcentrationComposedUnit, ST>
00097     {
00098       static const ST ratio;
00099       static const bool exact;
00100     };
00101 
00103 template<typename ST> const ST 
00104   Standard<surfaceConcentration::SurfaceConcentrationComposedUnit, ST>::ratio = 1.0;
00105 
00107 template<typename ST> const bool 
00108   Standard<surfaceConcentration::SurfaceConcentrationComposedUnit, ST>::exact = true;
00109 
00111 template<>
00112   struct QuantityTraits<surfaceConcentration::Class>
00113   {
00114     typedef
00115       dimension::Dimension<BSUtilities::Rational<-2>,
00116         BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00117           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00118             BSUtilities::Rational<1>, BSUtilities::Rational<0> > Dimension;
00119     typedef surfaceConcentration::Unit UnitType;
00120     typedef surfaceConcentration::Units UnitList;
00121     typedef surfaceConcentration::MolePerSquareMetre DefaultUnit;
00122 
00123     typedef surfaceConcentration::DerivedSurfaceConcentration DefaultDerivedQuantityType;
00124 
00125     static const std::string NameString;
00126     static const std::string SymbolString;
00127 
00128   };
00129 
00130 // the derived quantity traits template for MolePerSquareMetreClass SurfaceConcentration
00131 template<>
00132   struct DerivedQuantityTraits<surfaceConcentration::Class, 
00133                                       surfaceConcentration::DerivedSurfaceConcentration>
00134   {
00135     static const bool OverwriteName = false;
00136     static const bool OverwriteSymbol = false;
00137 
00138     static const std::string NameString;
00139     static const std::string SymbolString;
00140 
00141   };
00142 
00144 typedef Variable<surfaceConcentration::Quantity> SurfaceConcentration;
00145 
00147 typedef Constant<surfaceConcentration::Quantity> 
00148                                            SurfaceConcentrationConstant;
00149 
00151 typedef QuantityVector<Variable, surfaceConcentration::Quantity> 
00152                                              SurfaceConcentrationVector;
00153 
00154 }
00155 
00156 #endif /* _SurfaceConcentration_h */

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