Main Page | Class Hierarchy | Class List | File List

Mass.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002 - 2006, 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 _Mass_h
00028 #define _Mass_h
00029 
00030 #include "Quantity/Variable.h"
00031 #include "Quantity/Constant.h"
00032 #include "Quantity/QuantityCluster.h"
00033 
00034 namespace quantity {
00035   namespace mass {
00036 
00037 /* Mass dimension */
00038 typedef BSUtilities::Rational<0> LE;
00039 typedef BSUtilities::Rational<1> M;
00040 typedef BSUtilities::Rational<0> TI;
00041 typedef BSUtilities::Rational<0> E;
00042 typedef BSUtilities::Rational<0> TE;
00043 typedef BSUtilities::Rational<0> A;
00044 typedef BSUtilities::Rational<0> LU;
00045 
00046 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00047 
00049 class Unit;
00050 
00051 /* declaration of Mass units */
00052 class GramUnits;
00053 class ElectronMassUnit;
00054 class DaltonUnit;
00055 class UUnit;
00056 class GammaUnit;
00057 class TonneUnits;
00058 class PoundUnit;
00059 class OunceUnit;
00060 class TroyOunceUnit;
00061 class GrainUnit;
00062 
00063 /* the gram and prefixed grams */
00064 
00065 typedef unit::Prefixable<Unit, GramUnits> Grams;
00066 
00067 typedef unit::Prefixed<Grams> Gram;
00068 typedef unit::Prefixed<Grams, unit::Milli> MilliGram;
00069 typedef unit::Prefixed<Grams, unit::Micro> MicroGram;
00070 typedef unit::Prefixed<Grams, unit::Nano> NanoGram;
00071 typedef unit::Prefixed<Grams, unit::Pico> PicoGram;
00072 typedef unit::Prefixed<Grams, unit::Kilo> KiloGram;
00073 
00074 /* the electron mass */
00075 
00076 typedef unit::NonPrefixable<Unit, ElectronMassUnit> ElectronMass;
00077 
00078 /* the Dalton */
00079 
00080 typedef unit::NonPrefixable<Unit, DaltonUnit> Dalton;
00081 
00082 /* the u mass unit */
00083 
00084 typedef unit::NonPrefixable<Unit, UUnit> U;
00085 
00086 /* the gamma */
00087 
00088 typedef unit::NonPrefixable<Unit, GammaUnit> Gamma;
00089 
00090 /* the tonne */
00091 typedef unit::Prefixable<Unit, TonneUnits> Tonnes;
00092 
00093 typedef unit::Prefixed<Tonnes> Tonne;
00094 typedef unit::Prefixed<Tonnes, unit::Kilo> KiloTonne;
00095 typedef unit::Prefixed<Tonnes, unit::Mega> MegaTonne;
00096 
00097 /* the pound */
00098 
00099 typedef unit::NonPrefixable<Unit, PoundUnit> Pound;
00100 
00101 /* the ounce */
00102 
00103 typedef unit::NonPrefixable<Unit, OunceUnit> Ounce;
00104 
00105 /* the troy ounce */
00106 
00107 typedef unit::NonPrefixable<Unit, TroyOunceUnit> TroyOunce;
00108 
00109 /* the grain */
00110 
00111 typedef unit::NonPrefixable<Unit, GrainUnit> Grain;
00112 
00113 typedef 
00114   Loki::TL::Append<Loki::TL::Append<Grams::Units, Tonne::Units>::Result,
00115     LOKI_TYPELIST_8(ElectronMass, Dalton, U, Gamma, Pound, Ounce, TroyOunce, 
00116                                                   Grain)>::Result Units;
00117 
00118 /* declare some abbreviated time units */
00119 
00120 typedef Gram g;
00121 typedef KiloGram kg;
00122 
00123 /* Mass quantity */
00124 
00125 typedef Quantity<Dimension, Unit, Units, KiloGram> Quantity;
00126 
00127   }
00128 
00129 typedef Variable<mass::Quantity> Mass;
00130 typedef Constant<mass::Quantity> MassConstant;
00131 
00132 typedef QuantityVector<Variable, mass::Quantity> MassVector;
00133 
00134 }
00135 
00136 #endif /* _Mass_h */

Generated on Mon Feb 12 18:48:49 2007 for PhysicalQuantities by doxygen 1.3.6