From ce3e5c2dfe303759d84f45e641dc2b76c67c61af Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 17 Sep 2019 18:04:30 +0200 Subject: [PATCH] Adapt to constification of Scalarproduct for 2.7.0 or newer. Scalarproduct::norm and Scalarproduct::dot are const in those versions and these changes are not backwards compatible. --- opm/simulators/linalg/overlappingscalarproduct.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opm/simulators/linalg/overlappingscalarproduct.hh b/opm/simulators/linalg/overlappingscalarproduct.hh index 406053292..8b4933f0b 100644 --- a/opm/simulators/linalg/overlappingscalarproduct.hh +++ b/opm/simulators/linalg/overlappingscalarproduct.hh @@ -64,8 +64,13 @@ public: : overlap_(overlap), comm_( Dune::MPIHelper::getCollectiveCommunication() ) {} +#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) + field_type dot(const OverlappingBlockVector& x, + const OverlappingBlockVector& y) const override +#else field_type dot(const OverlappingBlockVector& x, const OverlappingBlockVector& y) override +#endif { field_type sum = 0; size_t numLocal = overlap_.numLocal(); @@ -78,7 +83,11 @@ public: return comm_.sum( sum ); } +#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) + real_type norm(const OverlappingBlockVector& x) const override +#else real_type norm(const OverlappingBlockVector& x) override +#endif { return std::sqrt(dot(x, x)); } private: