From: Markus Blatt <markus@dr-blatt.de>
Date: Thu, 3 Oct 2024 10:53:34 +0200
Subject: use Grid::CollectiveCommunication with DUNE < 2.9

Those versions lack Grid::Communication.
---
 opm/simulators/flow/CollectDataOnIORank.hpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/opm/simulators/flow/CollectDataOnIORank.hpp b/opm/simulators/flow/CollectDataOnIORank.hpp
index 76aa81f..5086f2d 100644
--- a/opm/simulators/flow/CollectDataOnIORank.hpp
+++ b/opm/simulators/flow/CollectDataOnIORank.hpp
@@ -36,6 +36,8 @@
 #include <opm/simulators/flow/FlowsData.hpp>
 #include <opm/simulators/flow/InterRegFlows.hpp>
 
+#include <dune/common/version.hh>
+
 #include <array>
 #include <cstddef>
 #include <map>
@@ -55,7 +57,11 @@ template <class Grid, class EquilGrid, class GridView>
 class CollectDataOnIORank
 {
 public:
+#if DUNE_VERSION_GTE(DUNE_GRID, 2, 9)
     using CollectiveCommunication = typename Grid::Communication;
+#else
+    using CollectiveCommunication = typename Grid::CollectiveCommunication;
+#endif
     using P2PCommunicatorType = Dune::Point2PointCommunicator<Dune::SimpleMessageBuffer>;
     using IndexMapType = std::vector<int>;
     using IndexMapStorageType = std::vector<IndexMapType>;
