Cantera
3.1.0a1
|
Unit aggregation utility. More...
#include <Units.h>
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.
Public Member Functions | |
UnitStack (const Units &standardUnits) | |
UnitStack (std::initializer_list< 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 | |
vector< pair< Units, double > > | stack |
Stack uses vector of pairs. More... | |
Units standardUnits | ( | ) | const |
void setStandardUnits | ( | Units & | standardUnits | ) |
double standardExponent | ( | ) | const |
void join | ( | double | exponent | ) |
void update | ( | const Units & | units, |
double | exponent | ||
) |
Units product | ( | ) | const |
vector<pair<Units, double> > stack |