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
32b3e5aa
Commit
32b3e5aa
authored
3 years ago
by
ralfulrich
Committed by
Ralf Ulrich
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
coverage
parent
8ec7cd96
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/framework/testGeometry.cpp
+10
-2
10 additions, 2 deletions
tests/framework/testGeometry.cpp
tests/modules/testTracking.cpp
+2
-0
2 additions, 0 deletions
tests/modules/testTracking.cpp
with
12 additions
and
2 deletions
tests/framework/testGeometry.cpp
+
10
−
2
View file @
32b3e5aa
...
@@ -101,6 +101,10 @@ TEST_CASE("Geometry CoordinateSystems") {
...
@@ -101,6 +101,10 @@ TEST_CASE("Geometry CoordinateSystems") {
// vector norm invariant under rotation
// vector norm invariant under rotation
CHECK
(
v1
.
getComponents
(
rotatedCS
).
getNorm
().
magnitude
()
==
CHECK
(
v1
.
getComponents
(
rotatedCS
).
getNorm
().
magnitude
()
==
Approx
(
v1
.
getComponents
(
rootCS
).
getNorm
().
magnitude
()));
Approx
(
v1
.
getComponents
(
rootCS
).
getNorm
().
magnitude
()));
// this is not possible
QuantityVector
<
length_d
>
const
axis_invalid
{
0
_m
,
0
_m
,
0
_km
};
CHECK_THROWS
(
make_rotation
(
rootCS
,
axis_invalid
,
angle
));
}
}
SECTION
(
"multiple rotations"
)
{
SECTION
(
"multiple rotations"
)
{
...
@@ -201,6 +205,10 @@ TEST_CASE("Geometry CoordinateSystem-hirarchy") {
...
@@ -201,6 +205,10 @@ TEST_CASE("Geometry CoordinateSystem-hirarchy") {
CoordinateSystemPtr
root
=
get_root_CoordinateSystem
();
CoordinateSystemPtr
root
=
get_root_CoordinateSystem
();
Point
const
p1
(
root
,
{
0
_m
,
0
_m
,
0
_m
});
// the origin of the root CS
Point
const
p1
(
root
,
{
0
_m
,
0
_m
,
0
_m
});
// the origin of the root CS
CHECK
(
p1
.
getX
(
root
)
==
0
_m
);
CHECK
(
p1
.
getY
(
root
)
==
0
_m
);
CHECK
(
p1
.
getZ
(
root
)
==
0
_m
);
// root -> cs2
// root -> cs2
CoordinateSystemPtr
cs2
=
make_translation
(
root
,
{
0
_m
,
0
_m
,
1
_m
});
CoordinateSystemPtr
cs2
=
make_translation
(
root
,
{
0
_m
,
0
_m
,
1
_m
});
Point
const
p2
(
cs2
,
{
0
_m
,
0
_m
,
-
1
_m
});
Point
const
p2
(
cs2
,
{
0
_m
,
0
_m
,
-
1
_m
});
...
@@ -280,6 +288,8 @@ TEST_CASE("Geometry Trajectories") {
...
@@ -280,6 +288,8 @@ TEST_CASE("Geometry Trajectories") {
.
getNorm
()
.
getNorm
()
.
magnitude
()
==
Approx
(
0
).
margin
(
absMargin
));
.
magnitude
()
==
Approx
(
0
).
margin
(
absMargin
));
CHECK
((
line
.
getTimeFromArclength
(
10
_m
)
/
(
10
_m
/
v0
.
getNorm
())
==
Approx
(
1
)));
auto
const
t
=
1
_s
;
auto
const
t
=
1
_s
;
StraightTrajectory
base
(
line
,
t
);
StraightTrajectory
base
(
line
,
t
);
CHECK
(
line
.
getPosition
(
t
).
getCoordinates
()
==
base
.
getPosition
(
1.
).
getCoordinates
());
CHECK
(
line
.
getPosition
(
t
).
getCoordinates
()
==
base
.
getPosition
(
1.
).
getCoordinates
());
...
@@ -348,8 +358,6 @@ TEST_CASE("Distance between points") {
...
@@ -348,8 +358,6 @@ TEST_CASE("Distance between points") {
CHECK
(
distance
(
p5
,
p6
)
/
1
_m
==
Approx
(
1
));
CHECK
(
distance
(
p5
,
p6
)
/
1
_m
==
Approx
(
1
));
}
}
TEST_CASE
(
"Geometry Tree"
)
{}
TEST_CASE
(
"Path"
)
{
TEST_CASE
(
"Path"
)
{
// define a known CS
// define a known CS
CoordinateSystemPtr
root
=
get_root_CoordinateSystem
();
CoordinateSystemPtr
root
=
get_root_CoordinateSystem
();
...
...
This diff is collapsed.
Click to expand it.
tests/modules/testTracking.cpp
+
2
−
0
View file @
32b3e5aa
...
@@ -186,6 +186,7 @@ TEMPLATE_TEST_CASE("Tracking", "tracking", tracking_leapfrog_curved::Tracking,
...
@@ -186,6 +186,7 @@ TEMPLATE_TEST_CASE("Tracking", "tracking", tracking_leapfrog_curved::Tracking,
particle
.
setNode
(
nextVol
);
particle
.
setNode
(
nextVol
);
particle
.
setPosition
(
traj
.
getPosition
(
1
));
particle
.
setPosition
(
traj
.
getPosition
(
1
));
particle
.
setMomentum
(
traj
.
getDirection
(
1
)
*
particle
.
getMomentum
().
getNorm
());
particle
.
setMomentum
(
traj
.
getDirection
(
1
)
*
particle
.
getMomentum
().
getNorm
());
SpeedType
const
speed_0
=
particle
.
getVelocity
().
getNorm
();
if
(
outer
)
{
if
(
outer
)
{
// now we know we are in target volume, depending on "outer"
// now we know we are in target volume, depending on "outer"
CHECK
(
traj
.
getLength
(
1
)
/
1
_m
==
Approx
(
0
).
margin
(
1e-3
));
CHECK
(
traj
.
getLength
(
1
)
/
1
_m
==
Approx
(
0
).
margin
(
1e-3
));
...
@@ -211,6 +212,7 @@ TEMPLATE_TEST_CASE("Tracking", "tracking", tracking_leapfrog_curved::Tracking,
...
@@ -211,6 +212,7 @@ TEMPLATE_TEST_CASE("Tracking", "tracking", tracking_leapfrog_curved::Tracking,
particle
.
getMomentum
().
getNorm
(),
particle
.
getMomentum
().
getNorm
(),
particle
.
getVelocity
().
getNorm
(),
traj2
.
getLength
(
1
),
particle
.
getVelocity
().
getNorm
(),
traj2
.
getLength
(
1
),
traj2
.
getLength
(
1
)
/
particle
.
getVelocity
().
getNorm
());
traj2
.
getLength
(
1
)
/
particle
.
getVelocity
().
getNorm
());
CHECK
(
speed_0
/
traj2
.
getVelocity
(
1
).
getNorm
()
==
Approx
(
1
));
}
}
CHECK_FALSE
(
hit_2nd_behind
);
// this can never happen
CHECK_FALSE
(
hit_2nd_behind
);
// this can never happen
// the next line is maybe an actual BUG: this should be investigated and eventually
// the next line is maybe an actual BUG: this should be investigated and eventually
...
...
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