00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _Force_h
00029 #define _Force_h
00030
00031
00032 #include "Quantity/Variable.h"
00033 #include "Quantity/Constant.h"
00034 #include "Quantity/QuantityCluster.h"
00035
00036 namespace quantity {
00037 namespace force {
00038
00040 class Class;
00041
00043 class Unit;
00044
00045
00046 class NewtonUnits;
00047 class DyneUnit;
00048 class KilogramForceUnit;
00049 class AtomicUnit;
00050
00052 typedef unit::Prefixable<Unit, NewtonUnits> Newtons;
00053
00055 typedef unit::Prefixed<Newtons> Newton;
00056
00058 typedef unit::NonPrefixable<Unit, DyneUnit> Dyne;
00059
00061 typedef unit::NonPrefixable<Unit, KilogramForceUnit> KilogramForce;
00062
00064 typedef unit::NonPrefixable<Unit, AtomicUnit> Atomic;
00065
00067 typedef Loki::TL::Append<Newtons::Units,
00068 LOKI_TYPELIST_3(Dyne, KilogramForce, Atomic)>::Result Units;
00069
00070
00071
00072 typedef Newton N;
00073 typedef Dyne dyn;
00074
00075
00076
00077 typedef Quantity<Class> Quantity;
00078
00079 class DerivedForce;
00080
00081 }
00082
00084
00086 template<typename ST>
00087 struct Standard<force::Newton, ST>
00088 {
00089 static const ST ratio;
00090 static const bool exact;
00091 };
00092
00094 template<typename ST> const ST Standard<force::Newton, ST>::ratio = 1.0;
00095
00097 template<typename ST> const bool Standard<force::Newton, ST>::exact = true;
00098
00100
00102 template<typename ST>
00103 struct Standard<force::Dyne, ST>
00104 {
00105 static const ST ratio;
00106 static const bool exact;
00107 };
00108
00110 template<typename ST> const ST Standard<force::Dyne, ST>::ratio = 1.0e-5;
00111
00113 template<typename ST> const bool Standard<force::Dyne, ST>::exact = true;
00114
00116
00118 template<typename ST>
00119 struct Standard<force::KilogramForce, ST>
00120 {
00121 static const ST ratio;
00122 static const bool exact;
00123 };
00124
00126 template<typename ST> const ST Standard<force::KilogramForce, ST>::ratio = 9.80665;
00127
00129 template<typename ST> const bool Standard<force::KilogramForce, ST>::exact = true;
00130
00132
00134 template<typename ST>
00135 struct Standard<force::Atomic, ST>
00136 {
00137 static const ST ratio;
00138 static const bool exact;
00139 };
00140
00142 template<typename ST> const ST Standard<force::Atomic, ST>::ratio = 8.23873e-8;
00143
00145 template<typename ST> const bool Standard<force::Atomic, ST>::exact = false;
00146
00148 template<>
00149 struct QuantityTraits<force::Class>
00150 {
00151 typedef
00152 dimension::Dimension<BSUtilities::Rational<1>,
00153 BSUtilities::Rational<1>, BSUtilities::Rational<-2>,
00154 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00155 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00156 typedef force::Unit UnitType;
00157 typedef force::Units UnitList;
00158 typedef force::Newton DefaultUnit;
00159
00160 typedef force::DerivedForce DefaultDerivedQuantityType;
00161
00162 static const std::string NameString;
00163 static const std::string SymbolString;
00164
00165 };
00166
00167
00168 template<>
00169 struct DerivedQuantityTraits<force::Class, force::DerivedForce>
00170 {
00171 static const bool OverwriteName = false;
00172 static const bool OverwriteSymbol = false;
00173
00174 static const std::string NameString;
00175 static const std::string SymbolString;
00176
00177 };
00178
00180 typedef Variable<force::Quantity> Force;
00181
00183 typedef Constant<force::Quantity> ForceConstant;
00184
00186 typedef QuantityVector<Variable, force::Quantity> ForceVector;
00187 }
00188
00189 #endif