Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dumux-repositories
dumux
Commits
f95c68e1
Commit
f95c68e1
authored
3 years ago
by
Timo Koch
Committed by
Ned Coltman
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[test][geometry] Only use AABB-based distance field in test
parent
2e3915d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2708
Add new class for calculating wall distance
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/geometry/test_distance.cc
+13
-25
13 additions, 25 deletions
test/geometry/test_distance.cc
with
13 additions
and
25 deletions
test/geometry/test_distance.cc
+
13
−
25
View file @
f95c68e1
...
...
@@ -38,6 +38,7 @@
#include
<dumux/geometry/distancefield.hh>
#include
<dumux/geometry/normal.hh>
#include
<dumux/io/format.hh>
#include
"transformation.hh"
// helper function to make point geometry from field vector
...
...
@@ -118,37 +119,24 @@ void checkDistanceField(const std::vector<Geometry>& geometries,
typename
Geometry
::
ctype
expectedDistance
,
int
expectedIndex
)
{
using
namespace
Dumux
;
DistanceField
<
Geometry
,
false
>
distanceFieldWithoutBoundingSpheres
(
geometries
);
const
auto
[
d
,
idx
]
=
distanceFieldWithoutBoundingSpheres
.
distanceAndIndex
(
p
);
Dumux
::
AABBDistanceField
<
Geometry
>
distanceField
(
geometries
);
const
auto
[
d
,
idx
]
=
distanceField
.
distanceAndIndex
(
p
);
if
(
Dune
::
FloatCmp
::
ne
(
d
,
expectedDistance
))
{
DUNE_THROW
(
Dune
::
InvalidStateException
,
Fmt
::
format
(
"Distance field returned wrong minimal distance. Expected {}, got {}"
,
expectedDistance
,
d
));
}
Dumux
::
Fmt
::
format
(
"Distance field returned wrong minimal distance. Expected {}, got {}"
,
expectedDistance
,
d
)
);
if
(
idx
!=
expectedIndex
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Distance field returned wrong index for minimal distance "
+
std
::
to_string
(
idx
)
+
", expected "
+
std
::
to_string
(
expectedIndex
));
DistanceField
<
Geometry
,
true
>
distanceFieldWithBoundingSpheres
(
geometries
);
const
auto
[
d2
,
idx2
]
=
distanceFieldWithBoundingSpheres
.
distanceAndIndex
(
p
);
if
(
Dune
::
FloatCmp
::
ne
(
d
,
d2
)
||
idx
!=
idx2
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Distance field using bounding spheres does"
"not return same result as without bounding spheres"
);
AABBDistanceField
<
Geometry
>
distanceFieldAABB
(
geometries
);
const
auto
[
d3
,
idx3
]
=
distanceFieldAABB
.
distanceAndIndex
(
p
);
if
(
Dune
::
FloatCmp
::
ne
(
d
,
d3
)
||
idx
!=
idx3
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Distance field using AABB tree does"
"not return same result as other distance fields -> "
"expected ("
<<
d
<<
", "
<<
idx
<<
") got ("
<<
d3
<<
", "
<<
idx3
<<
")"
);
Dumux
::
Fmt
::
format
(
"Distance field returned wrong index for minimal distance. Expected {}, got {}"
,
expectedIndex
,
idx
)
);
}
// checks the distances between various points with points/segments/lines
...
...
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