IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
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
Model registry
Operate
Environments
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
Air Shower Physics
corsika
Commits
a2b61412
Commit
a2b61412
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
sliding planar exponential atmosphere
parent
ed38f9de
No related branches found
No related tags found
1 merge request
!99
sliding planar atmosphere
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Environment/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Environment/CMakeLists.txt
Environment/SlidingPlanarExponential.h
+98
-0
98 additions, 0 deletions
Environment/SlidingPlanarExponential.h
with
99 additions
and
0 deletions
Environment/CMakeLists.txt
+
1
−
0
View file @
a2b61412
...
...
@@ -10,6 +10,7 @@ set (
DensityFunction.h
Environment.h
FlatExponential.h
SlidingPlanarExponential.h
)
set
(
...
...
This diff is collapsed.
Click to expand it.
Environment/SlidingPlanarExponential.h
0 → 100644
+
98
−
0
View file @
a2b61412
/*
* (c) Copyright 2019 CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
* 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.
*/
#ifndef _include_Environment_SlidingPlanarExponential_h_
#define _include_Environment_SlidingPlanarExponential_h_
#include
<corsika/environment/NuclearComposition.h>
#include
<corsika/geometry/Line.h>
#include
<corsika/environment/FlatExponential.h>
#include
<corsika/geometry/Point.h>
#include
<corsika/geometry/Trajectory.h>
#include
<corsika/particles/ParticleProperties.h>
#include
<corsika/random/RNGManager.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<cassert>
#include
<limits>
/**
*
*/
namespace
corsika
::
environment
{
template
<
class
T
>
class
SlidingPlanarExponential
:
public
T
{
corsika
::
units
::
si
::
MassDensityType
const
fRho0
;
units
::
si
::
LengthType
const
fLambda
;
units
::
si
::
InverseLengthType
const
fInvLambda
;
NuclearComposition
const
fNuclComp
;
geometry
::
Vector
<
units
::
si
::
dimensionless_d
>
const
fAxis
;
geometry
::
Point
const
fP0
;
public:
SlidingPlanarExponential
(
geometry
::
Point
const
&
p0
,
geometry
::
Vector
<
units
::
si
::
dimensionless_d
>
const
&
axis
,
units
::
si
::
MassDensityType
rho
,
units
::
si
::
LengthType
lambda
,
NuclearComposition
pNuclComp
)
:
fRho0
(
rho
)
,
fLambda
(
lambda
)
,
fInvLambda
(
1
/
lambda
)
,
fNuclComp
(
pNuclComp
)
,
fAxis
(
axis
)
,
fP0
(
p0
)
{}
corsika
::
units
::
si
::
MassDensityType
GetMassDensity
(
corsika
::
geometry
::
Point
const
&
p
)
const
override
{
auto
const
height
=
(
p
-
fP0
).
norm
();
return
fRho0
*
exp
(
fInvLambda
*
height
);
}
NuclearComposition
const
&
GetNuclearComposition
()
const
override
{
return
fNuclComp
;
}
corsika
::
units
::
si
::
GrammageType
IntegratedGrammage
(
corsika
::
geometry
::
Trajectory
<
corsika
::
geometry
::
Line
>
const
&
line
,
corsika
::
units
::
si
::
LengthType
pTo
)
const
override
{
auto
const
axis
=
(
fP0
-
line
.
GetR0
()).
normalized
();
auto
const
vDotA
=
line
.
NormalizedDirection
().
dot
(
fAxis
).
magnitude
();
if
(
vDotA
==
0
)
{
return
pTo
*
GetMassDensity
(
line
.
GetR0
());
}
else
{
return
GetMassDensity
(
line
.
GetR0
())
*
(
fLambda
/
vDotA
)
*
(
exp
(
vDotA
*
pTo
/
fLambda
)
-
1
);
}
}
corsika
::
units
::
si
::
LengthType
ArclengthFromGrammage
(
corsika
::
geometry
::
Trajectory
<
corsika
::
geometry
::
Line
>
const
&
line
,
corsika
::
units
::
si
::
GrammageType
pGrammage
)
const
override
{
auto
const
axis
=
(
fP0
-
line
.
GetR0
()).
normalized
();
auto
const
vDotA
=
line
.
NormalizedDirection
().
dot
(
fAxis
).
magnitude
();
if
(
vDotA
==
0
)
{
return
pGrammage
/
GetMassDensity
(
line
.
GetR0
());
}
else
{
auto
const
logArg
=
pGrammage
*
vDotA
/
(
fRho0
*
fLambda
)
+
1
;
if
(
logArg
>
0
)
{
return
fLambda
/
vDotA
*
log
(
pGrammage
*
vDotA
/
(
fRho0
*
fLambda
)
+
1
);
}
else
{
return
std
::
numeric_limits
<
typename
decltype
(
pGrammage
)
::
value_type
>::
infinity
()
*
corsika
::
units
::
si
::
meter
;
}
}
}
};
}
// namespace corsika::environment
#endif
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