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.
- Note
- Helper utility class for internal use within Cantera.
- Warning
- This class is an experimental part of the Cantera API and may be changed or removed without notice.
Definition at line 104 of file Units.h.
|
| UnitStack (const Units &standardUnits) |
|
| UnitStack (std::initializer_list< pair< Units, double > > units) |
| Alternative constructor allows for direct assignment of vector.
|
|
size_t | size () const |
| Size of UnitStack.
|
|
Units | standardUnits () const |
| Get standard unit used by UnitStack.
|
|
void | setStandardUnits (Units &standardUnits) |
| Set standard units.
|
|
double | standardExponent () const |
| Effective exponent of standard unit.
|
|
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.
|
|
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.
|
|
Units | product () const |
| Calculate product of units-exponent stack.
|
|