18 #ifndef UNIT_CONVERTER_HH_ 19 #define UNIT_CONVERTER_HH_ 36 <<
"Invalid definition of unit: " << EI_UnitDefinition::qval <<
"\n" << EI_UnitError::val <<
".\n");
38 <<
"Non-corresponding definition of unit: " << EI_UnitDefinition::qval <<
"\nExpected: unit with base format " 39 << EI_ExpectedUnit::qval <<
".\n");
96 double convert(std::string actual_unit);
100 ASSERT(unit_si_.is_def()).error(
"UnitSI is not defined, first call convert method.");
UnitSI unit_
derived SI unit
Helper class. Defines basic factors of SI, non-SI and derived units.
UnitsMap units_map_
Define all base and derived units given by their symbol.
bool basic_
unit is basic (strict defined in application) / derived (defined by user as formula) ...
UnitSI unit_si() const
Return unit_si_.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
std::map< std::string, struct DerivedUnit > UnitsMap
Yes & convert(fmt::ULongLong)
TYPEDEF_ERR_INFO(EI_UnitDefinition, std::string)
Factor(std::string factor, int exponent, bool basic=true)
std::string factor_
string represantation of unit or user defined constant
Store structure given by parser.
DECLARE_INPUT_EXCEPTION(ExcInvalidUnit,<< "Invalid definition of unit: "<< EI_UnitDefinition::qval<< "\n"<< EI_UnitError::val<< ".\n")
std::map< std::string, struct Formula > UnitData
Class for representation SI units of Fields.
static const BasicFactors basic_factors
Define all base and derived units given by their symbol.
double coef_
multiplicative coeficient