From 36dbd945e70276bf4fa64431626897ee7091eae7 Mon Sep 17 00:00:00 2001 From: Nikos Karastathis <n.karastathis@kit.edu> Date: Mon, 25 Jan 2021 17:24:22 +0100 Subject: [PATCH] ExponentialRefractiveIndex class and inline file in correct format (cherry picked from commit 04d9d4c5bcf4997f63326e505fecce259f8cac2d) --- .../media/ExponentialRefractiveIndex.inl | 62 +++++++++---------- corsika/media/ExponentialRefractiveIndex.hpp | 17 ++--- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/corsika/detail/media/ExponentialRefractiveIndex.inl b/corsika/detail/media/ExponentialRefractiveIndex.inl index 664b47b39..ce2504872 100644 --- a/corsika/detail/media/ExponentialRefractiveIndex.inl +++ b/corsika/detail/media/ExponentialRefractiveIndex.inl @@ -1,31 +1,31 @@ -///* -// * (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 diff --git a/corsika/media/ExponentialRefractiveIndex.hpp b/corsika/media/ExponentialRefractiveIndex.hpp index 3ac778926..c5b6e4d13 100644 --- a/corsika/media/ExponentialRefractiveIndex.hpp +++ b/corsika/media/ExponentialRefractiveIndex.hpp @@ -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> -- GitLab