Commit bc214519 authored by Christian Engwer's avatar Christian Engwer

Merge branch 'use-range-based-for' into 'master'

GridGlueVtkWriter: use range-based for to interate over intersections

See merge request !47
parents ffa892fb 17bd9898
Pipeline #31177 failed with stage
in 8 minutes and 28 seconds
......@@ -28,6 +28,8 @@
#include <dune/geometry/type.hh>
#include <dune/geometry/referenceelements.hh>
#include <dune/grid-glue/gridglue.hh>
namespace Dune {
namespace GridGlue {
......@@ -183,8 +185,6 @@ class GridGlueVtkWriter
fmerged.open(filename.c_str());
using GridView = typename Glue::template GridView<side>;
using RemoteIntersectionIterator = typename Glue::template IntersectionIterator<side>;
typedef typename GridView::ctype ctype;
const int domdimw = GridView::dimensionworld;
......@@ -208,12 +208,11 @@ class GridGlueVtkWriter
fmerged << ((intersectionDim==3) ? "DATASET UNSTRUCTURED_GRID" : "DATASET POLYDATA") << std::endl;
fmerged << "POINTS " << overlaps*(intersectionDim+1) << " " << Dune::className<ctype>() << std::endl;
for (RemoteIntersectionIterator isIt = glue.template ibegin<side>();
isIt != glue.template iend<side>();
++isIt)
for (const auto& intersection : intersections(glue, Reverse<side == 1>{}))
{
for (int i = 0; i < isIt->geometry().corners(); ++i)
fmerged << isIt->geometry().corner(i) << coordinatePadding << std::endl;
const auto& geometry = intersection.geometry();
for (int i = 0; i < geometry.corners(); ++i)
fmerged << geometry.corner(i) << coordinatePadding << std::endl;
}
// WRITE POLYGONS
......
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