From 751bdcd1e56a59b92079da3524791dabd749cdde Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Sun, 24 Oct 2021 15:56:14 +0200 Subject: [PATCH] missing file --- tests/media/testCORSIKA7Atmospheres.cpp | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/media/testCORSIKA7Atmospheres.cpp diff --git a/tests/media/testCORSIKA7Atmospheres.cpp b/tests/media/testCORSIKA7Atmospheres.cpp new file mode 100644 index 000000000..55b208167 --- /dev/null +++ b/tests/media/testCORSIKA7Atmospheres.cpp @@ -0,0 +1,38 @@ +/* + * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + +#include <corsika/framework/core/ParticleProperties.hpp> +#include <corsika/framework/core/PhysicalUnits.hpp> +#include <corsika/framework/geometry/RootCoordinateSystem.hpp> + +#include <corsika/media/CORSIKA7Atmospheres.hpp> + +#include <catch2/catch.hpp> + +using namespace corsika; + +TEST_CASE("CORSIKA7Atmospheres") { + + logging::set_level(logging::level::info); + + CoordinateSystemPtr const& gCS = get_root_CoordinateSystem(); + Point const gOrigin(gCS, {0_m, 0_m, 0_m}); + + Environment<IMediumModel> env; + + // build a Linsley US Standard atmosphere into `env` + create_5layer_atmosphere<IMediumModel>(env, AtmosphereId::LinsleyUSStd, gOrigin); + + typedef typename Environment<IMediumModel>::BaseNodeType::VTN_type node_type; + node_type const* universe = env.getUniverse().get(); + + Point const p(gCS, {constants::EarthRadius::Mean, 0_m, 0_m}); + CHECK(universe->getContainingNode(p)->getModelProperties().getMassDensity(p) / 1_g * + static_pow<3>(1_cm) == + Approx(1222.6562 / 994186.38)); +} \ No newline at end of file -- GitLab