From 33125f0c7344d72a763e0d9cb196af639624cd90 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 2 Nov 2021 16:24:17 +0100 Subject: [PATCH] [staggered][geometryhelper] Use indexInInside for intersection function --- dumux/discretization/facecentered/staggered/geometryhelper.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dumux/discretization/facecentered/staggered/geometryhelper.hh b/dumux/discretization/facecentered/staggered/geometryhelper.hh index 142b34f9b9..1875c22568 100644 --- a/dumux/discretization/facecentered/staggered/geometryhelper.hh +++ b/dumux/discretization/facecentered/staggered/geometryhelper.hh @@ -155,12 +155,10 @@ public: //! Returns an element's intersection based on the local facet index. auto intersection(const SmallLocalIndexType localFacetIdx, const Element& element) const { - SmallLocalIndexType counter = 0; for (const auto& intersection : intersections(gridView(), element)) { - if (counter == localFacetIdx) + if (intersection.indexInInside() == localFacetIdx) return intersection; - ++counter; } DUNE_THROW(Dune::InvalidStateException, "localFacetIdx " << localFacetIdx << " out of range"); } -- GitLab