Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Force.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2002-2004, Bernd Speiser */
00006 
00007 /* This file is part of Quantities.
00008 
00009 PhysicalQuantities is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 PhysicalQuantities is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018   
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00022 02111-1307, USA.
00023 */
00024 
00025 #ifndef _Force_h
00026 #define _Force_h
00027 
00028 #include "Quantity/Variable.h"
00029 #include "Quantity/Constant.h"
00030 #include "Quantity/QuantityCluster.h"
00031 
00032 namespace Quantities {
00033 
00034 /* Force dimension */
00035 typedef BSUtilities::Rational<1> Force_LE;
00036 typedef BSUtilities::Rational<1> Force_M;
00037 typedef BSUtilities::Rational<-2> Force_TI;
00038 typedef BSUtilities::Rational<0> Force_E;
00039 typedef BSUtilities::Rational<0> Force_TE;
00040 typedef BSUtilities::Rational<0> Force_A;
00041 typedef BSUtilities::Rational<0> Force_LU;
00042 class ForceGroup
00043   {
00044     public:
00045       typedef TYPELIST_7(Force_LE, Force_M, Force_TI, Force_E,
00046                                      Force_TE, Force_A, Force_LU) DimTL;
00047   };
00048 
00049 
00050   namespace ForceUnits {
00051 
00052 /* declaration of Force unit base class */
00053 typedef Units::Unit<ForceGroup> ForceUnit;
00054 
00055 /* declaration of Force units */
00056 class NewtonUnits;
00057 class DyneUnit;
00058 class KilogramForceUnit;
00059 class AtomicUnit;
00060 
00061 /* the Newton and prefixed Newtons */
00062 
00063 typedef Units::Prefixable<ForceGroup, NewtonUnits> Newtons;
00064 
00065 typedef Units::Prefixed<Newtons> Newton;
00066 
00067 /* the dyne */
00068 
00069 typedef Units::NonPrefixable<ForceGroup, DyneUnit> Dyne;
00070 
00071 /* the kilogram-force */
00072 
00073 typedef Units::NonPrefixable<ForceGroup, KilogramForceUnit> KilogramForce;
00074 
00075 /* the atomic force unit */
00076 
00077 typedef Units::NonPrefixable<ForceGroup, AtomicUnit> Atomic;
00078 
00079 typedef Loki::TL::Append<Newtons::Units,
00080             TYPELIST_3(Dyne, KilogramForce, Atomic)>::Result ForceUnits;
00081 
00082 /* declare some abbreviated time units */
00083 
00084 typedef Newton N;
00085 typedef Dyne dyn;
00086 
00087   }
00088 
00089 /* declaration of Force dimension */
00090 
00091 typedef Dimensions::Dimension<ForceGroup> ForceDimension;
00092 
00093 /* Force Quantity */
00094 
00095 typedef Quantity<ForceGroup, ForceUnits::ForceUnits,
00096                                     ForceUnits::Newton> ForceQuantities;
00097 
00098 typedef Variable<ForceQuantities> Force;
00099 typedef Constant<ForceQuantities> ForceConstant;
00100 
00101 typedef VariableVector<ForceQuantities> ForceVector;
00102 }
00103 
00104 #endif /* _Force_h */

Generated on Sun Jan 15 13:58:03 2006 for PhysicalQuantities by doxygen 1.3.6