IAP GITLAB

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

wip towards tracking integration

parent a4738ea3
No related branches found
No related tags found
1 merge request!9Resolve "Implement simple "homogenous" atmosphere model."
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include <corsika/setup/SetupStack.h> #include <corsika/setup/SetupStack.h>
#include <corsika/setup/SetupTrajectory.h> #include <corsika/setup/SetupTrajectory.h>
#include <corsika/environment/Environment.h>
#include <corsika/random/RNGManager.h> #include <corsika/random/RNGManager.h>
#include <corsika/cascade/SibStack.h> #include <corsika/cascade/SibStack.h>
...@@ -24,14 +26,18 @@ ...@@ -24,14 +26,18 @@
#include <corsika/process/sibyll/ParticleConversion.h> #include <corsika/process/sibyll/ParticleConversion.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
#include <iostream>
#include <typeinfo>
using namespace corsika; using namespace corsika;
using namespace corsika::process; using namespace corsika::process;
using namespace corsika::units; using namespace corsika::units;
using namespace corsika::particles; using namespace corsika::particles;
using namespace corsika::random; using namespace corsika::random;
using namespace corsika::geometry;
using namespace corsika::environment;
#include <iostream>
#include <typeinfo>
using namespace std; using namespace std;
static int fCount = 0; static int fCount = 0;
...@@ -236,9 +242,12 @@ double s_rndm_(int&) { ...@@ -236,9 +242,12 @@ double s_rndm_(int&) {
return rmng() / (double)rmng.max(); return rmng() / (double)rmng.max();
} }
int main() { int main() {
Environment env;
tracking_line::TrackingLine<setup::Stack> tracking;
auto theMedium = env.GetUniverse()::CreateNode<Sphere>({Point{env.GetCS(), 0_m, 0_m, 0_m}, 100_km});
tracking_line::TrackingLine<setup::Stack> tracking(environment);
stack_inspector::StackInspector<setup::Stack> p0(true); stack_inspector::StackInspector<setup::Stack> p0(true);
ProcessSplit p1; ProcessSplit p1;
const auto sequence = p0 + p1; const auto sequence = p0 + p1;
......
...@@ -4,6 +4,7 @@ set ( ...@@ -4,6 +4,7 @@ set (
IMediumModel.h IMediumModel.h
NuclearComposition.h NuclearComposition.h
HomogeneousMedium.h HomogeneousMedium.h
Environment.h
) )
set ( set (
......
/**
* (c) Copyright 2018 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.
*/
#ifndef _include_Environment_h
#define _include_Environment_h
#include <corsika/environment/IMediumModel.h>
#include <corsika/environment/VolumeTreeNode.h>
#include <corsika/geometry/RootCoordinateSystem.h>
#include <corsika/setup/SetupEnvironment.h>
namespace corsika::environment {
class Environment {
public:
auto& GetUniverse() { return universe; }
auto const& GetCS() const { return corsika::geometry::RootCoordinateSystem::GetInstance().GetRootCS();}
private:
VolumeTreeNode<corsika::setup::IEnvironmentModel>::VTNUPtr universe;
};
} // namespace corsika::environment
#endif
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
#define _include_HomogeneousMedium_h_ #define _include_HomogeneousMedium_h_
#include <corsika/environment/NuclearComposition.h> #include <corsika/environment/NuclearComposition.h>
#include <corsika/particles/ParticleProperties.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/geometry/Trajectory.h>
#include <corsika/geometry/Line.h> #include <corsika/geometry/Line.h>
#include <corsika/geometry/Point.h> #include <corsika/geometry/Point.h>
#include <corsika/geometry/Trajectory.h>
#include <corsika/particles/ParticleProperties.h>
#include <corsika/units/PhysicalUnits.h>
/** /**
* a homogeneous medium * a homogeneous medium
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
#define _include_IMediumModel_h #define _include_IMediumModel_h
#include <corsika/environment/NuclearComposition.h> #include <corsika/environment/NuclearComposition.h>
#include <corsika/geometry/Trajectory.h>
#include <corsika/geometry/Point.h> #include <corsika/geometry/Point.h>
#include <corsika/geometry/Trajectory.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
namespace corsika::environment { namespace corsika::environment {
...@@ -14,16 +14,17 @@ namespace corsika::environment { ...@@ -14,16 +14,17 @@ namespace corsika::environment {
virtual corsika::units::si::MassDensityType GetMassDensity( virtual corsika::units::si::MassDensityType GetMassDensity(
corsika::geometry::Point const&) const = 0; corsika::geometry::Point const&) const = 0;
// todo: think about the mixin inheritance of the trajectory vs the BaseTrajectory approach // todo: think about the mixin inheritance of the trajectory vs the BaseTrajectory
// for now, only lines are supported // approach for now, only lines are supported
virtual corsika::units::si::GrammageType IntegratedGrammage( virtual corsika::units::si::GrammageType IntegratedGrammage(
corsika::geometry::Trajectory<corsika::geometry::Line> const&, corsika::units::si::TimeType) const = 0; corsika::geometry::Trajectory<corsika::geometry::Line> const&,
corsika::units::si::TimeType) const = 0;
virtual corsika::units::si::TimeType FromGrammage( virtual corsika::units::si::TimeType FromGrammage(
corsika::geometry::Trajectory<corsika::geometry::Line> const&, corsika::geometry::Trajectory<corsika::geometry::Line> const&,
corsika::units::si::GrammageType) const = 0; corsika::units::si::GrammageType) const = 0;
virtual NuclearComposition const& GetNuclearComposition() const = 0; virtual NuclearComposition const& GetNuclearComposition() const = 0;
}; };
......
...@@ -88,7 +88,8 @@ namespace corsika::environment { ...@@ -88,7 +88,8 @@ namespace corsika::environment {
static_assert(std::is_base_of_v<IModelProperties, ModelProperties>, static_assert(std::is_base_of_v<IModelProperties, ModelProperties>,
"unusable type provided"); "unusable type provided");
fModelProperties = std::make_unique<ModelProperties>(std::forward<Args>(args)...); fModelProperties = std::make_shared<ModelProperties>(std::forward<Args>(args)...);
return fModelProperties;
} }
void SetModelProperties(IMPSharedPtr ptr) { fModelProperties = ptr; } void SetModelProperties(IMPSharedPtr ptr) { fModelProperties = ptr; }
...@@ -101,7 +102,7 @@ namespace corsika::environment { ...@@ -101,7 +102,7 @@ namespace corsika::environment {
return std::make_shared<MediumType>(std::forward<Args>(args)...); return std::make_shared<MediumType>(std::forward<Args>(args)...);
} }
// factory methods for creation of nodes // factory method for creation of nodes
template <class VolumeType, typename... Args> template <class VolumeType, typename... Args>
static auto CreateNode(Args&&... args) { static auto CreateNode(Args&&... args) {
static_assert(std::is_base_of_v<corsika::geometry::Volume, VolumeType>, static_assert(std::is_base_of_v<corsika::geometry::Volume, VolumeType>,
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
#ifndef _include_corsika_setup_environment_h_ #ifndef _include_corsika_setup_environment_h_
#define _include_corsika_setup_environment_h_ #define _include_corsika_setup_environment_h_
namespace corsika {} #include <corsika/environment/IMediumModel.h>
namespace corsika::setup {
using IEnvironmentModel = corsika::environment::IMediumModel;
}
#endif #endif
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