IAP GITLAB

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

first steps

parent f097f4f8
No related branches found
No related tags found
No related merge requests found
...@@ -26,10 +26,11 @@ namespace corsika::environment { ...@@ -26,10 +26,11 @@ namespace corsika::environment {
* This class provides the grammage/length conversion functionality for * This class provides the grammage/length conversion functionality for
* (locally) flat exponential atmospheres. * (locally) flat exponential atmospheres.
*/ */
template <class TDerived> template <class TDerived>
class BaseExponential { class BaseExponential {
protected: protected:
corsika::units::si::MassDensityType const fRho0; units::si::MassDensityType const fRho0;
units::si::LengthType const fLambda; units::si::LengthType const fLambda;
units::si::InverseLengthType const fInvLambda; units::si::InverseLengthType const fInvLambda;
geometry::Point const fP0; geometry::Point const fP0;
...@@ -50,9 +51,9 @@ namespace corsika::environment { ...@@ -50,9 +51,9 @@ namespace corsika::environment {
* \f] * \f]
*/ */
// clang-format on // clang-format on
corsika::units::si::GrammageType IntegratedGrammage( units::si::GrammageType IntegratedGrammage(
corsika::geometry::Trajectory<corsika::geometry::Line> const& line, geometry::Trajectory<geometry::Line> const& line,
corsika::units::si::LengthType pTo, units::si::LengthType pTo,
geometry::Vector<units::si::dimensionless_d> const& axis) const { geometry::Vector<units::si::dimensionless_d> const& axis) const {
auto const vDotA = line.NormalizedDirection().dot(axis).magnitude(); auto const vDotA = line.NormalizedDirection().dot(axis).magnitude();
auto const rhoStart = GetImplementation().GetMassDensity(line.GetR0()); auto const rhoStart = GetImplementation().GetMassDensity(line.GetR0());
...@@ -82,9 +83,9 @@ namespace corsika::environment { ...@@ -82,9 +83,9 @@ namespace corsika::environment {
* \f] * \f]
*/ */
// clang-format on // clang-format on
corsika::units::si::LengthType ArclengthFromGrammage( units::si::LengthType ArclengthFromGrammage(
corsika::geometry::Trajectory<corsika::geometry::Line> const& line, geometry::Trajectory<corsika::geometry::Line> const& line,
corsika::units::si::GrammageType pGrammage, units::si::GrammageType pGrammage,
geometry::Vector<units::si::dimensionless_d> const& axis) const { geometry::Vector<units::si::dimensionless_d> const& axis) const {
auto const vDotA = line.NormalizedDirection().dot(axis).magnitude(); auto const vDotA = line.NormalizedDirection().dot(axis).magnitude();
auto const rhoStart = GetImplementation().GetMassDensity(line.GetR0()); auto const rhoStart = GetImplementation().GetMassDensity(line.GetR0());
...@@ -96,9 +97,8 @@ namespace corsika::environment { ...@@ -96,9 +97,8 @@ namespace corsika::environment {
if (logArg > 0) { if (logArg > 0) {
return fLambda / vDotA * log(logArg); return fLambda / vDotA * log(logArg);
} else { } else {
return std::numeric_limits<typename decltype( return std::numeric_limits<units::si::GrammageType::value_type>::infinity() *
pGrammage)::value_type>::infinity() * units::si::meter;
corsika::units::si::meter;
} }
} }
} }
......
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