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
bcbe52d5
Commit
bcbe52d5
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
fixed critical bug and started documentation
parent
5cd0dc7e
No related branches found
No related tags found
1 merge request
!99
sliding planar atmosphere
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Environment/BaseExponential.h
+43
-10
43 additions, 10 deletions
Environment/BaseExponential.h
with
43 additions
and
10 deletions
Environment/BaseExponential.h
+
43
−
10
View file @
bcbe52d5
...
@@ -20,12 +20,12 @@
...
@@ -20,12 +20,12 @@
#include
<cassert>
#include
<cassert>
#include
<limits>
#include
<limits>
/**
*
*/
namespace
corsika
::
environment
{
namespace
corsika
::
environment
{
/**
* This class provides the grammage/length conversion functionality for
* (locally) flat exponential atmospheres.
*/
template
<
class
TDerived
>
template
<
class
TDerived
>
class
BaseExponential
{
class
BaseExponential
{
protected:
protected:
...
@@ -36,32 +36,65 @@ namespace corsika::environment {
...
@@ -36,32 +36,65 @@ namespace corsika::environment {
auto
const
&
GetImplementation
()
const
{
return
*
static_cast
<
TDerived
const
*>
(
this
);
}
auto
const
&
GetImplementation
()
const
{
return
*
static_cast
<
TDerived
const
*>
(
this
);
}
// clang-format off
/**
* For a (normalized) axis \f$ \vec{a} \f$, the grammage along a non-orthogonal line with (normalized)
* direction \f$ \vec{v} \f$ is given by
* \f[
* X = \frac{\varrho_0 \lambda}{\vec{v} \cdot \vec{a}} \left( \exp\left( \vec{v} \cdot \vec{a} \frac{l}{\lambda} \right) - 1 \right)
* \f], where \f$ \varrho_0 \f$ is the density at the starting point.
*
* If \f$ \vec{v} \cdot \vec{a} = 0 \f$, the calculation is just like with a homogeneous density:
* \f[
* X = \varrho_0 l;
* \f]
*/
// clang-format on
corsika
::
units
::
si
::
GrammageType
IntegratedGrammage
(
corsika
::
units
::
si
::
GrammageType
IntegratedGrammage
(
corsika
::
geometry
::
Trajectory
<
corsika
::
geometry
::
Line
>
const
&
line
,
corsika
::
geometry
::
Trajectory
<
corsika
::
geometry
::
Line
>
const
&
line
,
corsika
::
units
::
si
::
LengthType
pTo
,
corsika
::
units
::
si
::
LengthType
pTo
,
geometry
::
Vector
<
units
::
si
::
dimensionless_d
>
const
&
axis
)
const
{
geometry
::
Vector
<
units
::
si
::
dimensionless_d
>
const
&
axis
)
const
{
auto
const
vDotA
=
line
.
NormalizedDirection
().
dot
(
axis
).
magnitude
();
auto
const
vDotA
=
line
.
NormalizedDirection
().
dot
(
axis
).
magnitude
();
auto
const
rhoStart
=
GetImplementation
().
GetMassDensity
(
line
.
GetR0
());
if
(
vDotA
==
0
)
{
if
(
vDotA
==
0
)
{
return
pTo
*
GetImplementation
().
GetMassDensity
(
line
.
GetR0
())
;
return
pTo
*
rhoStart
;
}
else
{
}
else
{
return
GetImplementation
().
GetMassDensity
(
line
.
GetR0
())
*
(
fLambda
/
vDotA
)
*
return
rhoStart
*
(
fLambda
/
vDotA
)
*
(
exp
(
vDotA
*
pTo
*
fInvLambda
)
-
1
);
(
exp
(
vDotA
*
pTo
/
fLambda
)
-
1
);
}
}
}
}
// clang-format off
/**
* For a (normalized) axis \f$ \vec{a} \f$, the length of a non-orthogonal line with (normalized)
* direction \f$ \vec{v} \f$ corresponding to grammage \f$ X \f$ is given by
* \f[
* l = \begin{cases}
* \frac{\lambda}{\vec{v} \cdot \vec{a}} \log\left(Y \right), & \text{if} Y := 0 > 1 +
* \vec{v} \cdot \vec{a} \frac{X}{\rho_0 \lambda}
* \infty & \text{else,}
* \end{cases}
* \f] where \f$ \varrho_0 \f$ is the density at the starting point.
*
* If \f$ \vec{v} \cdot \vec{a} = 0 \f$, the calculation is just like with a homogeneous density:
* \f[
* l = \frac{X}{\varrho_0}
* \f]
*/
// clang-format on
corsika
::
units
::
si
::
LengthType
ArclengthFromGrammage
(
corsika
::
units
::
si
::
LengthType
ArclengthFromGrammage
(
corsika
::
geometry
::
Trajectory
<
corsika
::
geometry
::
Line
>
const
&
line
,
corsika
::
geometry
::
Trajectory
<
corsika
::
geometry
::
Line
>
const
&
line
,
corsika
::
units
::
si
::
GrammageType
pGrammage
,
corsika
::
units
::
si
::
GrammageType
pGrammage
,
geometry
::
Vector
<
units
::
si
::
dimensionless_d
>
const
&
axis
)
const
{
geometry
::
Vector
<
units
::
si
::
dimensionless_d
>
const
&
axis
)
const
{
auto
const
vDotA
=
line
.
NormalizedDirection
().
dot
(
axis
).
magnitude
();
auto
const
vDotA
=
line
.
NormalizedDirection
().
dot
(
axis
).
magnitude
();
auto
const
rhoStart
=
GetImplementation
().
GetMassDensity
(
line
.
GetR0
());
if
(
vDotA
==
0
)
{
if
(
vDotA
==
0
)
{
return
pGrammage
/
GetImplementation
().
GetMassDensity
(
line
.
GetR0
())
;
return
pGrammage
/
rhoStart
;
}
else
{
}
else
{
auto
const
logArg
=
pGrammage
*
vDotA
/
(
fRho0
*
fLambda
)
+
1
;
auto
const
logArg
=
pGrammage
*
fInvLambda
*
vDotA
/
rhoStart
+
1
;
if
(
logArg
>
0
)
{
if
(
logArg
>
0
)
{
return
fLambda
/
vDotA
*
log
(
pGrammage
*
vDotA
/
(
fRho0
*
fLambda
)
+
1
);
return
fLambda
/
vDotA
*
log
(
logArg
);
}
else
{
}
else
{
return
std
::
numeric_limits
<
typename
decltype
(
return
std
::
numeric_limits
<
typename
decltype
(
pGrammage
)
::
value_type
>::
infinity
()
*
pGrammage
)
::
value_type
>::
infinity
()
*
...
...
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