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
91194780
Commit
91194780
authored
4 years ago
by
Dominik Baack
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Several modifications to make the code more standard conform and document it
parent
d19881b5
No related branches found
No related tags found
No related merge requests found
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/media/testMedium.cpp
+17
-16
17 additions, 16 deletions
tests/media/testMedium.cpp
tests/media/testRefractiveIndex.cpp
+1
-1
1 addition, 1 deletion
tests/media/testRefractiveIndex.cpp
tests/media/testShowerAxis.cpp
+1
-1
1 addition, 1 deletion
tests/media/testShowerAxis.cpp
with
19 additions
and
18 deletions
tests/media/testMedium.cpp
+
17
−
16
View file @
91194780
...
...
@@ -16,6 +16,7 @@
#include
<corsika/media/InhomogeneousMedium.hpp>
#include
<corsika/media/NuclearComposition.hpp>
#include
<corsika/media/MediumPropertyModel.hpp>
#include
<corsika/media/MediumProperties.hpp>
#include
<catch2/catch.hpp>
...
...
@@ -25,7 +26,7 @@ using namespace corsika::units::si;
TEST_CASE
(
"MediumPropertyModel w/ Homogeneous"
)
{
CoordinateSystem
const
&
gCS
=
RootCoordinateSystem
::
G
etInstance
().
GetRootCoordinateSystem
();
RootCoordinateSystem
::
g
etInstance
().
GetRootCoordinateSystem
();
Point
const
gOrigin
(
gCS
,
{
0
_m
,
0
_m
,
0
_m
});
...
...
@@ -41,35 +42,35 @@ TEST_CASE("MediumPropertyModel w/ Homogeneous") {
std
::
vector
<
float
>
{
1.
f
});
// the refrative index that we use
const
Medium
type
=
Medium
::
AirDry1Atm
;
const
Medium
type
=
corsika
::
Medium
::
AirDry1Atm
;
// create the atmospheric model
AtmModel
medium
(
type
,
density
,
protonComposition
);
// and require that it is constant
CHECK
(
type
==
medium
.
m
edium
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
CHECK
(
type
==
medium
.
m
edium
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
CHECK
(
type
==
medium
.
m
edium
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
CHECK
(
type
==
medium
.
m
edium
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
CHECK
(
type
==
medium
.
getM
edium
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
CHECK
(
type
==
medium
.
getM
edium
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
CHECK
(
type
==
medium
.
getM
edium
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
CHECK
(
type
==
medium
.
getM
edium
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
// a new refractive index
const
Medium
type2
=
Medium
::
StandardRock
;
const
Medium
type2
=
corsika
::
Medium
::
StandardRock
;
// update the refractive index of this atmospheric model
medium
.
set
_m
edium
(
type2
);
medium
.
set
M
edium
(
type2
);
// check that the returned refractive index is correct
CHECK
(
type2
==
medium
.
m
edium
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
CHECK
(
type2
==
medium
.
m
edium
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
CHECK
(
type2
==
medium
.
m
edium
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
CHECK
(
type2
==
medium
.
m
edium
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
CHECK
(
type2
==
medium
.
getM
edium
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
CHECK
(
type2
==
medium
.
getM
edium
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
CHECK
(
type2
==
medium
.
getM
edium
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
CHECK
(
type2
==
medium
.
getM
edium
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
// define our axis vector
Vector
const
axis
(
gCS
,
QuantityVector
<
dimensionless_d
>
(
0
,
0
,
1
));
// check the density and nuclear composition
CHECK
(
density
==
medium
.
G
etMassDensity
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_m
)));
medium
.
G
etNuclearComposition
();
CHECK
(
density
==
medium
.
g
etMassDensity
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_m
)));
medium
.
g
etNuclearComposition
();
// create a line of length 1 m
Line
const
line
(
gOrigin
,
Vector
<
SpeedType
::
dimension_type
>
(
...
...
@@ -82,6 +83,6 @@ TEST_CASE("MediumPropertyModel w/ Homogeneous") {
Trajectory
<
Line
>
const
trajectory
(
line
,
tEnd
);
// and check the integrated grammage
CHECK
((
medium
.
I
ntegratedGrammage
(
trajectory
,
3
_m
)
/
(
density
*
3
_m
))
==
Approx
(
1
));
CHECK
((
medium
.
A
rclengthFromGrammage
(
trajectory
,
density
*
5
_m
)
/
5
_m
)
==
Approx
(
1
));
CHECK
((
medium
.
i
ntegratedGrammage
(
trajectory
,
3
_m
)
/
(
density
*
3
_m
))
==
Approx
(
1
));
CHECK
((
medium
.
a
rclengthFromGrammage
(
trajectory
,
density
*
5
_m
)
/
5
_m
)
==
Approx
(
1
));
}
This diff is collapsed.
Click to expand it.
tests/media/testRefractiveIndex.cpp
+
1
−
1
View file @
91194780
...
...
@@ -25,7 +25,7 @@ using namespace corsika::units::si;
TEST_CASE
(
"UniformRefractiveIndex w/ Homogeneous"
)
{
CoordinateSystem
const
&
gCS
=
RootCoordinateSystem
::
G
etInstance
().
GetRootCoordinateSystem
();
RootCoordinateSystem
::
g
etInstance
().
GetRootCoordinateSystem
();
Point
const
gOrigin
(
gCS
,
{
0
_m
,
0
_m
,
0
_m
});
...
...
This diff is collapsed.
Click to expand it.
tests/media/testShowerAxis.cpp
+
1
−
1
View file @
91194780
...
...
@@ -32,7 +32,7 @@ auto setupEnvironment(Code vTargetCode) {
const
CoordinateSystem
&
cs
=
env
->
getCoordinateSystem
();
auto
theMedium
=
Environment
<
IMediumModel
>::
C
reateNode
<
Sphere
>
(
Environment
<
IMediumModel
>::
c
reateNode
<
Sphere
>
(
Point
{
cs
,
0
_m
,
0
_m
,
0
_m
},
1
_km
*
std
::
numeric_limits
<
double
>::
infinity
());
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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