Commit 0f13d144 authored by Oliver Sander's avatar Oliver Sander Committed by Steffen Müthing

Simplify default implementation of method hasBoundaryIntersections

The previous implementation looped over all level intersections, and over
all leaf intersections, too.  However, if an intersection is on the boundary,
it is so both for the level and the leaf view.  Hence, the second loop
is not necessary.

(cherry picked from commit 536facdd)
Signed-off-by: Steffen Müthing's avatarSteffen Müthing <muething@dune-project.org>
parent 5af719d2
......@@ -824,23 +824,11 @@ namespace Dune
*/
bool hasBoundaryIntersections () const
{
{
typedef typename GridImp::LevelIntersectionIterator IntersectionIterator;
IntersectionIterator end = asImp().ilevelend();
for(IntersectionIterator it = asImp().ilevelbegin(); it != end; ++it)
{
if( it->boundary() ) return true;
}
}
{
typedef typename GridImp::LeafIntersectionIterator IntersectionIterator;
IntersectionIterator end = asImp().ileafend();
for(IntersectionIterator it = asImp().ileafbegin(); it != end; ++it)
{
if( it->boundary() ) return true;
}
}
typedef typename GridImp::LevelIntersectionIterator IntersectionIterator;
IntersectionIterator end = asImp().ilevelend();
for (IntersectionIterator it = asImp().ilevelbegin(); it != end; ++it)
if( it->boundary() )
return true;
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment