Skip to content
Snippets Groups Projects
Commit d5c08d97 authored by Robert K's avatar Robert K
Browse files

[bugfix][LevelIntersectionIterator] added exception for level>0 because

that case is simply not implemented.
parent a16b2e09
No related branches found
No related tags found
No related merge requests found
......@@ -389,7 +389,15 @@ public:
template <class EntityImp>
LevelIntersectionIteratorWrapper(const GridImp& grid, const EntityImp & en, int wLevel , bool end )
: intersection_( IntersectionImp( grid, en, wLevel, end ) )
{}
{
if( wLevel > 0 && grid.conformingRefinement() )
{
// conceptually the level intersection iterator does not work for
// bisection type grids, only on the macro level. Therefore,
// an exception is thrown here
DUNE_THROW( NotImplemented, "LevelIntersectionIterator does not work for bisection refinement type grids on higher levels!");
}
}
//! The copy constructor
LevelIntersectionIteratorWrapper(const ThisType & org)
......
......@@ -2,6 +2,7 @@ set(TESTS
test-alugrid
test-adaptivity
test-fromtogridfactory
test-iterators
test-structuredgridfactory
test-twists
test-hierarchic
......@@ -10,7 +11,6 @@ set(TESTS
test-gmsh
)
# test-iterators
foreach(TEST ${TESTS})
dune_add_test(NAME ${TEST} SOURCES ${TEST}.cc LINK_LIBRARIES dunealugrid)
endforeach()
......
......@@ -85,8 +85,14 @@ void checkIntersections( GridType& grid )
auto level_view = grid.levelView(1);
for (auto && entity : Dune::elements(level_view)) {
std::cout << "entity " << level_view.indexSet().index(entity) << std::endl;
try {
for (auto&& intersection : Dune::intersections(level_view, entity))
std::cout << " intersection " << intersection.indexInInside() << std::endl;
}
catch ( const Dune::NotImplemented& e )
{
std::cout << e.what() << std::endl;
}
}
}
......
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