83 std::string
json()
const;
92 void undef(
bool val =
true);
137 static const std::string &
unit_symbol(
unsigned int idx);
Class for representation SI units of Fields.
friend UnitSI operator*(const UnitSI &a, const UnitSI &b)
Product of two units.
std::vector< int > exponents_
bool operator==(const UnitSI &other) const
Comparison operator.
std::string format_text() const
std::string format_latex() const
static const std::string & unit_symbol(unsigned int idx)
static UnitSI & J()
Returns Joule.
void undef(bool val=true)
UnitOrder
Values determine positions of exponents in exponents_ vector.
bool is_def() const
Return true if the unit is defined.
static UnitSI & one()
Returns dimensionless unit.
static UnitSI & W()
Returns Watt.
UnitSI & m(int exp=1)
Methods set values of exponents for SI units with similar name.
double convert_unit_from(std::string actual_unit) const
Convert and check user-defined unit.
friend UnitSI operator/(const UnitSI &a, const UnitSI &b)
Proportion of two units.
void reset()
Reset UnitSI object (set vector of exponents to zeros and set undef flag)
static UnitSI & dimensionless()
Returns dimensionless unit.
UnitSI & md(int exp=-1)
The dimension dependent meter: md^y = m^(yd), where 'd' is dimension.
void multiply(const UnitSI &other, int exp=1)
Multiply with power of given unit.
std::string format(OutputFormat form) const
Generic output formating method.
static UnitSI & Pa()
Returns Pascal.
UnitSI operator*(const UnitSI &a, const UnitSI &b)
Product of two units.
UnitSI operator/(const UnitSI &a, const UnitSI &b)
Proportion of two units.