From d4a2ff2f25ac3a0352e92413a2cae7ca76122a5a Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Fri, 27 Apr 2018 11:15:30 +0200
Subject: [PATCH] remove preprocessor branchings for Dune < 2.6

---
 dumux/assembly/staggeredlocalassembler.hh     | 12 -----
 dumux/common/defaultmappertraits.hh           |  5 ---
 dumux/common/geometry/geometricentityset.hh   |  9 ----
 dumux/common/geometry/geometryintersection.hh | 28 ++----------
 dumux/common/geometry/makegeometry.hh         | 12 -----
 dumux/common/intersectionmapper.hh            |  8 ----
 dumux/common/staggeredfvproblem.hh            | 12 -----
 dumux/discretization/basefvgridgeometry.hh    |  5 ---
 dumux/discretization/box/boxgeometryhelper.hh | 18 --------
 dumux/discretization/box/fvelementgeometry.hh |  4 --
 dumux/discretization/box/fvgridgeometry.hh    |  8 ----
 dumux/discretization/box/subcontrolvolume.hh  |  4 --
 .../box/subcontrolvolumeface.hh               |  4 --
 .../cellcentered/mpfa/fvelementgeometry.hh    |  8 ----
 .../cellcentered/mpfa/fvgridgeometry.hh       |  8 ----
 .../cellcentered/mpfa/helper.hh               | 45 +------------------
 .../cellcentered/mpfa/subcontrolvolumeface.hh |  4 --
 .../freeflow/staggeredgeometryhelper.hh       |  4 --
 .../navierstokes/staggered/fluxoversurface.hh |  7 ---
 dumux/io/adaptivegridrestart.hh               | 10 +----
 dumux/io/cakegridcreator.hh                   |  5 +--
 dumux/io/gridcreator.hh                       |  8 ----
 dumux/io/vtkmultiwriter.hh                    | 10 -----
 dumux/linear/seqsolverbackend.hh              | 24 ----------
 .../compositionfromfugacities.hh              |  2 +-
 .../constraintsolvers/immiscibleflash.hh      |  2 +-
 dumux/material/constraintsolvers/ncpflash.hh  |  2 +-
 .../spatialparams/gstatrandomfield.hh         |  4 --
 .../diffusion/cellcentered/velocity.hh        |  7 +--
 .../diffusion/cellcentered/velocity.hh        |  7 +--
 .../diffusion/mimetic/croperator.hh           |  8 ----
 .../sequential/diffusion/mimetic/pressure.hh  |  7 +--
 .../diffusion/mimetic/pressureadaptive.hh     |  7 +--
 .../diffusion/mpfa/lmethod/2dpressure.hh      |  8 ----
 .../mpfa/lmethod/2dpressureadaptive.hh        |  8 ----
 .../mpfa/lmethod/2dpressurevelocity.hh        |  4 --
 .../lmethod/2dpressurevelocityadaptive.hh     |  4 --
 .../diffusion/mpfa/lmethod/2dvelocity.hh      |  8 ----
 .../lmethod/3dinteractionvolumecontainer.hh   |  8 ----
 .../3dinteractionvolumecontaineradaptive.hh   | 12 -----
 .../mpfa/lmethod/3dpressurevelocity.hh        |  4 --
 .../diffusion/mpfa/omethod/2dpressure.hh      |  8 ----
 .../mpfa/omethod/2dpressurevelocity.hh        |  4 --
 .../diffusion/mpfa/omethod/2dvelocity.hh      |  8 ----
 .../2p2c/sequential/fv3dpressureadaptive.hh   |  5 +--
 .../porousmediumflow/sequential/properties.hh |  8 ----
 .../sequential/variableclass.hh               |  5 ---
 dumux/porousmediumflow/velocityoutput.hh      |  4 --
 test/common/boundingboxtree/test_bboxtree.cc  |  8 ----
 .../boundingboxtree/test_geometry_fracture.cc |  4 --
 .../common/geometry/test_1d3d_intersection.cc | 12 -----
 .../common/geometry/test_2d3d_intersection.cc | 15 ++-----
 test/io/gridcreator/test_gridcreator_gmsh.cc  | 15 ++-----
 .../1p/sequential/resultevaluation3d.hh       | 26 -----------
 54 files changed, 25 insertions(+), 461 deletions(-)

diff --git a/dumux/assembly/staggeredlocalassembler.hh b/dumux/assembly/staggeredlocalassembler.hh
index a848fca641..7fee790e90 100644
--- a/dumux/assembly/staggeredlocalassembler.hh
+++ b/dumux/assembly/staggeredlocalassembler.hh
@@ -26,12 +26,8 @@
 #define DUMUX_STAGGERED_LOCAL_ASSEMBLER_HH
 
 #include <dune/common/version.hh>
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
 #include <dune/common/hybridutilities.hh>
 #include <dune/common/rangeutilities.hh>
-#else
-#include <dumux/common/intrange.hh>
-#endif
 
 #include <dune/istl/matrixindexset.hh>
 #include <dune/istl/bvector.hh>
@@ -601,11 +597,7 @@ protected:
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::CellCenterIdx)
     {
         constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Dune::range(0, numEqCellCenter);
-#else
-        return IntRange(0, numEqCellCenter);
-#endif
     }
 
     //! Helper function that returns an iterable range of primary variable indices.
@@ -613,11 +605,7 @@ protected:
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::FaceIdx)
     {
         constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace);
-    #if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Dune::range(0, numEqFace);
-    #else
-        return IntRange(0, numEqFace);
-    #endif
     }
 
 private:
diff --git a/dumux/common/defaultmappertraits.hh b/dumux/common/defaultmappertraits.hh
index 9686dbed96..e36274aea3 100644
--- a/dumux/common/defaultmappertraits.hh
+++ b/dumux/common/defaultmappertraits.hh
@@ -32,13 +32,8 @@ namespace Dumux {
 template <class GridView>
 struct DefaultMapperTraits
 {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
     using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-    using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGVertexLayout>;
-#endif
 };
 
 } // namespace Dumux
diff --git a/dumux/common/geometry/geometricentityset.hh b/dumux/common/geometry/geometricentityset.hh
index acc4537516..686c59e4ed 100644
--- a/dumux/common/geometry/geometricentityset.hh
+++ b/dumux/common/geometry/geometricentityset.hh
@@ -40,21 +40,12 @@ namespace Dumux {
 template <class GridView, int codim = 0>
 class GridViewGeometricEntitySet
 {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    // Only works for codim == 0, fixed in dune version 2.6
-    using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
     using Entity = typename GridView::template Codim<codim>::Entity;
 public:
     GridViewGeometricEntitySet(const GridView& gridView)
     : gridView_(gridView)
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     , mapper_(gridView, Dune::mcmgLayout(Dune::Codim<codim>()))
-#else
-    , mapper_(gridView)
-#endif
     , entityMap_(std::make_shared<EntityMap<GridView, codim>>(gridView.grid(), mapper_))
     {}
 
diff --git a/dumux/common/geometry/geometryintersection.hh b/dumux/common/geometry/geometryintersection.hh
index 669cda7caf..deabdfb94e 100644
--- a/dumux/common/geometry/geometryintersection.hh
+++ b/dumux/common/geometry/geometryintersection.hh
@@ -228,13 +228,8 @@ public:
         using PolyhedronFaceGeometry = Dune::MultiLinearGeometry<ctype, 2, dimworld>;
         using SegGeometry = Dune::MultiLinearGeometry<ctype, 1, dimworld>;
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement1 = ReferenceElementsGeo1::general(geo1.type());
         const auto referenceElement2 = ReferenceElementsGeo2::general(geo2.type());
-#else
-        const auto& referenceElement1 = ReferenceElementsGeo1::general(geo1.type());
-        const auto& referenceElement2 = ReferenceElementsGeo2::general(geo2.type());
-#endif
 
         // add intersection points of all polyhedron edges (codim dim-1) with the polygon
         for (int i = 0; i < referenceElement1.size(dim1-1); ++i)
@@ -242,12 +237,7 @@ public:
             const auto localEdgeGeom = referenceElement1.template geometry<dim1-1>(i);
             const auto p = geo1.global(localEdgeGeom.corner(0));
             const auto q = geo1.global(localEdgeGeom.corner(1));
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto segGeo = SegGeometry(Dune::GeometryTypes::line, std::vector<Point>{p, q});
-#else
-            static const Dune::GeometryType gt(1);
-            const auto segGeo = SegGeometry(gt, std::vector<Point>{p, q});
-#endif
 
             using PolySegTest = GeometryIntersection<Geometry2, SegGeometry>;
             typename PolySegTest::IntersectionType intersection;
@@ -267,24 +257,16 @@ public:
                     const auto b = geo1.global(localFaceGeo.corner(1));
                     const auto c = geo1.global(localFaceGeo.corner(2));
                     const auto d = geo1.global(localFaceGeo.corner(3));
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
+
                     return PolyhedronFaceGeometry(Dune::GeometryTypes::cube(2), std::vector<Point>{a, b, c, d});
-#else
-                    static const Dune::GeometryType gt(Dune::GeometryType::cube, 2);
-                    return PolyhedronFaceGeometry(gt, std::vector<Point>{a, b, c, d});
-#endif
                 }
                 else
                 {
                     const auto a = geo1.global(localFaceGeo.corner(0));
                     const auto b = geo1.global(localFaceGeo.corner(1));
                     const auto c = geo1.global(localFaceGeo.corner(2));
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
+
                     return PolyhedronFaceGeometry(Dune::GeometryTypes::simplex(2), std::vector<Point>{a, b, c});
-#else
-                    static const Dune::GeometryType gt(Dune::GeometryType::simplex, 2);
-                    return PolyhedronFaceGeometry(gt, std::vector<Point>{a, b, c});
-#endif
                 }
             }();
 
@@ -293,12 +275,8 @@ public:
                 const auto localEdgeGeom = referenceElement2.template geometry<1>(j);
                 const auto p = geo2.global(localEdgeGeom.corner(0));
                 const auto q = geo2.global(localEdgeGeom.corner(1));
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
+
                 const auto segGeo = SegGeometry(Dune::GeometryTypes::line, std::vector<Point>{p, q});
-#else
-                static const Dune::GeometryType gt(1);
-                const auto segGeo = SegGeometry(gt, std::vector<Point>{p, q});
-#endif
 
                 using PolySegTest = GeometryIntersection<PolyhedronFaceGeometry, SegGeometry>;
                 typename PolySegTest::IntersectionType intersection;
diff --git a/dumux/common/geometry/makegeometry.hh b/dumux/common/geometry/makegeometry.hh
index c766fdb00c..ba1471ac5d 100644
--- a/dumux/common/geometry/makegeometry.hh
+++ b/dumux/common/geometry/makegeometry.hh
@@ -126,14 +126,7 @@ auto makeDuneQuadrilaterial(const std::vector<Dune::FieldVector<Scalar, 3>>& poi
 
     // if no sanity check if desired, use the given points directly to construct the geometry
     if(!enableSanityCheck)
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return GeometryType(Dune::GeometryTypes::quadrilateral, points);
-#else
-    {
-        static Dune::GeometryType gt(Dune::GeometryType::cube, dim);
-        return GeometryType(gt, points);
-    }
-#endif
 
     // otherwise, perform a number of checks and corrections
     if(!pointsAreCoplanar(points))
@@ -146,12 +139,7 @@ auto makeDuneQuadrilaterial(const std::vector<Dune::FieldVector<Scalar, 3>>& poi
     if(std::any_of(orientations.begin(), orientations.end(), [](auto i){ return i == 0; }))
         DUNE_THROW(Dune::InvalidStateException, "More than two points lie on the same line.");
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto quadrilateral = GeometryType(Dune::GeometryTypes::quadrilateral, corners);
-#else
-    static Dune::GeometryType gt(Dune::GeometryType::cube, dim);
-    const auto quadrilateral = GeometryType(gt, corners);
-#endif
 
     const auto eps = 1e-20;
     if(quadrilateral.volume() < eps)
diff --git a/dumux/common/intersectionmapper.hh b/dumux/common/intersectionmapper.hh
index 5599c97eee..8bad3ff9e6 100644
--- a/dumux/common/intersectionmapper.hh
+++ b/dumux/common/intersectionmapper.hh
@@ -188,20 +188,12 @@ class IntersectionMapper
     enum {dim=Grid::dimension};
     using Element = typename Grid::template Codim<0>::Entity;
     using Intersection = typename GridView::Intersection;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
 
 public:
     IntersectionMapper(const GridView& gridview)
     : gridView_(gridview)
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     , elementMapper_(gridView_, Dune::mcmgElementLayout())
-#else
-    , elementMapper_(gridView_)
-#endif
     , size_(gridView_.size(1))
     , intersectionMapGlobal_(gridView_.size(0))
     , intersectionMapLocal_(gridView_.size(0))
diff --git a/dumux/common/staggeredfvproblem.hh b/dumux/common/staggeredfvproblem.hh
index a517417d81..d5b669f9b0 100644
--- a/dumux/common/staggeredfvproblem.hh
+++ b/dumux/common/staggeredfvproblem.hh
@@ -25,11 +25,7 @@
 #define DUMUX_STAGGERD_FV_PROBLEM_HH
 
 #include <dune/common/version.hh>
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
 #include <dune/common/rangeutilities.hh>
-#else
-#include <dumux/common/intrange.hh>
-#endif
 
 #include <dumux/common/properties.hh>
 #include <dumux/common/fvproblem.hh>
@@ -227,11 +223,7 @@ protected:
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::CellCenterIdx)
     {
         constexpr auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Dune::range(0, numEqCellCenter);
-#else
-        return IntRange(0, numEqCellCenter);
-#endif
     }
 
     //! Helper function that returns an iterable range of primary variable indices.
@@ -239,11 +231,7 @@ protected:
     static auto priVarIndices_(typename FVGridGeometry::DofTypeIndices::FaceIdx)
     {
         constexpr auto numEqFace = GET_PROP_VALUE(TypeTag, NumEqFace);
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Dune::range(0, numEqFace);
-#else
-        return IntRange(0, numEqFace);
-#endif
     }
 
 };
diff --git a/dumux/discretization/basefvgridgeometry.hh b/dumux/discretization/basefvgridgeometry.hh
index b7fd9c2e00..d0a6b4b9d2 100644
--- a/dumux/discretization/basefvgridgeometry.hh
+++ b/dumux/discretization/basefvgridgeometry.hh
@@ -67,13 +67,8 @@ public:
     //! Constructor computes the bouding box of the entire domain, for e.g. setting boundary conditions
     BaseFVGridGeometry(const GridView& gridView)
     : gridView_(gridView)
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     , elementMapper_(gridView, Dune::mcmgElementLayout())
     , vertexMapper_(gridView, Dune::mcmgVertexLayout())
-#else
-    , elementMapper_(gridView)
-    , vertexMapper_(gridView)
-#endif
     , bBoxMin_(std::numeric_limits<double>::max())
     , bBoxMax_(-std::numeric_limits<double>::max())
     {
diff --git a/dumux/discretization/box/boxgeometryhelper.hh b/dumux/discretization/box/boxgeometryhelper.hh
index 9d72c54b0b..d1fadc2d04 100644
--- a/dumux/discretization/box/boxgeometryhelper.hh
+++ b/dumux/discretization/box/boxgeometryhelper.hh
@@ -141,11 +141,7 @@ public:
     : elementGeometry_(geometry)
     , corners_(geometry.corners())
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(geometry.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(geometry.type());
-#endif
 
         // the element center
         p[0] = geometry.center();
@@ -255,11 +251,7 @@ public:
                                              const typename Intersection::Geometry& isGeom,
                                              unsigned int indexInIntersection) const
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(elementGeometry_.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(elementGeometry_.type());
-#endif
 
         const auto vIdxLocal = referenceElement.subEntity(is.indexInInside(), 1, indexInIntersection, dim);
         if (indexInIntersection == 0)
@@ -368,11 +360,7 @@ public:
     : elementGeometry_(geometry)
     , corners_(geometry.corners())
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(geometry.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(geometry.type());
-#endif
 
         // the element center
         p[0] = geometry.center();
@@ -517,14 +505,8 @@ public:
                                              const typename Intersection::Geometry& geometry,
                                              unsigned int indexInIntersection) const
     {
-
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(elementGeometry_.type());
         const auto faceRefElem = FaceReferenceElements::general(geometry.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(elementGeometry_.type());
-        const auto& faceRefElem = FaceReferenceElements::general(geometry.type());
-#endif
 
         GlobalPosition pi[9];
         auto corners = geometry.corners();
diff --git a/dumux/discretization/box/fvelementgeometry.hh b/dumux/discretization/box/fvelementgeometry.hh
index fd1df112b8..c4ef5e6589 100644
--- a/dumux/discretization/box/fvelementgeometry.hh
+++ b/dumux/discretization/box/fvelementgeometry.hh
@@ -272,11 +272,7 @@ private:
 
         // get the element geometry
         auto elementGeometry = element.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(elementGeometry.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(elementGeometry.type());
-#endif
 
         // get the sub control volume geometries of this element
         GeometryHelper geometryHelper(elementGeometry);
diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh
index 06429cb2db..964191b76a 100644
--- a/dumux/discretization/box/fvgridgeometry.hh
+++ b/dumux/discretization/box/fvgridgeometry.hh
@@ -165,11 +165,7 @@ public:
 
             // get the element geometry
             auto elementGeometry = element.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto referenceElement = ReferenceElements::general(elementGeometry.type());
-#else
-            const auto& referenceElement = ReferenceElements::general(elementGeometry.type());
-#endif
 
             // instantiate the geometry helper
             GeometryHelper geometryHelper(elementGeometry);
@@ -362,11 +358,7 @@ public:
             numScvf_ += element.subEntities(dim-1);
 
             const auto elementGeometry = element.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto referenceElement = ReferenceElements::general(elementGeometry.type());
-#else
-            const auto& referenceElement = ReferenceElements::general(elementGeometry.type());
-#endif
 
             // store the sub control volume face indices on the domain boundary
             for (const auto& intersection : intersections(this->gridView(), element))
diff --git a/dumux/discretization/box/subcontrolvolume.hh b/dumux/discretization/box/subcontrolvolume.hh
index b3811e9c6e..68e1011697 100644
--- a/dumux/discretization/box/subcontrolvolume.hh
+++ b/dumux/discretization/box/subcontrolvolume.hh
@@ -138,11 +138,7 @@ public:
     // e.g. for integration
     Geometry geometry() const
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Geometry(Dune::GeometryTypes::cube(dim), corners_);
-#else
-        return Geometry(Dune::GeometryType(Dune::GeometryType::cube, dim), corners_);
-#endif
     }
 
     //! The element-local index of the dof this scv is embedded in
diff --git a/dumux/discretization/box/subcontrolvolumeface.hh b/dumux/discretization/box/subcontrolvolumeface.hh
index f5709a5d39..9a0a042023 100644
--- a/dumux/discretization/box/subcontrolvolumeface.hh
+++ b/dumux/discretization/box/subcontrolvolumeface.hh
@@ -210,11 +210,7 @@ public:
     //! The geometry of the sub control volume face
     Geometry geometry() const
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_);
-#else
-        return Geometry(Dune::GeometryType(Dune::GeometryType::cube, Geometry::mydimension), corners_);
-#endif
     }
 
     //! Return the boundary flag
diff --git a/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh
index 1d0a9f19c8..be31dde46c 100644
--- a/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh
+++ b/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh
@@ -368,11 +368,7 @@ private:
             const auto& e = useNeighbor ? is.outside() : element;
             const auto indexInElement = useNeighbor ? is.indexInOutside() : is.indexInInside();
             const auto eg = e.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto refElement = ReferenceElements::general(eg.type());
-#else
-            const auto& refElement = ReferenceElements::general(eg.type());
-#endif
 
             // Set up a container with all relevant positions for scvf corner computation
             const auto numCorners = is.geometry().corners();
@@ -452,11 +448,7 @@ private:
             const auto& e = useNeighbor ? is.outside() : element;
             const auto indexInElement = useNeighbor ? is.indexInOutside() : is.indexInInside();
             const auto eg = e.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto refElement = ReferenceElements::general(eg.type());
-#else
-            const auto& refElement = ReferenceElements::general(eg.type());
-#endif
 
             // Set up a container with all relevant positions for scvf corner computation
             const auto numCorners = is.geometry().corners();
diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
index d4290f0068..80a8cf99e0 100644
--- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
+++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh
@@ -226,11 +226,7 @@ public:
                 const auto& e = useNeighbor ? is.outside() : element;
                 const auto indexInElement = useNeighbor ? is.indexInOutside() : indexInInside;
                 const auto eg = e.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 const auto refElement = ReferenceElements::general(eg.type());
-#else
-                const auto& refElement = ReferenceElements::general(eg.type());
-#endif
 
                 // Set up a container with all relevant positions for scvf corner computation
                 const auto numCorners = is.geometry().corners();
@@ -585,11 +581,7 @@ public:
                 const auto& e = useNeighbor ? is.outside() : element;
                 const auto indexInElement = useNeighbor ? is.indexInOutside() : indexInInside;
                 const auto eg = e.geometry();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 const auto refElement = ReferenceElements::general(eg.type());
-#else
-                const auto& refElement = ReferenceElements::general(eg.type());
-#endif
 
                 // evaluate if vertices on this intersection use primary/secondary IVs
                 const bool isBranchingPoint = dim < dimWorld ? outsideIndices[indexInInside].size() > 1 : false;
diff --git a/dumux/discretization/cellcentered/mpfa/helper.hh b/dumux/discretization/cellcentered/mpfa/helper.hh
index dac6e54624..3e7858c563 100644
--- a/dumux/discretization/cellcentered/mpfa/helper.hh
+++ b/dumux/discretization/cellcentered/mpfa/helper.hh
@@ -106,7 +106,6 @@ public:
      */
     static std::size_t getGlobalNumScvf(const GridView& gridView)
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         assert(gridView.size(Dune::GeometryTypes::triangle)
                + gridView.size(Dune::GeometryTypes::quadrilateral) == gridView.size(0));
 
@@ -114,13 +113,6 @@ public:
                  * getNumLocalScvfs(Dune::GeometryTypes::triangle)
                + gridView.size(Dune::GeometryTypes::quadrilateral)
                  * getNumLocalScvfs(Dune::GeometryTypes::quadrilateral);
-#else
-        assert(gridView.size(Dune::GeometryType(Dune::GeometryType::simplex, 2))
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::cube, 2)) == gridView.size(0));
-
-        return gridView.size(Dune::GeometryType(Dune::GeometryType::simplex, 2))*6
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::cube, 2))*8;
-#endif
     }
 
     /*!
@@ -200,21 +192,12 @@ public:
      */
     static std::size_t getNumLocalScvfs(const Dune::GeometryType gt)
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         if (gt == Dune::GeometryTypes::triangle)
             return 6;
         else if (gt == Dune::GeometryTypes::quadrilateral)
             return 8;
         else
             DUNE_THROW(Dune::NotImplemented, "Mpfa for 2d geometry type " << gt);
-#else
-        if (gt.isTriangle())
-            return 6;
-        else if (gt.isQuadrilateral())
-            return 8;
-        else
-            DUNE_THROW(Dune::NotImplemented, "Mpfa for 2d geometry type " << gt);
-#endif
     }
 };
 
@@ -347,7 +330,6 @@ public:
      */
     static std::size_t getGlobalNumScvf(const GridView& gridView)
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         assert(gridView.size(Dune::GeometryTypes::tetrahedron)
                + gridView.size(Dune::GeometryTypes::pyramid)
                + gridView.size(Dune::GeometryTypes::prism)
@@ -361,17 +343,6 @@ public:
                  * getNumLocalScvfs(Dune::GeometryTypes::prism)
                + gridView.size(Dune::GeometryTypes::hexahedron)
                  * getNumLocalScvfs(Dune::GeometryTypes::hexahedron);
-#else
-        assert(gridView.size(Dune::GeometryType(Dune::GeometryType::simplex, 3))
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::pyramid, 3))
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::prism, 3))
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::cube, 3)) == gridView.size(0));
-
-        return gridView.size(Dune::GeometryType(Dune::GeometryType::simplex, 3))*12
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::pyramid, 3))*16
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::prism, 3))*18
-               + gridView.size(Dune::GeometryType(Dune::GeometryType::cube, 3))*24;
-#endif
     }
 
     /*!
@@ -522,7 +493,6 @@ public:
      */
     static std::size_t getNumLocalScvfs(const Dune::GeometryType gt)
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         if (gt == Dune::GeometryTypes::tetrahedron)
             return 12;
         else if (gt == Dune::GeometryTypes::pyramid)
@@ -531,16 +501,6 @@ public:
             return 18;
         else if (gt == Dune::GeometryTypes::hexahedron)
             return 24;
-#else
-        if (gt == Dune::GeometryType(Dune::GeometryType::simplex, 3))
-            return 12;
-        else if (gt == Dune::GeometryType(Dune::GeometryType::pyramid, 3))
-            return 16;
-        else if (gt == Dune::GeometryType(Dune::GeometryType::prism, 3))
-            return 18;
-        else if (gt == Dune::GeometryType(Dune::GeometryType::cube, 3))
-            return 24;
-#endif
         else
             DUNE_THROW(Dune::NotImplemented, "Mpfa for 3d geometry type " << gt);
     }
@@ -617,11 +577,8 @@ public:
             {
                 if (!is.neighbor() && !is.boundary())
                 {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                     const auto refElement = ReferenceElements::general(element.geometry().type());
-#else
-                    const auto& refElement = ReferenceElements::general(element.geometry().type());
-#endif
+
                     for (int isVertex = 0; isVertex < is.geometry().corners(); ++isVertex)
                     {
                         const auto vIdxLocal = refElement.subEntity(is.indexInInside(), 1, isVertex, dim);
diff --git a/dumux/discretization/cellcentered/mpfa/subcontrolvolumeface.hh b/dumux/discretization/cellcentered/mpfa/subcontrolvolumeface.hh
index 96122d5982..f39d2d0b41 100644
--- a/dumux/discretization/cellcentered/mpfa/subcontrolvolumeface.hh
+++ b/dumux/discretization/cellcentered/mpfa/subcontrolvolumeface.hh
@@ -202,11 +202,7 @@ public:
     const GlobalPosition& unitOuterNormal() const { return unitOuterNormal_; }
 
     //! The geometry of the sub control volume face
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     Geometry geometry() const { return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
-#else
-    Geometry geometry() const { return Geometry(Dune::GeometryType(Dune::GeometryType::cube, Geometry::mydimension), corners_); }
-#endif
 
 private:
     bool boundary_;
diff --git a/dumux/discretization/staggered/freeflow/staggeredgeometryhelper.hh b/dumux/discretization/staggered/freeflow/staggeredgeometryhelper.hh
index 7606017b8e..34a7a3d979 100644
--- a/dumux/discretization/staggered/freeflow/staggeredgeometryhelper.hh
+++ b/dumux/discretization/staggered/freeflow/staggeredgeometryhelper.hh
@@ -294,11 +294,7 @@ private:
 
     void setPairInfo_(const int isIdx, const Element& element, const bool isParallel)
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(element_.geometry().type());
-#else
-        const auto& referenceElement = ReferenceElements::general(element_.geometry().type());
-#endif
 
         // iterate over facets sub-entities
         for(int i = 0; i < numFacetSubEntities; ++i)
diff --git a/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh b/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh
index 3894e3106d..39c9add1cc 100644
--- a/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh
+++ b/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh
@@ -211,14 +211,7 @@ public:
      */
     static SurfaceGeometryType makeSurface(const std::vector<Dune::FieldVector<Scalar, 2>>& corners)
     {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             return SurfaceGeometryType(Dune::GeometryTypes::line, corners);
-#else
-        {
-            static Dune::GeometryType gt2d(Dune::GeometryType::simplex, dim-1);
-            return SurfaceGeometryType(gt2d, corners);
-        }
-#endif
     }
 
     /*!
diff --git a/dumux/io/adaptivegridrestart.hh b/dumux/io/adaptivegridrestart.hh
index c0166c1f15..9c3e9ca504 100644
--- a/dumux/io/adaptivegridrestart.hh
+++ b/dumux/io/adaptivegridrestart.hh
@@ -31,9 +31,6 @@
 #endif
 
 #include <dune/grid/common/backuprestore.hh>
-#if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2, 5)
-#include <dune/grid/utility/grapedataioformattypes.hh>
-#endif
 
 #include <dumux/common/exceptions.hh>
 #include <dumux/common/properties.hh>
@@ -109,11 +106,8 @@ public:
 #if HAVE_DUNE_ALUGRID
         Dune::BackupRestoreFacility<Grid>::backup(problem.grid(), gridName);
 #else
-        problem.grid().template writeGrid
-#if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2, 5)
-        <Dune::xdr>
-#endif // Dune < 3.0
-        (gridName, problem.timeManager().time() + problem.timeManager().timeStepSize());
+        problem.grid().template writeGrid(gridName, problem.timeManager().time()
+                                                    + problem.timeManager().timeStepSize());
 #endif
     }
 
diff --git a/dumux/io/cakegridcreator.hh b/dumux/io/cakegridcreator.hh
index 89aebc5bc5..0d928cf2fc 100644
--- a/dumux/io/cakegridcreator.hh
+++ b/dumux/io/cakegridcreator.hh
@@ -275,11 +275,8 @@ public:
         std::vector<Scalar> dA = polarCoordinates[1];
 
         GridFactory gridFactory;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         constexpr auto type = Dune::GeometryTypes::cube(dim);
-#else
-        Dune::GeometryType type; type.makeCube(dim);
-#endif
+
         // create nodes
         if (dim == 3)
         {
diff --git a/dumux/io/gridcreator.hh b/dumux/io/gridcreator.hh
index 2ba6582726..970c5aefce 100644
--- a/dumux/io/gridcreator.hh
+++ b/dumux/io/gridcreator.hh
@@ -66,11 +66,7 @@
 #if HAVE_DUNE_FOAMGRID
 #include <dune/foamgrid/foamgrid.hh>
 #include <dune/common/version.hh>
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
 #include <dune/foamgrid/dgffoam.hh>
-#else
-#include <dune/foamgrid/dgffoam.cc>
-#endif
 #endif
 
 #include <dumux/common/properties.hh>
@@ -1231,11 +1227,7 @@ public:
         // make the grid (structured interval grid in dimworld space)
         Dune::GridFactory<Grid> factory;
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         constexpr auto geomType = Dune::GeometryTypes::line;
-#else
-        auto geomType = Dune::GeometryType(1);
-#endif
 
         // create a step vector
         GlobalPosition step = upperRight;
diff --git a/dumux/io/vtkmultiwriter.hh b/dumux/io/vtkmultiwriter.hh
index f3d26f3fdc..473d0eb3cf 100644
--- a/dumux/io/vtkmultiwriter.hh
+++ b/dumux/io/vtkmultiwriter.hh
@@ -62,26 +62,16 @@ template<class GridView, Dune::VTK::OutputType OutputValue = Dune::VTK::ascii >
 class DUNE_DEPRECATED_MSG("Use VtkOutputModule instead!") VtkMultiWriter
 {
     enum { dim = GridView::dimension };
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
     using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGVertexLayout>;
-    using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
 public:
     using VtkWriter = Dune::VTKWriter<GridView>;
     VtkMultiWriter(const GridView &gridView,
                    const std::string &simName = "",
                    std::string multiFileName = "")
         : gridView_(gridView)
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         , elementMapper_(gridView, Dune::mcmgElementLayout())
         , vertexMapper_(gridView, Dune::mcmgVertexLayout())
-#else
-        , elementMapper_(gridView)
-        , vertexMapper_(gridView)
-#endif
     {
         simName_ = (simName.empty())?"sim":simName;
         multiFileName_ = multiFileName;
diff --git a/dumux/linear/seqsolverbackend.hh b/dumux/linear/seqsolverbackend.hh
index bab4fb229b..c3365903cd 100644
--- a/dumux/linear/seqsolverbackend.hh
+++ b/dumux/linear/seqsolverbackend.hh
@@ -172,11 +172,7 @@ public:
     template<int precondBlockLevel = 1, class Matrix, class Vector>
     bool solve(const Matrix& A, Vector& x, const Vector& b)
     {
-#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6)
         using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>;
-#else
-        using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, precondBlockLevel>;
-#endif
         using Solver = Dune::BiCGSTABSolver<Vector>;
 
         return IterativePreconditionedSolverImpl::template solve<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());
@@ -364,11 +360,7 @@ public:
     template<int precondBlockLevel = 1, class Matrix, class Vector>
     bool solve(const Matrix& A, Vector& x, const Vector& b)
     {
-#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6)
         using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>;
-#else
-        using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, precondBlockLevel>;
-#endif
         using Solver = Dune::CGSolver<Vector>;
 
         return IterativePreconditionedSolverImpl::template solve<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());
@@ -590,11 +582,7 @@ public:
     template<int precondBlockLevel = 1, class Matrix, class Vector>
     bool solve(const Matrix& A, Vector& x, const Vector& b)
     {
-#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6)
         using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>;
-#else
-        using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, precondBlockLevel>;
-#endif
         using Solver = Dune::BiCGSTABSolver<Vector>;
 
         return IterativePreconditionedSolverImpl::template solveWithILU0Prec<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());
@@ -630,11 +618,7 @@ public:
     template<int precondBlockLevel = 1, class Matrix, class Vector>
     bool solve(const Matrix& A, Vector& x, const Vector& b)
     {
-#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6)
         using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>;
-#else
-        using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, precondBlockLevel>;
-#endif
         using Solver = Dune::CGSolver<Vector>;
 
         return IterativePreconditionedSolverImpl::template solveWithILU0Prec<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());
@@ -671,11 +655,7 @@ public:
     template<int precondBlockLevel = 1, class Matrix, class Vector>
     bool solve(const Matrix& A, Vector& x, const Vector& b)
     {
-#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6)
         using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>;
-#else
-        using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, precondBlockLevel>;
-#endif
         using Solver = Dune::RestartedGMResSolver<Vector>;
 
         return IterativePreconditionedSolverImpl::template solveWithILU0PrecGMRes<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());
@@ -713,11 +693,7 @@ public:
     template<int precondBlockLevel = 1, class Matrix, class Vector>
     bool solve(const Matrix& A, Vector& x, const Vector& b)
     {
-#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6)
         using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>;
-#else
-        using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, precondBlockLevel>;
-#endif
         using Solver = Dune::RestartedGMResSolver<Vector>;
 
         return IterativePreconditionedSolverImpl::template solveWithGMRes<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());
diff --git a/dumux/material/constraintsolvers/compositionfromfugacities.hh b/dumux/material/constraintsolvers/compositionfromfugacities.hh
index 7efae4f4d1..8c0119eb39 100644
--- a/dumux/material/constraintsolvers/compositionfromfugacities.hh
+++ b/dumux/material/constraintsolvers/compositionfromfugacities.hh
@@ -107,7 +107,7 @@ public:
             solveIdealMix_(fluidState, paramCache, phaseIdx, targetFug);
             return;
         }
-#if !DUNE_VERSION_NEWER(DUNE_COMMON,2,7)
+#if DUNE_VERSION_LT(DUNE_COMMON, 2, 7)
         Dune::FMatrixPrecision<Scalar>::set_singular_limit(1e-25);
 #endif
         // save initial composition in case something goes wrong
diff --git a/dumux/material/constraintsolvers/immiscibleflash.hh b/dumux/material/constraintsolvers/immiscibleflash.hh
index ebc40dda47..f2e54c27df 100644
--- a/dumux/material/constraintsolvers/immiscibleflash.hh
+++ b/dumux/material/constraintsolvers/immiscibleflash.hh
@@ -121,7 +121,7 @@ public:
                       const typename MaterialLaw::Params &matParams,
                       const ComponentVector &globalMolarities)
     {
-#if !DUNE_VERSION_NEWER(DUNE_COMMON,2,7)
+#if DUNE_VERSION_LT(DUNE_COMMON, 2, 7)
         Dune::FMatrixPrecision<Scalar>::set_singular_limit(1e-25);
 #endif
 
diff --git a/dumux/material/constraintsolvers/ncpflash.hh b/dumux/material/constraintsolvers/ncpflash.hh
index aaf143152d..17a19b8bd4 100644
--- a/dumux/material/constraintsolvers/ncpflash.hh
+++ b/dumux/material/constraintsolvers/ncpflash.hh
@@ -147,7 +147,7 @@ public:
                       const typename MaterialLaw::Params &matParams,
                       const ComponentVector &globalMolarities)
     {
-#if !DUNE_VERSION_NEWER(DUNE_COMMON,2,7)
+#if DUNE_VERSION_LT(DUNE_COMMON, 2, 7)
         Dune::FMatrixPrecision<Scalar>::set_singular_limit(1e-25);
 #endif
 
diff --git a/dumux/material/spatialparams/gstatrandomfield.hh b/dumux/material/spatialparams/gstatrandomfield.hh
index a3611abd25..a5fcc7907f 100644
--- a/dumux/material/spatialparams/gstatrandomfield.hh
+++ b/dumux/material/spatialparams/gstatrandomfield.hh
@@ -55,11 +55,7 @@ class GstatRandomField
 
     using DataVector = std::vector<Scalar>;
     using Element = typename GridView::Traits::template Codim<0>::Entity;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
 
 public:
     // Add field types if you want to implement e.g. tensor permeabilities.
diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh
index c1a4b8f51e..1c8fbc235d 100644
--- a/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh
+++ b/dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/velocity.hh
@@ -122,15 +122,12 @@ public:
             CellData& cellData = problem_.variables().cellData(eIdxGlobal);
 
             const typename Element::Geometry& geometry = element.geometry();
+
             // get corresponding reference element
             using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto refElement = ReferenceElements::general(geometry.type());
-#else
-            const auto& refElement = ReferenceElements::general(geometry.type());
-#endif
-            const int numberOfFaces = refElement.size(1);
 
+            const int numberOfFaces = refElement.size(1);
             std::vector<Scalar> flux(numberOfFaces,0);
 
             // run through all intersections with neighbors and boundary
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh
index 0248b476dd..04ae4c5a9e 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh
@@ -200,15 +200,12 @@ public:
                 CellData& cellData = problem_.variables().cellData(eIdxGlobal);
 
                 const typename Element::Geometry& geometry = element.geometry();
+
                 // get corresponding reference element
                 using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 const auto refElement = ReferenceElements::general(geometry.type());
-#else
-                const auto& refElement = ReferenceElements::general(geometry.type());
-#endif
-                const int numberOfFaces=refElement.size(1);
 
+                const int numberOfFaces=refElement.size(1);
                 std::vector<Scalar> fluxW(numberOfFaces,0);
                 std::vector<Scalar> fluxNw(numberOfFaces,0);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
index b2de67970b..17d52e48f2 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/croperator.hh
@@ -83,11 +83,7 @@ class CROperatorAssemblerTwoP
     using coliterator = typename MatrixType::ColIterator;
     using BCBlockType = std::array<BoundaryConditions::Flags, 1>;     // componentwise boundary conditions
     using SatType = Dune::BlockVector< Dune::FieldVector<double, 1> >;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using FaceMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using FaceMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, FaceLayout>;
-#endif
 
     using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
     enum
@@ -106,11 +102,7 @@ public:
 
     CROperatorAssemblerTwoP (const GridView& gridview)
     : gridView_(gridview)
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     , faceMapper_(gridView_, Dune::mcmgLayout(Dune::Codim<1>()))
-#else
-    , faceMapper_(gridView_)
-#endif
     , size_(faceMapper_.size())
     , A_(size_, size_, nnz()
     , RepresentationType::random)
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh
index 0b09d32acb..259d24297f 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh
@@ -289,15 +289,12 @@ public:
                 }
 
                 const typename Element::Geometry& geometry = element.geometry();
+
                 // get corresponding reference element
                 using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 const auto refElement = ReferenceElements::general(geometry.type());
-#else
-                const auto& refElement = ReferenceElements::general(geometry.type());
-#endif
-                const int numberOfFaces=refElement.size(1);
 
+                const int numberOfFaces=refElement.size(1);
                 std::vector<Scalar> fluxW(numberOfFaces,0);
                 std::vector<Scalar> fluxNw(numberOfFaces,0);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh
index efde8796f4..7e501315e0 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh
@@ -304,15 +304,12 @@ public:
                 }
 
                 const typename Element::Geometry& geometry = element.geometry();
+
                 // get corresponding reference element
                 using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 const auto refElement = ReferenceElements::general(geometry.type());
-#else
-                const auto& refElement = ReferenceElements::general(geometry.type());
-#endif
-                const int numberOfFaces=refElement.size(1);
 
+                const int numberOfFaces=refElement.size(1);
                 std::vector<Scalar> fluxW(numberOfFaces,0);
                 std::vector<Scalar> fluxNw(numberOfFaces,0);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh
index 0f6f2c520a..15942fda28 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh
@@ -733,11 +733,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo()
 
             // get the intersection node /bar^{x_3} between 'intersection12'
             // and 'intersection14', denoted as 'corner1234'
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-            const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
             GlobalPosition corner1234(0);
 
@@ -1639,11 +1635,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble()
                         {
                             int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                             const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                            const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                             const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh
index 57be291cd3..694fb7da92 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh
@@ -778,11 +778,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo()
         // get index
         int eIdxGlobal1 = problem_.variables().index(element);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-        const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
         const auto isEndIt12 = problem_.gridView().iend(element);
         for (auto isIt12 = problem_.gridView().ibegin(element); isIt12 != isEndIt12; ++isIt12)
@@ -2356,11 +2352,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble()
                         {
                             int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                             const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                            const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                             const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh
index fc70f09b3b..8b3fcf7730 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocity.hh
@@ -304,11 +304,7 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
 
     CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
-#else
-    const auto& referenceElement = ReferenceElements::general(elementI.geometry().type());
-#endif
 
     int indexInInside = intersection.indexInInside();
     int indexInOutside = intersection.indexInOutside();
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh
index 59b7279d8f..55e4c6d0b8 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressurevelocityadaptive.hh
@@ -342,11 +342,7 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter
 
     CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
-#else
-    const auto& referenceElement = ReferenceElements::general(elementI.geometry().type());
-#endif
 
     int indexInInside = intersection.indexInInside();
     int indexInOutside = intersection.indexInOutside();
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh
index 9fa7d84ba6..80910bfdc7 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh
@@ -754,11 +754,7 @@ void FvMpfaL2dVelocity2p<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
                 {
                     int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                     const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                    const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                     const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
@@ -867,11 +863,7 @@ void FvMpfaL2dVelocity2p<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
                 {
                     int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                     const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                    const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                     const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh
index da0a4aed44..90482362db 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontainer.hh
@@ -375,11 +375,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E
 
     const ElementGeometry& geometry = element.geometry();
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto referenceElement = ReferenceElements::general(geometry.type());
-#else
-    const auto& referenceElement = ReferenceElements::general(geometry.type());
-#endif
 
     int levelI = element.level();
 
@@ -1355,11 +1351,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeInnerInteractionVolume(I
         const ElementGeometry& geometry1 = element1.geometry();
         const ElementGeometry& geometry8 = element8.geometry();
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(geometry1.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(geometry1.type());
-#endif
 
         DimVector edgeCoord(geometry1.global(referenceElement.position(9, dim - 1)));
         interactionVolume.setEdgePosition(edgeCoord, 2);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh
index 90ae5aae56..e6e821f9df 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dinteractionvolumecontaineradaptive.hh
@@ -190,11 +190,7 @@ void FvMpfaL3dInteractionVolumeContainerAdaptive<TypeTag>::storeInnerInteraction
 
             const ElementGeometry& geometry = element.geometry();
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto referenceElement = ReferenceElements::general(geometry.type());
-#else
-            const auto& referenceElement = ReferenceElements::general(geometry.type());
-#endif
 
             switch (idx)
             {
@@ -355,11 +351,7 @@ void FvMpfaL3dInteractionVolumeContainerAdaptive<TypeTag>::storeHangingNodeInter
 
         const ElementGeometry& geometry = element.geometry();
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(geometry.type());
-#else
-        const auto& referenceElement = ReferenceElements::general(geometry.type());
-#endif
 
         switch (idx)
         {
@@ -1131,11 +1123,7 @@ void FvMpfaL3dInteractionVolumeContainerAdaptive<TypeTag>::storeHangingNodeInter
 
                 const ElementGeometry& geometry = element5.geometry();
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 const auto referenceElement = ReferenceElements::general(geometry.type());
-#else
-                const auto& referenceElement = ReferenceElements::general(geometry.type());
-#endif
 
                 int oldSubVolumElemIdx = IndexTranslator::getOldElemIdxFromNewFaceIdxto0(zeroFaceIdx, 4);
                 int oldEdgeIdx = IndexTranslator::getOldEdgeIdxFromNewFaceIdxto0(zeroFaceIdx, 1);
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh
index c04b54ca3c..e91b75cc81 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh
@@ -305,11 +305,7 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
 
     CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
-#else
-    const auto& referenceElement = ReferenceElements::general(elementI.geometry().type());
-#endif
 
     int indexInInside = intersection.indexInInside();
     int indexInOutside = intersection.indexInOutside();
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh
index f3c3b5a566..6fea5f1c04 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh
@@ -731,11 +731,7 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo()
             // get the intersection node /bar^{x_3} between 'isIt12' and 'isIt14', denoted as 'corner1234'
             // initialization of corner1234
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
             const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-            const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
             GlobalPosition corner1234(0);
 
@@ -1736,11 +1732,7 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble()
                         {
                             int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                             const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                            const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                             const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh
index 99ac32de2d..6d422752d1 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressurevelocity.hh
@@ -303,11 +303,7 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection&
 
     CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto referenceElement = ReferenceElements::general(elementI.geometry().type());
-#else
-    const auto& referenceElement = ReferenceElements::general(elementI.geometry().type());
-#endif
 
     int indexInInside = intersection.indexInInside();
     int indexInOutside = intersection.indexInOutside();
diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh
index 90b442f8f5..b1066bf581 100644
--- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh
+++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh
@@ -587,11 +587,7 @@ void FvMpfaO2dVelocity2P<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
                 {
                     int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                     const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                    const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                     const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
@@ -700,11 +696,7 @@ void FvMpfaO2dVelocity2P<TypeTag>::calculateBoundaryInteractionVolumeVelocity(In
                 {
                     int boundaryFaceIdx = interactionVolume.getIndexOnElement(elemIdx, fIdx);
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                     const auto referenceElement = ReferenceElements::general(element.geometry().type());
-#else
-                    const auto& referenceElement = ReferenceElements::general(element.geometry().type());
-#endif
 
                     const LocalPosition& localPos = referenceElement.position(boundaryFaceIdx, 1);
 
diff --git a/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh b/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh
index dd116c55e7..acadc586de 100644
--- a/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh
+++ b/dumux/porousmediumflow/2p2c/sequential/fv3dpressureadaptive.hh
@@ -1430,11 +1430,8 @@ int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const Intersect
     int localFace24 = face24->indexInInside();
     int localFace26 = face26->indexInInside();
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     const auto referenceElement = ReferenceElementContainer::general(neighbor.geometry().type());
-#else
-    const auto& referenceElement = ReferenceElementContainer::general(neighbor.geometry().type());
-#endif
+
     //find 'x'5 = edgeCoord1226
     int edge1226;
     // search through edges of face 12
diff --git a/dumux/porousmediumflow/sequential/properties.hh b/dumux/porousmediumflow/sequential/properties.hh
index 858eaefdbf..cfc7a6e489 100644
--- a/dumux/porousmediumflow/sequential/properties.hh
+++ b/dumux/porousmediumflow/sequential/properties.hh
@@ -192,20 +192,12 @@ public:
     /*!
      * \brief Mapper for the grid view's vertices.
      */
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGVertexLayout>;
-#endif
 
     /*!
      * \brief Mapper for the grid view's elements.
      */
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-    using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
 
     /*!
      * \brief The type of a solution at a fixed time.
diff --git a/dumux/porousmediumflow/sequential/variableclass.hh b/dumux/porousmediumflow/sequential/variableclass.hh
index ffe6d65cce..c0c5ddefe7 100644
--- a/dumux/porousmediumflow/sequential/variableclass.hh
+++ b/dumux/porousmediumflow/sequential/variableclass.hh
@@ -80,13 +80,8 @@ public:
      */
     VariableClass(const GridView& gridView) :
         gridView_(gridView),
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         elementMapper_(gridView, Dune::mcmgElementLayout()),
         vertexMapper_(gridView, Dune::mcmgVertexLayout())
-#else
-        elementMapper_(gridView),
-        vertexMapper_(gridView)
-#endif
     {}
 
     //! Initializes the variable class
diff --git a/dumux/porousmediumflow/velocityoutput.hh b/dumux/porousmediumflow/velocityoutput.hh
index cb10fe222a..cc6c86ef7c 100644
--- a/dumux/porousmediumflow/velocityoutput.hh
+++ b/dumux/porousmediumflow/velocityoutput.hh
@@ -184,11 +184,7 @@ public:
         }
 
         // get the transposed Jacobian of the element mapping
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         const auto referenceElement = ReferenceElements::general(geomType);
-#else
-        const auto& referenceElement = ReferenceElements::general(geomType);
-#endif
         const auto& localPos = referenceElement.position(0, 0);
         const auto jacobianT2 = geometry.jacobianTransposed(localPos);
 
diff --git a/test/common/boundingboxtree/test_bboxtree.cc b/test/common/boundingboxtree/test_bboxtree.cc
index b89f7490e8..b3a2c75155 100644
--- a/test/common/boundingboxtree/test_bboxtree.cc
+++ b/test/common/boundingboxtree/test_bboxtree.cc
@@ -12,11 +12,7 @@
 #if HAVE_DUNE_FOAMGRID
 #include <dune/foamgrid/foamgrid.hh>
 #include <dune/common/version.hh>
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
 #include <dune/foamgrid/dgffoam.hh>
-#else
-#include <dune/foamgrid/dgffoam.cc>
-#endif
 #endif
 
 #include <dumux/common/exceptions.hh>
@@ -241,11 +237,7 @@ int main (int argc, char *argv[]) try
                 // make the grid (structured interval grid in dimworld space)
                 Dune::GridFactory<NetworkGrid> factory;
 
-        #if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
                 constexpr auto geomType = Dune::GeometryTypes::line;
-        #else
-                auto geomType = Dune::GeometryType(1);
-        #endif
 
                 // create a step vector
                 auto step = upperRightNW;
diff --git a/test/common/boundingboxtree/test_geometry_fracture.cc b/test/common/boundingboxtree/test_geometry_fracture.cc
index 09697e6f9a..45638708a5 100644
--- a/test/common/boundingboxtree/test_geometry_fracture.cc
+++ b/test/common/boundingboxtree/test_geometry_fracture.cc
@@ -12,11 +12,7 @@
 
 #include <dune/foamgrid/foamgrid.hh>
 #include <dune/common/version.hh>
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
 #include <dune/foamgrid/dgffoam.hh>
-#else
-#include <dune/foamgrid/dgffoam.cc>
-#endif
 
 #include <dumux/common/exceptions.hh>
 #include <dumux/common/geometry/boundingboxtree.hh>
diff --git a/test/common/geometry/test_1d3d_intersection.cc b/test/common/geometry/test_1d3d_intersection.cc
index 5755046763..45eb434e8c 100644
--- a/test/common/geometry/test_1d3d_intersection.cc
+++ b/test/common/geometry/test_1d3d_intersection.cc
@@ -18,11 +18,7 @@ template<int dimworld = 3>
 Dune::MultiLinearGeometry<double, 1, dimworld>
 makeLine(std::initializer_list<Dune::FieldVector<double, dimworld>>&& c)
 {
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     return {Dune::GeometryTypes::line, c};
-#else
-    return {Dune::GeometryType(1), c};
-#endif
 }
 
 template<int dimworld = 3>
@@ -59,16 +55,8 @@ int main (int argc, char *argv[]) try
         {0.0, 0.0, 1.0}, {1.0, 0.0, 1.0}, {0.0, 1.0, 1.0}, {1.0, 1.0, 1.0}
     });
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     Dune::MultiLinearGeometry<double, dim, dimworld>
         cube(Dune::GeometryTypes::cube(dimworld), cubeCorners);
-#else
-    Dune::GeometryType geomType;
-    geomType.makeCube(3);
-    Dune::MultiLinearGeometry<double, dim, dimworld>
-        cube(geomType, cubeCorners);
-#endif
-
 
     // collect returns to determine exit code
     std::vector<bool> returns;
diff --git a/test/common/geometry/test_2d3d_intersection.cc b/test/common/geometry/test_2d3d_intersection.cc
index 5a697fec32..a8a681af49 100644
--- a/test/common/geometry/test_2d3d_intersection.cc
+++ b/test/common/geometry/test_2d3d_intersection.cc
@@ -89,18 +89,9 @@ int main(int argc, char* argv[]) try
         {-0.1, -0.1, 0.3}, {1.1, -0.1, 0.3}, {0.5, 2.0, 0.8}
     });
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
-        Geometry3D cube(Dune::GeometryTypes::cube(dimworld), cubeCorners);
-        Geometry2D quad(Dune::GeometryTypes::cube(dimworld-1), quadCorners);
-        Geometry2D tri(Dune::GeometryTypes::simplex(dimworld-1), triCorners);
-#else
-        Dune::GeometryType geomType; geomType.makeCube(dimworld);
-        Dune::GeometryType geomType2; geomType2.makeCube(dimworld-1);
-        Dune::GeometryType geomType3; geomType3.makeSimplex(dimworld-1);
-        Geometry3D cube(geomType, cubeCorners);
-        Geometry2D quad(geomType2, quadCorners);
-        Geometry2D tri(geomType3, triCorners);
-#endif
+    Geometry3D cube(Dune::GeometryTypes::cube(dimworld), cubeCorners);
+    Geometry2D quad(Dune::GeometryTypes::cube(dimworld-1), quadCorners);
+    Geometry2D tri(Dune::GeometryTypes::simplex(dimworld-1), triCorners);
 
     if (Test::intersection(cube, quad, intersections))
     {
diff --git a/test/io/gridcreator/test_gridcreator_gmsh.cc b/test/io/gridcreator/test_gridcreator_gmsh.cc
index 8399279a71..3ac92c60a1 100644
--- a/test/io/gridcreator/test_gridcreator_gmsh.cc
+++ b/test/io/gridcreator/test_gridcreator_gmsh.cc
@@ -57,22 +57,15 @@ class GridCreatorGmshTest
     static const int dim = Grid::dimension;
     using GridCreator = typename Dumux::GridCreator<TypeTag>;
     using ReferenceElements = typename Dune::ReferenceElements<Scalar, dim>;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
     using VertexMapper = typename Dune::MultipleCodimMultipleGeomTypeMapper<typename Grid::LeafGridView>;
-#else
-    using VertexMapper = typename Dune::MultipleCodimMultipleGeomTypeMapper<typename Grid::LeafGridView, Dune::MCMGVertexLayout>;
-#endif
 
 public:
 
     static void getBoundaryDomainMarkers(std::vector<int>& boundaryMarker)
     {
         const auto& gridView = GridCreator::grid().leafGridView();
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         VertexMapper vertexMapper(gridView, Dune::mcmgVertexLayout());
-#else
-        VertexMapper vertexMapper(gridView);
-#endif
+
         boundaryMarker.clear();
         boundaryMarker.resize(gridView.size(dim));
         for(auto eIt = gridView.template begin<0>(); eIt != gridView.template end<0>(); ++eIt)
@@ -81,11 +74,9 @@ public:
             {
                 if(!isIt->boundary())
                     continue;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
+
                 const auto refElement = ReferenceElements::general(eIt->geometry().type());
-#else
-                const auto& refElement = ReferenceElements::general(eIt->geometry().type());
-#endif
+
                 // loop over vertices of the intersection facet
                 for(int vIdx = 0; vIdx < refElement.size(isIt->indexInInside(), 1, dim); vIdx++)
                 {
diff --git a/test/porousmediumflow/1p/sequential/resultevaluation3d.hh b/test/porousmediumflow/1p/sequential/resultevaluation3d.hh
index 41870db56e..d163d1afc0 100644
--- a/test/porousmediumflow/1p/sequential/resultevaluation3d.hh
+++ b/test/porousmediumflow/1p/sequential/resultevaluation3d.hh
@@ -86,12 +86,7 @@ public:
         using Geometry = typename Entity::Geometry;
         using GV = typename Grid::LevelGridView;
         using IS = typename GV::IndexSet;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
-#else
-        using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV, Dune::MCMGElementLayout>;
-        using FaceMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV, FaceLayout>;
-#endif
         using ct = typename Grid::ctype;
 
         enum{dim = Grid::dimension};
@@ -100,13 +95,8 @@ public:
         using ReferenceElements = Dune::ReferenceElements<ct, dim>;
         const GV& gridview(grid.levelGridView(grid.maxLevel()));
         const IS& indexset(gridview.indexSet());
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         Mapper elementMapper(gridview, Dune::mcmgElementLayout());
         Mapper faceMapper(gridview, Dune::mcmgLayout(Dune::Codim<1>()));
-#else
-        ElementMapper elementMapper(gridview);
-        FaceMapper faceMapper(gridview);
-#endif
         SolutionType& exactSol(grid.levelGridView(grid.maxLevel()));
 
         uMean = 0;
@@ -432,20 +422,12 @@ public:
         enum {dim=Grid::dimension};
         using Element = typename Grid::template Codim<0>::Entity;
         using Geometry = typename Element::Geometry;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-        using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
         using SolVector = Dune::BlockVector<Dune::FieldVector<Scalar, 1> >;
         using JacobianInverseTransposed = typename Geometry::JacobianInverseTransposed;
         using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         ElementMapper elementMapper(gridView, Dune::mcmgElementLayout());
-#else
-        ElementMapper elementMapper(gridView);
-#endif
         SolVector exactSol(gridView.size(0));
 
 
@@ -726,19 +708,11 @@ public:
         enum {dim=Grid::dimension, maxIntersections = 12};
         using Element = typename Grid::template Codim<0>::Entity;
         using Geometry = typename Element::Geometry;
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
-#else
-        using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>;
-#endif
         using ReferenceElements = Dune::ReferenceElements<Scalar, dim>;
         using ReferenceFaces = Dune::ReferenceElements<Scalar, dim-1>;
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
         ElementMapper elementMapper(gridView, Dune::mcmgElementLayout());
-#else
-        ElementMapper elementMapper(gridView);
-#endif
 
         uMinExact = 1e100;
         uMaxExact = -1e100;
-- 
GitLab