From 23c4910689075ad5a2cced0a82e97bef81b20869 Mon Sep 17 00:00:00 2001 From: Remy Prechelt <prechelt@hawaii.edu> Date: Mon, 13 Jul 2020 19:23:12 -1000 Subject: [PATCH] Move EarthRadius into PhysicalConstant.h --- Environment/LayeredSphericalAtmosphereBuilder.h | 13 ++----------- Framework/Units/PhysicalConstants.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Environment/LayeredSphericalAtmosphereBuilder.h b/Environment/LayeredSphericalAtmosphereBuilder.h index a9c32abc1..f051485ca 100644 --- a/Environment/LayeredSphericalAtmosphereBuilder.h +++ b/Environment/LayeredSphericalAtmosphereBuilder.h @@ -13,6 +13,7 @@ #include <corsika/environment/NuclearComposition.h> #include <corsika/environment/VolumeTreeNode.h> #include <corsika/geometry/Point.h> +#include <corsika/units/PhysicalConstants.h> #include <corsika/units/PhysicalUnits.h> #include <memory> @@ -20,16 +21,6 @@ namespace corsika::environment { - /** - * A namespace containing various Earth radii. - */ - namespace EarthRadius { - static constexpr auto Mean{6'371'000 * units::si::meter}; - static constexpr auto Eqautorial{6'378'137 * units::si::meter}; - static constexpr auto Polar{6'356'752 * units::si::meter}; - static constexpr auto PolarCurvature{6'399'593 * units::si::meter}; - } // namespace EarthRadius - class LayeredSphericalAtmosphereBuilder { std::unique_ptr<NuclearComposition> composition_; geometry::Point center_; @@ -44,7 +35,7 @@ namespace corsika::environment { public: LayeredSphericalAtmosphereBuilder( corsika::geometry::Point center, - units::si::LengthType earthRadius = EarthRadius::Mean) + units::si::LengthType earthRadius = units::constants::EarthRadius::Mean) : center_(center) , earthRadius_(earthRadius) {} diff --git a/Framework/Units/PhysicalConstants.h b/Framework/Units/PhysicalConstants.h index eacccfe16..da86bbd1e 100644 --- a/Framework/Units/PhysicalConstants.h +++ b/Framework/Units/PhysicalConstants.h @@ -53,6 +53,16 @@ namespace corsika::units::constants { // molar gas constant auto constexpr R = Rep(8.314'459'8) * joule / (mole * kelvin); + /** + * A namespace containing various Earth radii. + */ + namespace EarthRadius { + static constexpr auto Mean{6'371'000 * meter}; + static constexpr auto Eqautorial{6'378'137 * meter}; + static constexpr auto Polar{6'356'752 * meter}; + static constexpr auto PolarCurvature{6'399'593 * meter}; + } // namespace EarthRadius + // etc. } // namespace corsika::units::constants -- GitLab