CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
DensityFunction.hpp
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <corsika/framework/geometry/Line.hpp>
12 #include <corsika/framework/geometry/Point.hpp>
13 #include <corsika/media/LinearApproximationIntegrator.hpp>
14 
15 namespace corsika {
16 
17  template <class TDerivableRho,
18  template <typename> class TIntegrator = LinearApproximationIntegrator>
20  : public TIntegrator<DensityFunction<TDerivableRho, TIntegrator>> {
21  friend class TIntegrator<DensityFunction<TDerivableRho, TIntegrator>>;
22 
23  TDerivableRho rho_;
24 
25  public:
26  DensityFunction(TDerivableRho rho)
27  : rho_(rho) {}
28 
29  MassDensityType evaluateAt(Point const& p) const { return rho_(p); }
30  };
31 
32 } // namespace corsika
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
`, since they are used everywhere as integral part of the framework.