sfepy.mechanics.units module

Some utilities for work with units of physical quantities.

class sfepy.mechanics.units.Quantity(name, unit_set)[source]
class sfepy.mechanics.units.Unit(name)[source]
static get_prefix(coef, bias=0.1, omit=None)[source]

Get the prefix and numerical multiplier corresponding to a numerical coefficient, omitting prefixes in omit tuple.

sfepy.mechanics.units.apply_unit_multipliers(values, unit_kinds, unit_multipliers)[source]

Apply time, length and mass unit multipliers to given values with units corresponding to unit kinds.

Returns
new_valueslist

The new values with applied unit multipliers

sfepy.mechanics.units.apply_units_to_pars(pars, pars_kinds, unit_multipliers)[source]

Apply units in unit_multipliers to pars according to their kinds.

Parameters
parsdict

The input parameters given as name : value items.

pars_kindsdict

The kinds of the parameters given as name : kind items, with kinds defined in apply_unit_multipliers().

unit_multiplierstuple

The time, length and mass unit multipliers.

Returns
new_parsdict

The output parameters.

sfepy.mechanics.units.get_consistent_unit_set(length=None, time=None, mass=None, temperature=None)[source]

Given a set of basic units, return a consistent set of derived units for quantities listed in the units_of_quantities dictionary.