IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 49810a17 authored by Nikos Karastathis's avatar Nikos Karastathis :ocean:
Browse files

ExponentialRefractiveIndex class and inline file in correct format

parent be05f435
No related branches found
No related tags found
No related merge requests found
///*
// * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
// *
// * 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.
// */
//
//#pragma once
//
//#include <bits/stdc++.h>
//#include <corsika/media/IRefractiveIndexModel.hpp>
//
//namespace corsika {
//
// template <typename T>
// template <typename... Args>
// ExponentialRefractiveIndex<T>::ExponentialRefractiveIndex(double const n0,
// InverseLengthType const lambda, Args&&... args)
// : T(std::forward<Args>(args)...)
// , n_0(n0)
// , lambda_(lambda) {}
//
// template <typename T>
// double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const {
// //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());
// }
//
//} // namespace corsika
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* 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.
*/
#pragma once
#include <bits/stdc++.h>
#include <corsika/media/IRefractiveIndexModel.hpp>
namespace corsika {
template <typename T>
template <typename... Args>
ExponentialRefractiveIndex<T>::ExponentialRefractiveIndex(double const n0,
InverseLengthType const lambda, Args&&... args)
: T(std::forward<Args>(args)...)
, n_0(n0)
, lambda_(lambda) {}
template <typename T>
double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const {
//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());
}
} // namespace corsika
......@@ -38,23 +38,18 @@ namespace corsika {
*/
template <typename... Args>
ExponentialRefractiveIndex(double const n0,
InverseLengthType const lambda, Args&&... args)
: T(std::forward<Args>(args)...)
, n_0(n0)
, lambda_(lambda) {}
InverseLengthType const lambda, Args&&... args);
/**
* Evaluate the refractive index at a given location.
*
* @param point The location to evaluate at.
* @returns The refractive index at this point.
*/
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());
}
double getRefractiveIndex(Point const& point) const final override;
}; // END: class ExponentialRefractiveIndex
} // namespace corsika
\ No newline at end of file
} // namespace corsika
#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