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
aa1c3660
Commit
aa1c3660
authored
5 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
fixed numerical issues in SlidingPlanarAtmosphere
parent
2fe23698
No related branches found
No related tags found
1 merge request
!171
Layered atmosphere builder
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Environment/Convenience.cpp
+12
-7
12 additions, 7 deletions
Environment/Convenience.cpp
Environment/Convenience.h
+1
-0
1 addition, 0 deletions
Environment/Convenience.h
Environment/SlidingPlanarExponential.h
+18
-16
18 additions, 16 deletions
Environment/SlidingPlanarExponential.h
with
31 additions
and
23 deletions
Environment/Convenience.cpp
+
12
−
7
View file @
aa1c3660
...
...
@@ -36,10 +36,11 @@ void LayeredSphericalAtmosphereBuilder::addExponentialLayer(
auto
node
=
std
::
make_unique
<
VolumeTreeNode
<
IMediumModel
>>
(
std
::
make_unique
<
geometry
::
Sphere
>
(
center_
,
radius
));
auto
const
rho0
=
b
/
c
*
exp
(
seaLevel_
/
c
);
auto
const
rho0
=
b
/
c
;
std
::
cout
<<
"rho0 = "
<<
rho0
<<
", c = "
<<
c
<<
std
::
endl
;
node
->
SetModelProperties
<
SlidingPlanarExponential
<
IMediumModel
>>
(
center_
,
rho0
,
-
c
,
*
composition_
);
node
->
SetModelProperties
<
SlidingPlanarExponential
<
IMediumModel
>>
(
center_
,
rho0
,
-
c
,
*
composition_
,
seaLevel_
);
layers_
.
push
(
std
::
move
(
node
));
}
...
...
@@ -55,6 +56,8 @@ void LayeredSphericalAtmosphereBuilder::addLinearLayer(
units
::
si
::
GrammageType
constexpr
b
=
1
*
1
_g
/
(
1
_cm
*
1
_cm
);
auto
const
rho0
=
b
/
c
;
std
::
cout
<<
"rho0 = "
<<
rho0
;
auto
node
=
std
::
make_unique
<
VolumeTreeNode
<
environment
::
IMediumModel
>>
(
std
::
make_unique
<
geometry
::
Sphere
>
(
center_
,
radius
));
node
->
SetModelProperties
<
HomogeneousMedium
<
IMediumModel
>>
(
rho0
,
*
composition_
);
...
...
@@ -63,9 +66,13 @@ void LayeredSphericalAtmosphereBuilder::addLinearLayer(
}
Environment
<
IMediumModel
>
LayeredSphericalAtmosphereBuilder
::
assemble
()
{
Environment
<
IMediumModel
>
environment_
;
Environment
<
IMediumModel
>
env
;
assemble
(
env
);
return
env
;
}
auto
&
universe
=
environment_
.
GetUniverse
();
void
LayeredSphericalAtmosphereBuilder
::
assemble
(
Environment
<
IMediumModel
>&
env
)
{
auto
&
universe
=
env
.
GetUniverse
();
auto
*
outmost
=
universe
.
get
();
while
(
!
layers_
.
empty
())
{
...
...
@@ -75,6 +82,4 @@ Environment<IMediumModel> LayeredSphericalAtmosphereBuilder::assemble() {
layers_
.
pop
();
outmost
=
tmp
;
}
return
environment_
;
}
This diff is collapsed.
Click to expand it.
Environment/Convenience.h
+
1
−
0
View file @
aa1c3660
...
...
@@ -48,6 +48,7 @@ namespace corsika::environment {
void
addLinearLayer
(
units
::
si
::
LengthType
,
units
::
si
::
LengthType
);
void
assemble
(
Environment
<
IMediumModel
>&
);
Environment
<
IMediumModel
>
assemble
();
};
...
...
This diff is collapsed.
Click to expand it.
Environment/SlidingPlanarExponential.h
+
18
−
16
View file @
aa1c3660
...
...
@@ -38,36 +38,38 @@ namespace corsika::environment {
template
<
class
T
>
class
SlidingPlanarExponential
:
public
BaseExponential
<
SlidingPlanarExponential
<
T
>>
,
public
T
{
NuclearComposition
const
fNuclComp
;
NuclearComposition
const
nuclComp_
;
units
::
si
::
LengthType
const
referenceHeight_
;
using
Base
=
BaseExponential
<
SlidingPlanarExponential
<
T
>>
;
public:
SlidingPlanarExponential
(
geometry
::
Point
const
&
vP0
,
units
::
si
::
MassDensityType
vRho
,
units
::
si
::
LengthType
vLambda
,
NuclearComposition
vNuclComp
)
:
Base
(
vP0
,
vRho
,
vLambda
)
,
fNuclComp
(
vNuclComp
)
{}
SlidingPlanarExponential
(
geometry
::
Point
const
&
p0
,
units
::
si
::
MassDensityType
rho0
,
units
::
si
::
LengthType
lambda
,
NuclearComposition
nuclComp
,
units
::
si
::
LengthType
referenceHeight
=
units
::
si
::
LengthType
::
zero
())
:
Base
(
p0
,
rho0
,
lambda
)
,
nuclComp_
(
nuclComp
),
referenceHeight_
(
referenceHeight
)
{}
units
::
si
::
MassDensityType
GetMassDensity
(
geometry
::
Point
const
&
vP
)
const
override
{
auto
const
height
=
(
vP
-
Base
::
fP0
).
norm
();
geometry
::
Point
const
&
p
)
const
override
{
auto
const
height
=
(
p
-
Base
::
fP0
).
norm
()
-
referenceHeight_
;
return
Base
::
fRho0
*
exp
(
Base
::
fInvLambda
*
height
);
}
NuclearComposition
const
&
GetNuclearComposition
()
const
override
{
return
fN
uclComp
;
}
NuclearComposition
const
&
GetNuclearComposition
()
const
override
{
return
n
uclComp
_
;
}
units
::
si
::
GrammageType
IntegratedGrammage
(
geometry
::
Trajectory
<
geometry
::
Line
>
const
&
vL
ine
,
units
::
si
::
LengthType
vL
)
const
override
{
auto
const
axis
=
(
vL
ine
.
GetR0
()
-
Base
::
fP0
).
normalized
();
return
Base
::
IntegratedGrammage
(
vL
ine
,
vL
,
axis
);
geometry
::
Trajectory
<
geometry
::
Line
>
const
&
l
ine
,
units
::
si
::
LengthType
l
)
const
override
{
auto
const
axis
=
(
l
ine
.
GetR0
()
-
Base
::
fP0
).
normalized
();
return
Base
::
IntegratedGrammage
(
l
ine
,
l
,
axis
);
}
units
::
si
::
LengthType
ArclengthFromGrammage
(
geometry
::
Trajectory
<
geometry
::
Line
>
const
&
vL
ine
,
units
::
si
::
GrammageType
vG
rammage
)
const
override
{
auto
const
axis
=
(
vL
ine
.
GetR0
()
-
Base
::
fP0
).
normalized
();
return
Base
::
ArclengthFromGrammage
(
vL
ine
,
vG
rammage
,
axis
);
geometry
::
Trajectory
<
geometry
::
Line
>
const
&
l
ine
,
units
::
si
::
GrammageType
g
rammage
)
const
override
{
auto
const
axis
=
(
l
ine
.
GetR0
()
-
Base
::
fP0
).
normalized
();
return
Base
::
ArclengthFromGrammage
(
l
ine
,
g
rammage
,
axis
);
}
};
...
...
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