Skip to content
Snippets Groups Projects
Commit 3715eebe authored by Timo Koch's avatar Timo Koch Committed by Ned Coltman
Browse files

[test] Add test for AABBTree-based distance field

parent 836c9de4
No related branches found
No related tags found
1 merge request!2708Add new class for calculating wall distance
add_subdirectory(boundingboxtree)
set(CMAKE_BUILD_TYPE Debug)
dumux_add_test(SOURCES test_0d1d_intersection.cc LABELS unit)
dumux_add_test(SOURCES test_0d2d_intersection.cc LABELS unit)
dumux_add_test(SOURCES test_0d3d_intersection.cc LABELS unit)
......
......@@ -139,6 +139,16 @@ void checkDistanceField(const std::vector<Geometry>& geometries,
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 << ")");
}
// checks the distances between various points with points/segments/lines
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment