IAP GITLAB

Skip to content
Snippets Groups Projects
Commit eed488ab authored by Nikos Karastathis's avatar Nikos Karastathis :ocean: Committed by Maximilian Reininghaus
Browse files

added and tested Exponential Refractive Index class in media

(cherry picked from commit be05f435)
parent 2928314e
No related branches found
No related tags found
No related merge requests found
/* ///*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu // * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* // *
* This software is distributed under the terms of the GNU General Public // * 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 // * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license. // * the license.
*/ // */
//
#pragma once //#pragma once
//
#include <bits/stdc++.h> //#include <bits/stdc++.h>
#include <corsika/media/IRefractiveIndexModel.hpp> //#include <corsika/media/IRefractiveIndexModel.hpp>
//
namespace corsika { //namespace corsika {
//
template <typename T> // template <typename T>
template <typename... Args> // template <typename... Args>
ExponentialRefractiveIndex<T>::ExponentialRefractiveIndex(double const n0, // ExponentialRefractiveIndex<T>::ExponentialRefractiveIndex(double const n0,
InverseLengthType const lambda, Args&&... args) // InverseLengthType const lambda, Args&&... args)
: T(std::forward<Args>(args)...) // : T(std::forward<Args>(args)...)
, n_0(n0) // , n_0(n0)
, lambda_(lambda) {} // , lambda_(lambda) {}
//
template <typename T> // template <typename T>
double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const { // double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const {
//TODO: THIS METHOD CURRENTLY ONLY USES THE Z-COORDINATE. // //TODO: THIS METHOD CURRENTLY ONLY USES THE Z-COORDINATE.
//NEED TO THINK IT FOR FUTURE WORK ON ARBITRARY GEOMETRIES. // //NEED TO THINK IT FOR FUTURE WORK ON ARBITRARY GEOMETRIES.
return n_0 * exp((-lambda_) * point.getCoordinates().getZ()); // return n_0 * exp((-lambda_) * point.getCoordinates().getZ());
} // }
//
} // namespace corsika //} // namespace corsika
...@@ -38,18 +38,23 @@ namespace corsika { ...@@ -38,18 +38,23 @@ namespace corsika {
*/ */
template <typename... Args> template <typename... Args>
ExponentialRefractiveIndex(double const n0, ExponentialRefractiveIndex(double const n0,
InverseLengthType const lambda, Args&&... args); InverseLengthType const lambda, Args&&... args)
: T(std::forward<Args>(args)...)
, n_0(n0)
, lambda_(lambda) {}
/** /**
* Evaluate the refractive index at a given location. * Evaluate the refractive index at a given location.
* *
* @param point The location to evaluate at. * @param point The location to evaluate at.
* @returns The refractive index at this point. * @returns The refractive index at this point.
*/ */
double getRefractiveIndex(Point const& point) const final override; double getRefractiveIndex(Point const& point) const final override
{
//TODO: THIS METHOD CURRENTLY ONLY USES THE Z-COORDINATE.
//NEED TO THINK IT FOR FUTURE WORK ON ARBITRARY GEOMETRIES.
return n_0 * exp((-lambda_) * point.getCoordinates().getZ());
}
}; // END: class ExponentialRefractiveIndex }; // END: class ExponentialRefractiveIndex
} // namespace corsika } // namespace corsika
\ No newline at end of file
#include <corsika/detail/media/ExponentialRefractiveIndex.inl>
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