IAP GITLAB

Skip to content
Snippets Groups Projects
Commit fbd3af53 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan:
Browse files

added convenience function to build layered atmosphere as in C7

parent e73d4821
No related branches found
No related tags found
1 merge request!171Layered atmosphere builder
/*
* (c) Copyright 2019 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* 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/environment/NuclearComposition.h>
#include <corsika/environment/FlatExponential.h>
#include <corsika/environment/SlidingPlanarExponential.h>
#include <corsika/environment/VolumeTreeNode.h>
#include <corsika/particles/ParticleProperties.h>
#include <corsika/units/PhysicalUnits.h>
#include <memory>
namespace corsika::environment {
class LayeredAtmosphereBuilder {
std::unique_ptr<NuclearComposition> nuclearComposition_;
geometry::Point center_;
units::si::LengthType previousRadius_{LengthType::zero()};
static auto constexpr earthRadius_ = 6371_km;
public:
LayeredAtmosphereBuilder(corsika::geometry::Point center) : center_(center) {}
void setNuclearComposition(NuclearComposition composition) {
nuclearComposition_ = std::make_unique<NuclearComposition>(composition);
}
void addLayer(units::si::GrammageType a, units::si::GrammageType b, units::si::LengthType c, units::si::LengthType thickness) {
auto const radius = previousRadius_ + thickness;
std::make_unique<BaseNodeType>(
std::make_unique<geometry::Sphere>(center_, radius);
previousRadius_ = radiusl
}
auto const assemble() {
// get the outmost VolumeTreeNode
}
};
}
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