From 85b6b18a50d5579ad1d4b2f2279020b523783b25 Mon Sep 17 00:00:00 2001
From: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
Date: Fri, 2 Aug 2024 11:42:06 +0200
Subject: [PATCH] bump minimum dune version to 2.9

---
 dune.module                                |  4 ++--
 opm/grid/cpgrid/CpGridData.cpp             |  4 ----
 opm/grid/cpgrid/Entity2IndexDataHandle.hpp | 11 ++++-------
 opm/grid/polyhedralgrid/grid.hh            |  3 ---
 opm/grid/polyhedralgrid/gridfactory.hh     |  7 -------
 5 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/dune.module b/dune.module
index cbbff169c..5de31d82f 100644
--- a/dune.module
+++ b/dune.module
@@ -10,5 +10,5 @@ Label: 2024.10-pre
 Maintainer: atgeirr@sintef.no
 MaintainerName: Atgeirr F. Rasmussen
 Url: http://opm-project.org
-Depends: dune-common (>= 2.7) dune-geometry (>= 2.7) dune-grid (>= 2.7) opm-common
-Suggests: dune-istl (>= 2.7)
+Depends: dune-common (>= 2.9) dune-geometry (>= 2.9) dune-grid (>= 2.9) opm-common
+Suggests: dune-istl (>= 2.9)
diff --git a/opm/grid/cpgrid/CpGridData.cpp b/opm/grid/cpgrid/CpGridData.cpp
index b1fc2881c..ad525126a 100644
--- a/opm/grid/cpgrid/CpGridData.cpp
+++ b/opm/grid/cpgrid/CpGridData.cpp
@@ -945,11 +945,7 @@ struct AttributeDataHandle
           c2e_(cell_to_entity), grid_(grid)
     {}
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 8)
     bool fixedSize()
-#else
-        bool fixedsize()
-#endif
     {
         return true;
     }
diff --git a/opm/grid/cpgrid/Entity2IndexDataHandle.hpp b/opm/grid/cpgrid/Entity2IndexDataHandle.hpp
index c2d6c59c0..6dfc25b27 100644
--- a/opm/grid/cpgrid/Entity2IndexDataHandle.hpp
+++ b/opm/grid/cpgrid/Entity2IndexDataHandle.hpp
@@ -64,31 +64,28 @@ class Entity2IndexDataHandle
         : fromGrid_(fromGrid), toGrid_(toGrid), data_(data)
     {}
 
-#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 8)
     bool fixedSize()
     {
         return data_.fixedSize(3, codim);
     }
-#else
-    bool fixedsize()
-    {
-        return data_.fixedSize(3, codim);
-    }
-#endif
+
     std::size_t size(std::size_t i)
     {
         return data_.size(Entity<codim>(fromGrid_, i, true));
     }
+
     template<class B>
     void gather(B& buffer, std::size_t i)
     {
         data_.gather(buffer, Entity<codim>(fromGrid_, i, true));
     }
+
     template<class B>
     void scatter(B& buffer, std::size_t i, std::size_t s)
     {
         data_.scatter(buffer, Entity<codim>(toGrid_, i, true), s);
     }
+
 private:
     const CpGridData& fromGrid_;
     const CpGridData& toGrid_;
diff --git a/opm/grid/polyhedralgrid/grid.hh b/opm/grid/polyhedralgrid/grid.hh
index 709b212e5..46d6f0fc8 100644
--- a/opm/grid/polyhedralgrid/grid.hh
+++ b/opm/grid/polyhedralgrid/grid.hh
@@ -962,9 +962,6 @@ namespace Dune
     }
 
   public:
-#if DUNE_VERSION_LT_REV(DUNE_GRID, 2, 7, 1)
-    using Base::getRealImplementation;
-#endif
     typedef typename Traits :: ExtraData ExtraData;
     ExtraData extraData () const  { return this; }
 
diff --git a/opm/grid/polyhedralgrid/gridfactory.hh b/opm/grid/polyhedralgrid/gridfactory.hh
index 91510f06a..dbf4eb350 100644
--- a/opm/grid/polyhedralgrid/gridfactory.hh
+++ b/opm/grid/polyhedralgrid/gridfactory.hh
@@ -8,9 +8,6 @@
 
 #include <dune/common/typetraits.hh>
 #include <dune/common/version.hh>
-#if DUNE_VERSION_LT(DUNE_GRID, 2, 8)
-#include <dune/common/to_unique_ptr.hh>
-#endif
 
 #include <dune/grid/common/gridfactory.hh>
 #include <opm/grid/polyhedralgrid/grid.hh>
@@ -40,11 +37,7 @@ namespace Dune
     typedef Dune::FieldVector<ctype,dimensionworld> CoordinateType;
     typedef CoordinateType  Coordinate;
 
-#if DUNE_VERSION_LT(DUNE_GRID, 2, 8)
-    typedef ToUniquePtr<Grid>       UniquePtrType;
-#else
     using UniquePtrType = std::unique_ptr<Grid>;
-#endif
 
     /** \brief Default constructor */
     explicit GridFactory ( const MPICommunicatorType& = MPIHelper::getCommunicator() )