![]() |
Shamrock 2025.10.0
Astrophysical Code
|
namespace containing the units library More...
Classes | |
| struct | Constants |
| Physical constants. More... | |
| struct | ConversionConstants |
| class | UnitSystem |
| Defines a unit system. More... | |
Enumerations | |
| enum | UnitPrefix { tera = 12 , T = 12 , giga = 9 , G = 9 , mega = 6 , M = 6 , kilo = 3 , k = 3 , hecto = 2 , hect = 2 , deca = 1 , dec = 1 , None = 0 , _ = 0 , centi = -2 , c = -2 , milli = -3 , m = -3 , micro = -6 , mu = -6 , nano = -9 , n = -9 , pico = -12 , p = -12 , femto = -15 , f = -15 } |
| Enum of all prefixes. More... | |
Functions | |
| template<class Tscal > | |
| void | to_json (nlohmann::json &j, const ::shamunits::UnitSystem< Tscal > &p) |
| Converts a UnitSystem object to a JSON object. | |
| template<class Tscal > | |
| void | from_json (const nlohmann::json &j, ::shamunits::UnitSystem< Tscal > &p) |
| Deserializes a UnitSystem object from a JSON object. | |
| template<class T , UnitPrefix p> | |
| constexpr T | get_prefix_val () |
| Get the value of a prefix. | |
| const std::string | get_unit_prefix_name (UnitPrefix p) |
| Get the prefix name for a UnitPrefix enum value. | |
| const UnitPrefix | unit_prefix_from_name (std::string p) |
| Get the UnitPrefix enum value from a prefix name as a string. | |
Variables | |
| template<class T > | |
| constexpr T | pi = 3.141592653589793116 |
Value of pi Usage : auto pi = shamunits::pi<T>; | |
| template<class T > | |
| constexpr T | fine_structure = 0.0072973525693 |
| Fine structure constant. | |
| template<class T > | |
| constexpr T | proton_electron_ratio = 1836.1526734311 |
| Mass ration between the proton and electron. | |
| template<class T > | |
| constexpr T | electron_proton_ratio = 1 / proton_electron_ratio<T> |
| Mass ration between the electron and proton. | |
namespace containing the units library
|
inline |
Deserializes a UnitSystem object from a JSON object.
| j | The JSON object to deserialize from. |
| p | The UnitSystem object to populate. |
Definition at line 51 of file units_json.hpp.
|
inlineconstexpr |
|
inline |
|
inline |
Converts a UnitSystem object to a JSON object.
| j | The JSON object to be populated. |
| p | The UnitSystem object to be converted. |
Definition at line 33 of file units_json.hpp.
|
inline |
|
constexpr |
Mass ration between the electron and proton.
Definition at line 106 of file Constants.hpp.
|
constexpr |
Fine structure constant.
Definition at line 98 of file Constants.hpp.
|
constexpr |
Value of pi Usage : auto pi = shamunits::pi<T>;
Definition at line 94 of file Constants.hpp.
|
constexpr |
Mass ration between the proton and electron.
Definition at line 102 of file Constants.hpp.