From dcc67bd11d5391c48d2f02c8197570354a80364f Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 27 Feb 2023 09:17:56 +0100 Subject: [PATCH] minimum dune version required is now 2.7 --- examples/problems/waterairproblem.hh | 7 ------- opm/models/nonlinear/newtonmethod.hh | 6 +----- opm/models/nonlinear/nullconvergencewriter.hh | 2 ++ opm/models/utils/simulator.hh | 13 ++----------- .../linalg/istlpreconditionerwrappers.hh | 7 ------- opm/simulators/linalg/matrixblock.hh | 4 ---- .../linalg/overlappingscalarproduct.hh | 18 ------------------ opm/simulators/linalg/parallelamgbackend.hh | 11 +++-------- opm/simulators/linalg/parallelbasebackend.hh | 11 ----------- opm/simulators/linalg/parallelistlbackend.hh | 6 ------ 10 files changed, 8 insertions(+), 77 deletions(-) diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index 51f8fedfc..1508fa285 100644 --- a/examples/problems/waterairproblem.hh +++ b/examples/problems/waterairproblem.hh @@ -47,7 +47,6 @@ #include #include -#include #include #include @@ -157,15 +156,9 @@ template struct LinearSolverWrapper { using type = Opm::Linear::SolverWrapperRestartedGMRes; }; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) template struct PreconditionerWrapper { using type = Opm::Linear::PreconditionerWrapperILU; }; -#else -template -struct PreconditionerWrapper -{ using type = Opm::Linear::PreconditionerWrapperILUn; }; -#endif template struct PreconditionerOrder { static constexpr int value = 2; }; diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index d3dbc73b8..df85b45e9 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -35,6 +35,7 @@ #include +#include #include #include @@ -42,7 +43,6 @@ #include #include -#include #include #include @@ -127,11 +127,7 @@ class NewtonMethod using ConvergenceWriter = GetPropType; using Communicator = typename Dune::MPIHelper::MPICommunicator; -#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) using CollectiveCommunication = typename Dune::Communication; -#else - using CollectiveCommunication = Dune::CollectiveCommunication; -#endif public: NewtonMethod(Simulator& simulator) diff --git a/opm/models/nonlinear/nullconvergencewriter.hh b/opm/models/nonlinear/nullconvergencewriter.hh index 6ee4a09c7..9fce0d4eb 100644 --- a/opm/models/nonlinear/nullconvergencewriter.hh +++ b/opm/models/nonlinear/nullconvergencewriter.hh @@ -28,7 +28,9 @@ #ifndef EWOMS_NULL_CONVERGENCE_WRITER_HH #define EWOMS_NULL_CONVERGENCE_WRITER_HH +#include #include + #include namespace Opm::Properties { diff --git a/opm/models/utils/simulator.hh b/opm/models/utils/simulator.hh index 208081808..601046d56 100644 --- a/opm/models/utils/simulator.hh +++ b/opm/models/utils/simulator.hh @@ -31,13 +31,13 @@ #include #include +#include #include #include #include #include #include -#include #include #include @@ -53,11 +53,7 @@ namespace detail { inline auto getMPIHelperCommunication() { -#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) return Dune::MPIHelper::getCommunication(); -#else - return Dune::MPIHelper::getCollectiveCommunication(); -#endif } } // end namespace detail } // end namespace Opm @@ -111,12 +107,7 @@ class Simulator using Problem = GetPropType; using MPIComm = typename Dune::MPIHelper::MPICommunicator; - #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) - using Communication = Dune::Communication; - #else - using Communication = Dune::CollectiveCommunication; - #endif - + using Communication = Dune::Communication; public: // do not allow to copy simulators around diff --git a/opm/simulators/linalg/istlpreconditionerwrappers.hh b/opm/simulators/linalg/istlpreconditionerwrappers.hh index 1404066fb..de88b3dac 100644 --- a/opm/simulators/linalg/istlpreconditionerwrappers.hh +++ b/opm/simulators/linalg/istlpreconditionerwrappers.hh @@ -145,8 +145,6 @@ EWOMS_WRAP_ISTL_PRECONDITIONER(GaussSeidel, Dune::SeqGS) EWOMS_WRAP_ISTL_PRECONDITIONER(SOR, Dune::SeqSOR) EWOMS_WRAP_ISTL_PRECONDITIONER(SSOR, Dune::SeqSSOR) -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) - // we need a custom preconditioner wrapper for ILU because the Dune::SeqILU class uses a // non-standard extra template parameter to specify its order. template @@ -188,11 +186,6 @@ private: SequentialPreconditioner *seqPreCond_; }; -#else -EWOMS_WRAP_ISTL_SIMPLE_PRECONDITIONER(ILU0, Dune::SeqILU0) -EWOMS_WRAP_ISTL_PRECONDITIONER(ILUn, Dune::SeqILUn) -#endif - #undef EWOMS_WRAP_ISTL_PRECONDITIONER }} // namespace Linear, Opm diff --git a/opm/simulators/linalg/matrixblock.hh b/opm/simulators/linalg/matrixblock.hh index 7626f0903..1f84bcfe0 100644 --- a/opm/simulators/linalg/matrixblock.hh +++ b/opm/simulators/linalg/matrixblock.hh @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -218,9 +217,6 @@ static inline void invertMatrix(Dune::DynamicMatrix& matrix) return; } -#if ! DUNE_VERSION_NEWER( DUNE_COMMON, 2, 7 ) - Dune::FMatrixPrecision::set_singular_limit(1.e-30); -#endif matrix.invert(); } diff --git a/opm/simulators/linalg/overlappingscalarproduct.hh b/opm/simulators/linalg/overlappingscalarproduct.hh index a04325386..0b8469a3c 100644 --- a/opm/simulators/linalg/overlappingscalarproduct.hh +++ b/opm/simulators/linalg/overlappingscalarproduct.hh @@ -27,7 +27,6 @@ #ifndef EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH #define EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH -#include #include #include @@ -44,11 +43,7 @@ class OverlappingScalarProduct public: using field_type = typename OverlappingBlockVector::field_type; -#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) using CollectiveCommunication = typename Dune::Communication; -#else - using CollectiveCommunication = typename Dune::CollectiveCommunication; -#endif using real_type = typename Dune::ScalarProduct::real_type; //! the kind of computations supported by the operator. Either overlapping or non-overlapping @@ -57,20 +52,11 @@ public: OverlappingScalarProduct(const Overlap& overlap) : overlap_(overlap), -#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) comm_( Dune::MPIHelper::getCommunication() ) -#else - comm_( Dune::MPIHelper::getCollectiveCommunication() ) -#endif {} -#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(); @@ -83,11 +69,7 @@ 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: diff --git a/opm/simulators/linalg/parallelamgbackend.hh b/opm/simulators/linalg/parallelamgbackend.hh index 441ed2593..1a177d8ee 100644 --- a/opm/simulators/linalg/parallelamgbackend.hh +++ b/opm/simulators/linalg/parallelamgbackend.hh @@ -38,9 +38,9 @@ #include #include -#include - -#include +#include +#include +#include namespace Opm::Linear { template @@ -109,12 +109,7 @@ class ParallelAmgBackend : public ParallelBaseBackend using SequentialSmoother = Dune::SeqSOR; // using SequentialSmoother = Dune::SeqSSOR; // using SequentialSmoother = Dune::SeqJac; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) // using SequentialSmoother = Dune::SeqILU; -#else -// using SequentialSmoother = Dune::SeqILU0; -// using SequentialSmoother = Dune::SeqILUn; -#endif #if HAVE_MPI using OwnerOverlapCopyCommunication = Dune::OwnerOverlapCopyCommunication; diff --git a/opm/simulators/linalg/parallelbasebackend.hh b/opm/simulators/linalg/parallelbasebackend.hh index 6d8537841..3319a3a18 100644 --- a/opm/simulators/linalg/parallelbasebackend.hh +++ b/opm/simulators/linalg/parallelbasebackend.hh @@ -251,11 +251,6 @@ public: */ bool solve(Vector& x) { -#if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2,7) - Dune::FMatrixPrecision::set_singular_limit(1.e-30); - Dune::FMatrixPrecision::set_absolute_limit(1.e-30); -#endif - (*overlappingx_) = 0.0; auto parPreCond = asImp_().preparePreconditioner_(); @@ -459,15 +454,9 @@ struct OverlappingLinearOperator OverlappingVector>; }; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) template struct PreconditionerWrapper { using type = Opm::Linear::PreconditionerWrapperILU; }; -#else -template -struct PreconditionerWrapper -{ using type = Opm::Linear::PreconditionerWrapperILU0; }; -#endif //! set the default overlap size to 2 template diff --git a/opm/simulators/linalg/parallelistlbackend.hh b/opm/simulators/linalg/parallelistlbackend.hh index 0710e5ce1..13b90fb80 100644 --- a/opm/simulators/linalg/parallelistlbackend.hh +++ b/opm/simulators/linalg/parallelistlbackend.hh @@ -152,15 +152,9 @@ template struct LinearSolverWrapper { using type = Opm::Linear::SolverWrapperBiCGStab; }; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) template struct PreconditionerWrapper { using type = Opm::Linear::PreconditionerWrapperILU; }; -#else -template -struct PreconditionerWrapper -{ using type = Opm::Linear::PreconditionerWrapperILU0; }; -#endif //! set the GMRes restart parameter to 10 by default template