Cantera
2.0
|
Unit conversion utility. More...
#include <units.h>
Public Member Functions | |
virtual | ~Unit () |
Empty Destructor. | |
doublereal | actEnergyToSI (std::string units) |
Return the multiplier required to convert an activation energy to SI units. | |
doublereal | toSI (std::string units) |
Return the multiplier required to convert a dimensional quantity with units specified by string 'units' to SI units. | |
Static Public Member Functions | |
static Unit * | units () |
Initialize the static Unit class. | |
static void | deleteUnit () |
Destroy the static Unit class. | |
Private Member Functions | |
Unit () | |
Units class constructor, containing the default mappings between strings and units. | |
Private Attributes | |
std::map< std::string, doublereal > | m_u |
Map between a string and a units double value. | |
std::map< std::string, doublereal > | m_act_u |
Map between a string and a units double value for activation energy units. | |
Static Private Attributes | |
static Unit * | s_u = 0 |
pointer to the single instance of Unit | |
static mutex_t | units_mutex |
Decl for static locker for Units singleton. | |
|
inlineprivate |
Units class constructor, containing the default mappings between strings and units.
Definition at line 173 of file units.h.
References Cantera::Avogadro, Cantera::GasConstant, Unit::m_act_u, and Unit::m_u.
Referenced by Unit::units().
|
inlinestatic |
Initialize the static Unit class.
Definition at line 33 of file units.h.
References Unit::s_u, Unit::Unit(), and Unit::units_mutex.
Referenced by Unit::actEnergyToSI(), Application::Application(), and Unit::toSI().
|
inlinestatic |
Destroy the static Unit class.
Note this can't be done in a destructor.
Definition at line 45 of file units.h.
References Unit::s_u, and Unit::units_mutex.
|
inline |
Return the multiplier required to convert an activation energy to SI units.
units | activation energy units |
Definition at line 61 of file units.h.
References Unit::m_act_u, Unit::toSI(), and Unit::units().
|
inline |
Return the multiplier required to convert a dimensional quantity with units specified by string 'units' to SI units.
The list of recognized units is stored as a stl map <string, doublereal>called m_u[] and m_act_u for activity coefficients. These maps are initialized with likely values.
units | String containing the units description |
Definition at line 78 of file units.h.
References Unit::m_u, Cantera::npos, and Unit::units().
Referenced by Unit::actEnergyToSI().
|
staticprivate |
pointer to the single instance of Unit
Definition at line 151 of file units.h.
Referenced by Unit::deleteUnit(), and Unit::units().
|
private |
Map between a string and a units double value.
This map maps the dimension string to the units value adjustment. Example
Definition at line 159 of file units.h.
Referenced by Unit::toSI(), and Unit::Unit().
|
private |
Map between a string and a units double value for activation energy units.
This map maps the dimension string to the units value adjustment. Example
Definition at line 166 of file units.h.
Referenced by Unit::actEnergyToSI(), and Unit::Unit().
|
staticprivate |
Decl for static locker for Units singleton.
Definition at line 169 of file units.h.
Referenced by Unit::deleteUnit(), and Unit::units().