IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pranav Sampathkumar
corsika
Commits
49810a17
Commit
49810a17
authored
4 years ago
by
Nikos Karastathis
Browse files
Options
Downloads
Patches
Plain Diff
ExponentialRefractiveIndex class and inline file in correct format
parent
be05f435
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/media/ExponentialRefractiveIndex.inl
+31
-31
31 additions, 31 deletions
corsika/detail/media/ExponentialRefractiveIndex.inl
corsika/media/ExponentialRefractiveIndex.hpp
+6
-11
6 additions, 11 deletions
corsika/media/ExponentialRefractiveIndex.hpp
with
37 additions
and
42 deletions
corsika/detail/media/ExponentialRefractiveIndex.inl
+
31
−
31
View file @
49810a17
//
/*
//
* (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
This diff is collapsed.
Click to expand it.
corsika/media/ExponentialRefractiveIndex.hpp
+
6
−
11
View file @
49810a17
...
...
@@ -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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment