![]() |
Shamrock 2025.10.0
Astrophysical Code
|
The table of units: one constexpr Unit per unit, plus its name registry. More...
#include "shamunits/Unit.hpp"#include "shamunits/details/registry.hpp"#include <string_view>#include <array>Go to the source code of this file.
Namespaces | |
| namespace | shamunits |
| namespace containing the units library | |
Functions | |
| Unit | shamunits::units::from_name (std::string_view name) |
| Unit from its long or short name; throws std::invalid_argument if unknown. | |
The table of units: one constexpr Unit per unit, plus its name registry.
To add a unit: declare it below from existing units, then add one row to the registry. Both are checked at compile time (dimensions, unique names). Factors are Unit<> (double); combine them with double literals only (60. * second, not 60 * second).
Definition in file unit_table.hpp.
|
inline |
Unit from its long or short name; throws std::invalid_argument if unknown.
Definition at line 138 of file unit_table.hpp.
|
inlineconstexpr |
A.
Definition at line 33 of file unit_table.hpp.
|
inlineconstexpr |
au
Definition at line 64 of file unit_table.hpp.
|
inlineconstexpr |
Bq = s-1.
Definition at line 54 of file unit_table.hpp.
|
inlineconstexpr |
pint (0.568 L)
Definition at line 72 of file unit_table.hpp.
|
inlineconstexpr |
cd
Definition at line 36 of file unit_table.hpp.
|
inlineconstexpr |
C = s.A.
Definition at line 44 of file unit_table.hpp.
|
inlineconstexpr |
dy
Definition at line 62 of file unit_table.hpp.
|
inlineconstexpr |
rearth (equatorial)
Definition at line 68 of file unit_table.hpp.
|
inlineconstexpr |
eV
Definition at line 70 of file unit_table.hpp.
|
inlineconstexpr |
erg
Definition at line 71 of file unit_table.hpp.
|
inlineconstexpr |
F = C.V-1.
Definition at line 46 of file unit_table.hpp.
|
inlineconstexpr |
Gy = J.kg-1.
Definition at line 55 of file unit_table.hpp.
|
inlineconstexpr |
H = Wb.A-1.
Definition at line 51 of file unit_table.hpp.
|
inlineconstexpr |
Hz = s-1.
Definition at line 39 of file unit_table.hpp.
|
inlineconstexpr |
hr
Definition at line 61 of file unit_table.hpp.
|
inlineconstexpr |
J = N.m.
Definition at line 42 of file unit_table.hpp.
|
inlineconstexpr |
kat = mol.s-1
Definition at line 57 of file unit_table.hpp.
|
inlineconstexpr |
K.
Definition at line 34 of file unit_table.hpp.
|
inlineconstexpr |
kg
Definition at line 32 of file unit_table.hpp.
|
inlineconstexpr |
ly
Definition at line 65 of file unit_table.hpp.
|
inlineconstexpr |
lm = cd.sr
Definition at line 52 of file unit_table.hpp.
|
inlineconstexpr |
lx = lm.m-2
Definition at line 53 of file unit_table.hpp.
|
inlineconstexpr |
m
Definition at line 31 of file unit_table.hpp.
|
inlineconstexpr |
mn
Definition at line 60 of file unit_table.hpp.
|
inlineconstexpr |
mol
Definition at line 35 of file unit_table.hpp.
|
inlineconstexpr |
N = kg.m.s-2.
Definition at line 40 of file unit_table.hpp.
|
inlineconstexpr |
ohm = V.A-1
Definition at line 47 of file unit_table.hpp.
|
inlineconstexpr |
pc
Definition at line 66 of file unit_table.hpp.
|
inlineconstexpr |
Pa = N.m-2.
Definition at line 41 of file unit_table.hpp.
|
inlineconstexpr |
Name registry: long and short names. Python and saved scripts resolve these strings, so they must stay
Definition at line 76 of file unit_table.hpp.
|
inlineconstexpr |
s
Definition at line 30 of file unit_table.hpp.
|
inlineconstexpr |
S = ohm-1.
Definition at line 48 of file unit_table.hpp.
|
inlineconstexpr |
Sv = J.kg-1.
Definition at line 56 of file unit_table.hpp.
|
inlineconstexpr |
sol_mass
Definition at line 69 of file unit_table.hpp.
|
inlineconstexpr |
rsol
Definition at line 67 of file unit_table.hpp.
|
inlineconstexpr |
T = Wb.m-2.
Definition at line 50 of file unit_table.hpp.
|
inlineconstexpr |
V = W.A-1.
Definition at line 45 of file unit_table.hpp.
|
inlineconstexpr |
W = J.s-1.
Definition at line 43 of file unit_table.hpp.
|
inlineconstexpr |
Wb = V.s.
Definition at line 49 of file unit_table.hpp.
|
inlineconstexpr |
yr (Julian)
Definition at line 63 of file unit_table.hpp.