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
36a1be21
Commit
36a1be21
authored
4 years ago
by
Remy Prechelt
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Port over inhomogenous medium.
parent
2c9e97b8
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/InhomogeneousMedium.inl
+50
-0
50 additions, 0 deletions
corsika/detail/media/InhomogeneousMedium.inl
corsika/media/InhomogeneousMedium.hpp
+17
-28
17 additions, 28 deletions
corsika/media/InhomogeneousMedium.hpp
with
67 additions
and
28 deletions
corsika/detail/media/InhomogeneousMedium.inl
0 → 100644
+
50
−
0
View file @
36a1be21
/*
* (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
<corsika/framework/core/PhysicalUnits.hpp>
#include
<corsika/framework/geometry/Line.hpp>
#include
<corsika/framework/geometry/Point.hpp>
#include
<corsika/framework/geometry/Trajectory.hpp>
#include
<corsika/media/NuclearComposition.hpp>
namespace
corsika
{
template
<
typename
T
,
typename
TDensityFunction
>
template
<
typename
...
TArgs
>
InhomogeneousMedium
<
T
,
TDensityFunction
>::
InhomogeneousMedium
(
NuclearComposition
nuclComp
,
TArgs
&&
...
rhoTArgs
)
:
nuclComp_
(
nuclComp
)
,
densityFunction_
(
rhoTArgs
...){}
template
<
typename
T
,
typename
TDensityFunction
>
units
::
si
::
MassDensityType
InhomogeneousMedium
<
T
,
TDensityFunction
>::
getMassDensity
(
Point
const
&
point
)
const
{
return
densityFunction_
.
evaluateAt
(
point
);
}
template
<
typename
T
,
typename
TDensityFunction
>
NuclearComposition
const
&
InhomogeneousMedium
<
T
,
TDensityFunction
>::
getNuclearComposition
()
const
{
return
nuclComp_
;
}
template
<
typename
T
,
typename
TDensityFunction
>
units
::
si
::
GrammageType
InhomogeneousMedium
<
T
,
TDensityFunction
>::
integratedGrammage
(
Trajectory
<
Line
>
const
&
line
,
units
::
si
::
LengthType
to
)
const
{
return
densityFunction_
.
integrateGrammage
(
line
,
to
);
}
template
<
typename
T
,
typename
TDensityFunction
>
units
::
si
::
LengthType
InhomogeneousMedium
<
T
,
TDensityFunction
>::
arclengthFromGrammage
(
Trajectory
<
Line
>
const
&
line
,
units
::
si
::
GrammageType
grammage
)
const
{
return
densityFunction_
.
arclengthFromGrammage
(
line
,
grammage
);
}
}
// namespace corsika
This diff is collapsed.
Click to expand it.
corsika/media/InhomogeneousMedium.hpp
+
17
−
28
View file @
36a1be21
...
@@ -8,12 +8,10 @@
...
@@ -8,12 +8,10 @@
#pragma once
#pragma once
#include
<corsika/framework/core/ParticleProperties.hpp>
#include
<corsika/framework/core/PhysicalUnits.hpp>
#include
<corsika/framework/core/PhysicalUnits.hpp>
#include
<corsika/framework/geometry/Line.hpp>
#include
<corsika/framework/geometry/Line.hpp>
#include
<corsika/framework/geometry/Point.hpp>
#include
<corsika/framework/geometry/Point.hpp>
#include
<corsika/framework/geometry/Trajectory.hpp>
#include
<corsika/framework/geometry/Trajectory.hpp>
#include
<corsika/framework/random/RNGManager.hpp>
#include
<corsika/media/NuclearComposition.hpp>
#include
<corsika/media/NuclearComposition.hpp>
/**
/**
...
@@ -23,35 +21,26 @@
...
@@ -23,35 +21,26 @@
namespace
corsika
{
namespace
corsika
{
template
<
class
T
,
class
TDensityFunction
>
template
<
typename
T
,
typename
TDensityFunction
>
class
InhomogeneousMedium
:
public
T
{
class
InhomogeneousMedium
:
public
T
{
NuclearComposition
const
fN
uclComp
;
NuclearComposition
const
n
uclComp
_
;
TDensityFunction
const
fD
ensityFunction
;
TDensityFunction
const
d
ensityFunction
_
;
public:
public:
/*
template
<
typename
...
TArgs
>
* FIXME: should have traits here for ...Args
InhomogeneousMedium
(
NuclearComposition
nuclComp
,
TArgs
&&
...
rhoTArgs
);
*/
template
<
typename
...
Args
>
units
::
si
::
MassDensityType
getMassDensity
(
Point
const
&
point
)
const
override
;
InhomogeneousMedium
(
NuclearComposition
pNuclComp
,
Args
&&
...
rhoArgs
)
:
fNuclComp
(
pNuclComp
)
NuclearComposition
const
&
getNuclearComposition
()
const
override
;
,
fDensityFunction
(
rhoArgs
...)
{}
units
::
si
::
GrammageType
integratedGrammage
(
Trajectory
<
Line
>
const
&
line
,
MassDensityType
GetMassDensity
(
Point
const
&
p
)
const
override
{
units
::
si
::
LengthType
to
)
const
override
;
return
fDensityFunction
.
EvaluateAt
(
p
);
}
units
::
si
::
LengthType
arclengthFromGrammage
(
Trajectory
<
Line
>
const
&
pLine
,
units
::
si
::
GrammageType
grammage
)
const
override
;
NuclearComposition
const
&
GetNuclearComposition
()
const
override
{
return
fNuclComp
;
}
GrammageType
IntegratedGrammage
(
Trajectory
<
Line
>
const
&
pLine
,
LengthType
pTo
)
const
override
{
return
fDensityFunction
.
IntegrateGrammage
(
pLine
,
pTo
);
}
LengthType
ArclengthFromGrammage
(
Trajectory
<
Line
>
const
&
pLine
,
GrammageType
pGrammage
)
const
override
{
return
fDensityFunction
.
ArclengthFromGrammage
(
pLine
,
pGrammage
);
}
};
};
}
// namespace corsika
}
// namespace corsika
#include
<corsika/detail/media/InhomogeneousMedium.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