DiffusionCoefficient.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002 - 2009, Bernd Speiser */
00008 /* This file is part of Quantities.
00009 
00010 PhysicalQuantities is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 PhysicalQuantities is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019   
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00023 02111-1307, USA.
00024 */
00025 
00026 #ifndef _DiffusionCoefficient_h
00027 #define _DiffusionCoefficient_h
00028 
00029 // Quantity includes
00030 #include "Quantity/Variable.h"
00031 #include "Quantity/Constant.h"
00032 #include "Quantity/QuantityCluster.h"
00033 #include "PhysicalQuantities/Length.h"
00034 #include "PhysicalQuantities/Time.h"
00035 
00036 namespace quantity {
00037   namespace diffusionCoefficient {
00038 
00040 class Class;
00041 
00043 class Unit;
00044 
00045 /* SquareMetrePerSecond and prefixed variants */
00046 
00048 typedef LOKI_TYPELIST_3(length::Metre, length::CentiMetre,
00049                                         length::MilliMetre) LengthList;
00050 
00051 typedef unit::ComposeElement<Unit, LengthList, 
00052                                BSUtilities::Rational<2> > LengthElement;
00053 
00055 typedef LOKI_TYPELIST_3(time::Second, time::MilliSecond,
00056                                        time::MicroSecond) TimeList;
00057 
00058 typedef unit::ComposeElement<Unit, TimeList, 
00059                                 BSUtilities::Rational<-1> > TimeElement;
00060 
00061 typedef unit::ComposeBase<Unit, 
00062   LOKI_TYPELIST_2(LengthElement, TimeElement)>
00063                                       DiffusionCoefficientComposedUnit;
00064 
00065 typedef unit::Composed<DiffusionCoefficientComposedUnit, 
00066      LOKI_TYPELIST_2(length::Metre, time::Second)> SquareMetrePerSecond;
00067 
00068 typedef unit::Composed<DiffusionCoefficientComposedUnit,
00069   LOKI_TYPELIST_2(length::CentiMetre, time::Second)> 
00070                                               SquareCentiMetrePerSecond;
00071 
00073 typedef 
00074   LOKI_TYPELIST_2(SquareMetrePerSecond, SquareCentiMetrePerSecond) 
00075                                                                   Units;
00076 /* DiffusionCoefficient quantity */
00077 
00078 typedef Quantity<Class> Quantity;
00079 
00080 class DerivedDiffusionCoefficient;
00081 
00082   } // end namespace diffusionCoefficient
00083 
00085 
00087   template<typename ST>
00088     struct Standard<diffusionCoefficient::DiffusionCoefficientComposedUnit, ST>
00089     {
00090       static const ST ratio;
00091       static const bool exact;
00092     };
00093 
00095 template<typename ST> const ST 
00096      Standard<diffusionCoefficient::DiffusionCoefficientComposedUnit, ST>::ratio = 1.0;
00097 
00099 template<typename ST> const bool 
00100      Standard<diffusionCoefficient::DiffusionCoefficientComposedUnit, ST>::exact = true;
00101 
00103 template<>
00104   struct QuantityTraits<diffusionCoefficient::Class>
00105   {
00106     typedef
00107       dimension::Dimension<BSUtilities::Rational<2>,
00108         BSUtilities::Rational<0>, BSUtilities::Rational<-1>,
00109           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00110             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00111     typedef diffusionCoefficient::Unit UnitType;
00112     typedef diffusionCoefficient::Units UnitList;
00113     typedef diffusionCoefficient::SquareMetrePerSecond DefaultUnit;
00114 
00115     typedef diffusionCoefficient::DerivedDiffusionCoefficient DefaultDerivedQuantityType;
00116 
00117     static const std::string NameString;
00118     static const std::string SymbolString;
00119 
00120   };
00121 
00122 template<>
00123   struct DerivedQuantityTraits<diffusionCoefficient::Class, 
00124                                                       diffusionCoefficient::DerivedDiffusionCoefficient>
00125   {
00126     static const bool OverwriteName = false;
00127     static const bool OverwriteSymbol = false;
00128 
00129     static const std::string NameString;
00130     static const std::string SymbolString;
00131 
00132   };
00133 
00135 typedef Variable<diffusionCoefficient::Quantity> DiffusionCoefficient;
00136 
00138 typedef Constant<diffusionCoefficient::Quantity> 
00139                                            DiffusionCoefficientConstant;
00140 
00142 typedef QuantityVector<Variable, diffusionCoefficient::Quantity> 
00143                                              DiffusionCoefficientVector;
00144 
00145 } // end namespace quantity
00146 
00147 #endif /* _DiffusionCoefficient_h */

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