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
2dc06e42
Commit
2dc06e42
authored
4 years ago
by
Remy Prechelt
Browse files
Options
Downloads
Patches
Plain Diff
Add additional density checks for homogeneous medium.
parent
d2d5dfb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Environment/IRefractiveIndexModel.h
+1
-1
1 addition, 1 deletion
Environment/IRefractiveIndexModel.h
Environment/UniformRefractiveIndex.h
+1
-1
1 addition, 1 deletion
Environment/UniformRefractiveIndex.h
Environment/testEnvironment.cc
+28
-9
28 additions, 9 deletions
Environment/testEnvironment.cc
with
30 additions
and
11 deletions
Environment/IRefractiveIndexModel.h
+
1
−
1
View file @
2dc06e42
/*
* (c) Copyright 20
18
CORSIKA Project, corsika-project@lists.kit.edu
* (c) Copyright 20
20
CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
...
...
This diff is collapsed.
Click to expand it.
Environment/UniformRefractiveIndex.h
+
1
−
1
View file @
2dc06e42
/*
* (c) Copyright 20
18
CORSIKA Project, corsika-project@lists.kit.edu
* (c) Copyright 20
20
CORSIKA Project, corsika-project@lists.kit.edu
*
* See file AUTHORS for a list of contributors.
*
...
...
This diff is collapsed.
Click to expand it.
Environment/testEnvironment.cc
+
28
−
9
View file @
2dc06e42
...
...
@@ -253,7 +253,11 @@ TEST_CASE("UniformMagneticField w/ Homogeneous Medium") {
// the constant density
const
auto
density
{
19.2
_g
/
cube
(
1
_cm
)};
// the constant density
const
auto
density
{
19.2
_g
/
cube
(
1
_cm
)};
// create our atmospheric model
<<<<<<<
HEAD
<<<<<<<
HEAD
AtmModel
medium
(
B0
,
density
,
protonComposition
);
...
...
@@ -292,6 +296,9 @@ TEST_CASE("UniformMagneticField w/ Homogeneous Medium") {
REQUIRE
((
medium
.
ArclengthFromGrammage
(
trajectory
,
density
*
5
_m
)
/
5
_m
)
==
Approx
(
1
));
=======
AtmModel
medium
(
n
,
19.2
_g
/
cube
(
1
_cm
),
protonComposition
);
=======
AtmModel
medium
(
n
,
density
,
protonComposition
);
>>>>>>>
a61a703
...
Add
additional
density
checks
for
homogeneous
medium
.
// and require that it is constant
REQUIRE
(
n
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
...
...
@@ -310,6 +317,7 @@ TEST_CASE("UniformMagneticField w/ Homogeneous Medium") {
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
<<<<<<<
HEAD
>>>>>>>
12
a0be6
...
Add
test
for
SetRefractiveIndex
}
...
...
@@ -332,16 +340,18 @@ TEST_CASE("UniformRefractiveIndex w/ FlatExponential") {
// the refractive index we want returned everywhere
RefractiveIndexType
n
=
1.000327
__
;
=======
>>>>>>>
a61a703
...
Add
additional
density
checks
for
homogeneous
medium
.
// create our atmospheric model
AtmModel
medium
(
n
,
gOrigin
,
axis
,
rho0
,
lambda
,
protonComposition
);
// check the density and nuclear composition
REQUIRE
(
density
==
medium
.
GetMassDensity
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_m
)));
medium
.
GetNuclearComposition
();
// check that the returned refractive index is correct
REQUIRE
(
n
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
REQUIRE
(
n
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
REQUIRE
(
n
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
REQUIRE
(
n
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
// create a line of length 1 m
Line
const
line
(
gOrigin
,
Vector
<
SpeedType
::
dimension_type
>
(
gCS
,
{
1
_m
/
second
,
0
_m
/
second
,
0
_m
/
second
}));
<<<<<<<
HEAD
<<<<<<<
HEAD
// the refractive index we want returned everywhere
RefractiveIndexType
n
=
1.1234
__
;
...
...
@@ -375,14 +385,23 @@ TEST_CASE("UniformRefractiveIndex w/ FlatExponential") {
=======
// a new refractive index
RefractiveIndexType
n2
=
1.123456
__
;
=======
// the end time of our line
auto
const
tEnd
=
1
_s
;
>>>>>>>
a61a703
...
Add
additional
density
checks
for
homogeneous
medium
.
//
update the refractive index of this atmospheric model
medium
.
SetRefractiveIndex
(
n2
);
//
and the associated trajectory
Trajectory
<
Line
>
const
trajectory
(
line
,
tEnd
);
<<<<<<<
HEAD
// check that the returned refractive index is correct
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
-
10
_m
,
4
_m
,
35
_km
)));
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
+
210
_m
,
0
_m
,
7
_km
)));
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
0
_m
,
0
_m
,
0
_km
)));
REQUIRE
(
n2
==
medium
.
GetRefractiveIndex
(
Point
(
gCS
,
100
_km
,
400
_km
,
350
_km
)));
>>>>>>>
12
a0be6
...
Add
test
for
SetRefractiveIndex
=======
// and check the integrated grammage
REQUIRE
((
medium
.
IntegratedGrammage
(
trajectory
,
3
_m
)
/
(
density
*
3
_m
))
==
Approx
(
1
));
>>>>>>>
a61a703
...
Add
additional
density
checks
for
homogeneous
medium
.
}
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