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
68bbace4
Commit
68bbace4
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug concerning escape grammage in FlatExponential
parent
b5417890
No related branches found
No related tags found
2 merge requests
!96
Delete DiscreteProcess.h
,
!93
Improvements in Cascade and FlatExponential
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Environment/FlatExponential.h
+10
-3
10 additions, 3 deletions
Environment/FlatExponential.h
Environment/testEnvironment.cc
+13
-2
13 additions, 2 deletions
Environment/testEnvironment.cc
with
23 additions
and
5 deletions
Environment/FlatExponential.h
+
10
−
3
View file @
68bbace4
/*
* (c) Copyright 201
8
CORSIKA Project, corsika-project@lists.kit.edu
* (c) Copyright 201
9
CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
...
...
@@ -21,6 +20,7 @@
#include
<corsika/units/PhysicalUnits.h>
#include
<cassert>
#include
<limits>
/**
*
...
...
@@ -76,7 +76,14 @@ namespace corsika::environment {
if
(
vDotA
==
0
)
{
return
pGrammage
/
GetMassDensity
(
line
.
GetR0
());
}
else
{
return
fLambda
/
vDotA
*
log
(
pGrammage
*
vDotA
/
(
fRho0
*
fLambda
)
+
1
);
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
;
}
}
}
};
...
...
This diff is collapsed.
Click to expand it.
Environment/testEnvironment.cc
+
13
−
2
View file @
68bbace4
...
...
@@ -75,7 +75,19 @@ TEST_CASE("FlatExponential") {
REQUIRE
((
medium
.
ArclengthFromGrammage
(
trajectory
,
exact
)
/
length
)
==
Approx
(
1
));
}
SECTION
(
"vertical"
)
{
SECTION
(
"escape grammage"
)
{
Line
const
line
(
gOrigin
,
Vector
<
SpeedType
::
dimension_type
>
(
gCS
,
{
0
_m
/
second
,
0
_m
/
second
,
-
5
_m
/
second
}));
Trajectory
<
Line
>
const
trajectory
(
line
,
tEnd
);
GrammageType
const
escapeGrammage
=
rho0
*
lambda
;
REQUIRE
(
trajectory
.
NormalizedDirection
().
dot
(
axis
).
magnitude
()
<
0
);
REQUIRE
(
medium
.
ArclengthFromGrammage
(
trajectory
,
1.2
*
escapeGrammage
)
==
std
::
numeric_limits
<
typename
GrammageType
::
value_type
>::
infinity
()
*
1
_m
);
}
SECTION
(
"inclined"
)
{
Line
const
line
(
gOrigin
,
Vector
<
SpeedType
::
dimension_type
>
(
gCS
,
{
0
_m
/
second
,
5
_m
/
second
,
5
_m
/
second
}));
Trajectory
<
Line
>
const
trajectory
(
line
,
tEnd
);
...
...
@@ -83,7 +95,6 @@ TEST_CASE("FlatExponential") {
LengthType
const
length
=
2
*
lambda
;
GrammageType
const
exact
=
rho0
*
lambda
*
(
exp
(
cosTheta
*
length
/
lambda
)
-
1
)
/
cosTheta
;
REQUIRE
((
medium
.
IntegratedGrammage
(
trajectory
,
length
)
/
exact
)
==
Approx
(
1
));
REQUIRE
((
medium
.
ArclengthFromGrammage
(
trajectory
,
exact
)
/
length
)
==
Approx
(
1
));
}
...
...
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