feat: gray and sievert now have correct associated quantity kinds

This commit is contained in:
Mateusz Pusz
2023-09-26 15:27:43 +02:00
parent 52479412bb
commit 7a6b629218
3 changed files with 12 additions and 2 deletions

View File

@@ -24,11 +24,15 @@
#include <mp-units/quantity_spec.h>
#include <mp-units/systems/isq/base_quantities.h>
#include <mp-units/systems/isq/mechanics.h>
#include <mp-units/systems/isq/space_and_time.h>
namespace mp_units::isq {
// TODO Add all the remaining ISQ definitions
QUANTITY_SPEC(activity, 1 / duration);
QUANTITY_SPEC(absorbed_dose, energy / mass);
QUANTITY_SPEC(ionizing_radiation_quality_factor, dimensionless);
QUANTITY_SPEC(dose_equivalent, absorbed_dose* ionizing_radiation_quality_factor);
} // namespace mp_units::isq

View File

@@ -73,8 +73,8 @@ inline constexpr struct degree_Celsius : named_unit<basic_symbol_text{"°C", "`C
inline constexpr struct lumen : named_unit<"lm", candela * steradian> {} lumen;
inline constexpr struct lux : named_unit<"lx", lumen / square(metre)> {} lux;
inline constexpr struct becquerel : named_unit<"Bq", 1 / second, kind_of<isq::activity>> {} becquerel;
inline constexpr struct gray : named_unit<"Gy", joule / kilogram> {} gray;
inline constexpr struct sievert : named_unit<"Sv", joule / kilogram> {} sievert;
inline constexpr struct gray : named_unit<"Gy", joule / kilogram, kind_of<isq::absorbed_dose>> {} gray;
inline constexpr struct sievert : named_unit<"Sv", joule / kilogram, kind_of<isq::dose_equivalent>> {} sievert;
inline constexpr struct katal : named_unit<"kat", mole / second> {} katal;
// clang-format on

View File

@@ -326,4 +326,10 @@ static_assert(verify(isq::reactive_power, scalar, V* A));
static_assert(verify(isq::non_active_power, scalar, V* A));
static_assert(verify(isq::active_energy, scalar, J, W* h));
// atomic and nuclear physics
static_assert(verify(isq::activity, scalar, Bq, 1 / s));
static_assert(verify(isq::absorbed_dose, scalar, Gy, J / kg, m2 / s2));
static_assert(verify(isq::quality_factor, scalar, one));
static_assert(verify(isq::dose_equivalent, scalar, Sv, J / kg, m2 / s2));
} // namespace