mpacts.core. new_units

In order to be able to use this module import it like this:

import mpacts.core.new_units
#or assign it to a shorter name
import mpacts.core.new_units as new

QuantityBase

class mpacts.core.new_units.QuantityBase((object)arg1, (object)arg2, (Unit)arg3) → None

Bases: Boost.Python.instance

Base class of Quantity for which the value held is unspecified, allowing for only limited operations.

QuantityBase(name, parent, **kwargs)
to((QuantityBase)self, (str)unit_string) → QuantityBase :

Represent the quantity in the given unit determined by the unit string.

to( (QuantityBase)self, (Unit)unit) -> QuantityBase :
Represent the quantity in the given unit.
unit((QuantityBase)self) → Unit :

Return the unit.

value((QuantityBase)self) → object :

Return the value in the multiples of current unit.

value_SI((QuantityBase)self) → object :

Return the value in the SI unit equivalent.

QuantityMatrix

class mpacts.core.new_units.QuantityMatrix((object)arg1, (object)arg2, (Unit)arg3) → None

Bases: mpacts.core.new_units.QuantityBase

Matrix Quantity with support for math.

QuantityMatrix(name, parent, **kwargs)
T((QuantityMatrix)self) → QuantityBase :

Transpose.

asym((QuantityMatrix)self) → QuantityBase :

Anti-symmetric part of the matrix: 0.5 * ( M - M.T )

dot((QuantityMatrix)self, (QuantityVector)other) → QuantityBase :

Dot product.

dot( (QuantityMatrix)self, (QuantityMatrix)other) -> QuantityBase :
Dot product.
dot( (QuantitySymmetricMatrix)self, (QuantitySymmetricMatrix)other) -> QuantityBase :
Dot product.
sym((QuantityMatrix)self) → QuantityBase :

Symmetric part of the matrix: 0.5 * ( M + M.T )

trace((QuantityMatrix)self) → QuantityBase :

Trace.

transpose((QuantityMatrix)self) → QuantityBase :

Transpose.

QuantityScalar

class mpacts.core.new_units.QuantityScalar((object)arg1, (object)arg2, (Unit)arg3) → None

Bases: mpacts.core.new_units.QuantityBase

Scalar Quantity with support for math.

QuantityScalar(name, parent, **kwargs)

QuantitySymmetricMatrix

class mpacts.core.new_units.QuantitySymmetricMatrix((object)arg1, (object)arg2, (Unit)arg3) → None

Bases: mpacts.core.new_units.QuantityBase

Symmetric matrix Quantity with support for math.

QuantitySymmetricMatrix(name, parent, **kwargs)
T((QuantitySymmetricMatrix)self) → QuantityBase :

Transpose.

asym((QuantitySymmetricMatrix)self) → QuantityBase :

Anti-symmetric part of the matrix: 0.5 * ( M - M.T )

dot((QuantitySymmetricMatrix)self, (QuantityVector)other) → QuantityBase :

Dot product.

dot( (QuantitySymmetricMatrix)self, (QuantityMatrix)other) -> QuantityBase :
Dot product.
dot( (QuantitySymmetricMatrix)self, (QuantitySymmetricMatrix)other) -> QuantityBase :
Dot product.
sym((QuantitySymmetricMatrix)self) → QuantityBase :

Symmetric part of the matrix: 0.5 * ( M + M.T )

trace((QuantitySymmetricMatrix)self) → QuantityBase :

Trace.

transpose((QuantitySymmetricMatrix)self) → QuantityBase :

Transpose.

QuantityVector

class mpacts.core.new_units.QuantityVector((object)arg1, (object)arg2, (Unit)arg3) → None

Bases: mpacts.core.new_units.QuantityBase

Vector Quantity with support for math.

__init__( (object)arg1, (QuantityScalar)arg2, (QuantityScalar)arg3, (QuantityScalar)arg4) -> None

QuantityVector(name, parent, **kwargs)
cross((QuantityVector)self, (QuantityVector)other) → QuantityBase :

Cross product.

dot((QuantityVector)self, (QuantityVector)other) → QuantityBase :

Dot product.

dot( (QuantityVector)self, (QuantityMatrix)other) -> QuantityBase :
Dot product.
dot( (QuantityVector)self, (QuantitySymmetricMatrix)other) -> QuantityBase :
Dot product.
dyadic((QuantityVector)self, (QuantityVector)other) → QuantityBase :

Dyadic (tensor) product.

dyadic_self((QuantityVector)self) → QuantityBase :

Dyadic (tensor) product with itself.

levi_civita((QuantityVector)self) → QuantityBase :

Product of Levi-Civita tensor and the vector: e_{ijk} v^k

norm((QuantityVector)self) → QuantityBase :

Eucleidian norm of the vector.

Unit

class mpacts.core.new_units.Unit((object)arg1) → None

Bases: Boost.Python.instance

The actual unit type.

__init__( (object)arg1) -> None

__init__( (object)arg1, (str)arg2, (float)arg3, (Unit)arg4) -> None

__init__( (object)arg1, (str)arg2, (Unit)arg3) -> None

Unit(name, parent, **kwargs)
compatible_with((Unit)self, (Unit)other) → bool :

Loose equivalence, i.e. kN is compatible with N.

get_string((Unit)self) → str :

Print the unit representation without conversion to SI base units.

get_string_SI((Unit)self) → str :

Print the unit representation in SI base units.

is_regular((Unit)arg1) → bool :

Check whether it is a regular unit or any of the special cases: ‘none’, ‘any’ or ‘undefined’.

same_as((Unit)self, (Unit)other) → bool :

Strict equivalence, i.e. kN and N are not the same.

value

UnitRegister

class mpacts.core.new_units.UnitRegister((object)arg1) → None

Bases: Boost.Python.instance

Unit register.

UnitRegister(name, parent, **kwargs)
find((UnitRegister)self, (str)attribute) → Unit :

Evaluate the expression in order to get units. Named function alternative to get attribute.

register((UnitRegister)self, (str)name, (Unit)unit) → None :

Register the new unit to the registry under a given name.