IAP GITLAB

Skip to content
Snippets Groups Projects
Commit a8dcb961 authored by Felix Riehn's avatar Felix Riehn
Browse files

added cross section unit

parent 2a9e90e9
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ namespace corsika::units::si::constants {
// unified atomic mass unit
constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram};
// millibarn
// barn
constexpr quantity<area_d> barn{Rep(1.e-28L) * meter * meter};
// etc.
......
......@@ -24,6 +24,31 @@ namespace phys {
} // namespace units
} // namespace phys
namespace phys {
namespace units {
namespace literals {
QUANTITY_DEFINE_SCALING_LITERALS(barn, area_d,
magnitude(corsika::units::si::constants::barn))
// phys::units::quantity<energy_d/mass_d> Joule2Kg = c2; // 1_Joule / 1_kg;
} // namespace literals
} // namespace units
}
namespace phys {
namespace units {
namespace literals {
QUANTITY_DEFINE_SCALING_LITERALS(meter, length_d,
magnitude(corsika::units::si::constants::meter))
// phys::units::quantity<energy_d/mass_d> Joule2Kg = c2; // 1_Joule / 1_kg;
} // namespace literals
} // namespace units
}
namespace corsika::units::si {
using namespace phys::units;
using namespace phys::units::literals;
......
......@@ -54,7 +54,8 @@ TEST_CASE("PhysicalUnits", "[Units]") {
REQUIRE(1_mol / 1_amol == Approx(1e18));
REQUIRE(1_K / 1_zK == Approx(1e21));
REQUIRE(1_K / 1_yK == Approx(1e24));
// REQUIRE(1_barn / 1_mbarn == Approx(1e3));
REQUIRE(1_A / 1_hA == Approx(1e-2));
REQUIRE(1_m / 1_km == Approx(1e-3));
REQUIRE(1_m / 1_Mm == Approx(1e-6));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment