Cantera 2.6.0
|
Unit aggregation utility. More...
#include <Units.h>
Public Member Functions | |
UnitStack (const Units &standardUnits) | |
UnitStack (std::initializer_list< std::pair< Units, double > > units) | |
Alternative constructor allows for direct assignment of vector. More... | |
size_t | size () const |
Size of UnitStack. More... | |
Units | standardUnits () const |
Get standard unit used by UnitStack. More... | |
void | setStandardUnits (Units &standardUnits) |
Set standard units. More... | |
double | standardExponent () const |
Effective exponent of standard unit. More... | |
void | join (double exponent) |
Join (update) exponent of standard units, where the updated exponent is the sum of the pre-existing exponent and the exponent passed as the argument. More... | |
void | update (const Units &units, double exponent) |
Update exponent of item with matching units; if it does not exist, add unit-exponent pair at end of stack. More... | |
Units | product () const |
Calculate product of units-exponent stack. More... | |
Public Attributes | |
std::vector< std::pair< Units, double > > | stack |
Stack uses vector of pairs. More... | |
Unit aggregation utility.
Provides functions for updating and calculating effective units from a stack of unit-exponent pairs. Matching units are aggregated, where a standard unit simplifies access when joining exponents. The utility is used in the context of effective reaction rate units.
Helper utility class.
|
inline |
Size of UnitStack.
Definition at line 110 of file Units.h.
References UnitStack::stack.
Referenced by FalloffRate::setParameters(), and ArrheniusBase::setRateUnits().
Units standardUnits | ( | ) | const |
Get standard unit used by UnitStack.
Definition at line 334 of file Units.cpp.
References UnitStack::stack.
Referenced by ArrheniusBase::setRateUnits(), and UnitStack::setStandardUnits().
void setStandardUnits | ( | Units & | standardUnits | ) |
Set standard units.
Definition at line 342 of file Units.cpp.
References UnitStack::stack, and UnitStack::standardUnits().
double standardExponent | ( | ) | const |
Effective exponent of standard unit.
Definition at line 355 of file Units.cpp.
References UnitStack::stack.
void join | ( | double | exponent | ) |
Join (update) exponent of standard units, where the updated exponent is the sum of the pre-existing exponent and the exponent passed as the argument.
Definition at line 363 of file Units.cpp.
References UnitStack::stack.
Referenced by FalloffRate::setParameters().
void update | ( | const Units & | units, |
double | exponent | ||
) |
Update exponent of item with matching units; if it does not exist, add unit-exponent pair at end of stack.
Definition at line 373 of file Units.cpp.
References UnitStack::stack.
Units product | ( | ) | const |
Calculate product of units-exponent stack.
Definition at line 388 of file Units.cpp.
References Units::pow(), and UnitStack::stack.
Referenced by ChebyshevRate::setParameters(), and ArrheniusBase::setRateUnits().
std::vector<std::pair<Units, double> > stack |
Stack uses vector of pairs.
Definition at line 132 of file Units.h.
Referenced by UnitStack::join(), UnitStack::product(), UnitStack::setStandardUnits(), UnitStack::size(), UnitStack::standardExponent(), UnitStack::standardUnits(), and UnitStack::update().