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
f90cdda1
Commit
f90cdda1
authored
2 years ago
by
Alan Coleman
Committed by
Maximilian Reininghaus
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue 550, added unit tests to catch this
parent
7c39aa10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!470
Wrong configuration of electromagnetic models in examples
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/media/FlatExponential.inl
+1
-1
1 addition, 1 deletion
corsika/detail/media/FlatExponential.inl
tests/media/testEnvironment.cpp
+12
-0
12 additions, 0 deletions
tests/media/testEnvironment.cpp
with
13 additions
and
1 deletion
corsika/detail/media/FlatExponential.inl
+
1
−
1
View file @
f90cdda1
...
...
@@ -29,7 +29,7 @@ namespace corsika {
template
<
typename
T
>
inline
MassDensityType
FlatExponential
<
T
>::
getMassDensity
(
Point
const
&
point
)
const
{
return
BaseExponential
<
FlatExponential
<
T
>>::
getMassDensity
(
(
point
-
BaseExponential
<
FlatExponential
<
T
>>::
getAnchorPoint
()).
getNorm
(
));
(
point
-
BaseExponential
<
FlatExponential
<
T
>>::
getAnchorPoint
()).
dot
(
axis_
));
}
template
<
typename
T
>
...
...
This diff is collapsed.
Click to expand it.
tests/media/testEnvironment.cpp
+
12
−
0
View file @
f90cdda1
...
...
@@ -101,11 +101,19 @@ TEST_CASE("FlatExponential") {
LengthType
const
length
=
2
_m
;
TimeType
const
tEnd
=
length
/
speed
;
CHECK
((
medium
.
getMassDensity
(
gOrigin
))
==
rho0
);
CHECK
(
medium
.
getNuclearComposition
().
getFractions
()
==
std
::
vector
<
double
>
{
1.
});
CHECK
(
medium
.
getNuclearComposition
().
getComponents
()
==
std
::
vector
<
Code
>
{
Code
::
Proton
});
SECTION
(
"horizontal"
)
{
//Check that not moving along axis does not change density
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
1
_m
,
0
_m
,
0
_m
))
==
rho0
);
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
1
_m
,
0
_m
,
0
_m
))
==
rho0
);
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
-
1
_m
,
0
_m
,
0
_m
))
==
rho0
);
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
0
_m
,
1
_m
,
0
_m
))
==
rho0
);
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
0
_m
,
-
1
_m
,
0
_m
))
==
rho0
);
Line
const
line
(
gOrigin
,
Vector
<
SpeedType
::
dimension_type
>
(
gCS
,
{
speed
,
0
_m
/
second
,
0
_m
/
second
}));
setup
::
Trajectory
const
trajectory
=
...
...
@@ -117,6 +125,10 @@ TEST_CASE("FlatExponential") {
}
SECTION
(
"vertical"
)
{
//Moving along axis does change density
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
0
_m
,
0
_m
,
1
_m
))
>
rho0
);
CHECK
(
medium
.
getMassDensity
(
Point
(
gCS
,
0
_m
,
0
_m
,
-
1
_m
))
<
rho0
);
Line
const
line
(
gOrigin
,
Vector
<
SpeedType
::
dimension_type
>
(
gCS
,
{
0
_m
/
second
,
0
_m
/
second
,
speed
}));
setup
::
Trajectory
const
trajectory
=
...
...
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