Merge pull request #788 from akva2/require_dune_2.7

minimum dune version required is now 2.7
This commit is contained in:
Arne Morten Kvarving 2023-04-12 11:30:14 +02:00 committed by GitHub
commit 4cb870d7cf
10 changed files with 8 additions and 77 deletions

View File

@ -47,7 +47,6 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/version.hh>
#include <sstream> #include <sstream>
#include <string> #include <string>
@ -157,15 +156,9 @@ template<class TypeTag>
struct LinearSolverWrapper<TypeTag, TTag::WaterAirBaseProblem> struct LinearSolverWrapper<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::Linear::SolverWrapperRestartedGMRes<TypeTag>; }; { using type = Opm::Linear::SolverWrapperRestartedGMRes<TypeTag>; };
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
template<class TypeTag> template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem> struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; }; { using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
#else
template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::Linear::PreconditionerWrapperILUn<TypeTag>; };
#endif
template<class TypeTag> template<class TypeTag>
struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; }; struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; };

View File

@ -35,6 +35,7 @@
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/models/utils/timer.hh> #include <opm/models/utils/timer.hh>
#include <opm/models/utils/timerguard.hh> #include <opm/models/utils/timerguard.hh>
@ -42,7 +43,6 @@
#include <dune/istl/istlexception.hh> #include <dune/istl/istlexception.hh>
#include <dune/common/classname.hh> #include <dune/common/classname.hh>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <iostream> #include <iostream>
@ -127,11 +127,7 @@ class NewtonMethod
using ConvergenceWriter = GetPropType<TypeTag, Properties::NewtonConvergenceWriter>; using ConvergenceWriter = GetPropType<TypeTag, Properties::NewtonConvergenceWriter>;
using Communicator = typename Dune::MPIHelper::MPICommunicator; using Communicator = typename Dune::MPIHelper::MPICommunicator;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>; using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>;
#else
using CollectiveCommunication = Dune::CollectiveCommunication<Communicator>;
#endif
public: public:
NewtonMethod(Simulator& simulator) NewtonMethod(Simulator& simulator)

View File

@ -28,7 +28,9 @@
#ifndef EWOMS_NULL_CONVERGENCE_WRITER_HH #ifndef EWOMS_NULL_CONVERGENCE_WRITER_HH
#define EWOMS_NULL_CONVERGENCE_WRITER_HH #define EWOMS_NULL_CONVERGENCE_WRITER_HH
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/simulators/linalg/linalgproperties.hh> #include <opm/simulators/linalg/linalgproperties.hh>
namespace Opm::Properties { namespace Opm::Properties {

View File

@ -31,13 +31,13 @@
#include <opm/models/io/restart.hh> #include <opm/models/io/restart.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/basicproperties.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/timer.hh> #include <opm/models/utils/timer.hh>
#include <opm/models/utils/timerguard.hh> #include <opm/models/utils/timerguard.hh>
#include <opm/models/parallel/mpiutil.hh> #include <opm/models/parallel/mpiutil.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh> #include <opm/models/discretization/common/fvbaseproperties.hh>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <iostream> #include <iostream>
@ -53,11 +53,7 @@ namespace detail
{ {
inline auto getMPIHelperCommunication() inline auto getMPIHelperCommunication()
{ {
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
return Dune::MPIHelper::getCommunication(); return Dune::MPIHelper::getCommunication();
#else
return Dune::MPIHelper::getCollectiveCommunication();
#endif
} }
} // end namespace detail } // end namespace detail
} // end namespace Opm } // end namespace Opm
@ -111,12 +107,7 @@ class Simulator
using Problem = GetPropType<TypeTag, Properties::Problem>; using Problem = GetPropType<TypeTag, Properties::Problem>;
using MPIComm = typename Dune::MPIHelper::MPICommunicator; using MPIComm = typename Dune::MPIHelper::MPICommunicator;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) using Communication = Dune::Communication<MPIComm>;
using Communication = Dune::Communication<MPIComm>;
#else
using Communication = Dune::CollectiveCommunication<MPIComm>;
#endif
public: public:
// do not allow to copy simulators around // do not allow to copy simulators around

View File

@ -145,8 +145,6 @@ EWOMS_WRAP_ISTL_PRECONDITIONER(GaussSeidel, Dune::SeqGS)
EWOMS_WRAP_ISTL_PRECONDITIONER(SOR, Dune::SeqSOR) EWOMS_WRAP_ISTL_PRECONDITIONER(SOR, Dune::SeqSOR)
EWOMS_WRAP_ISTL_PRECONDITIONER(SSOR, Dune::SeqSSOR) 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 // we need a custom preconditioner wrapper for ILU because the Dune::SeqILU class uses a
// non-standard extra template parameter to specify its order. // non-standard extra template parameter to specify its order.
template <class TypeTag> template <class TypeTag>
@ -188,11 +186,6 @@ private:
SequentialPreconditioner *seqPreCond_; SequentialPreconditioner *seqPreCond_;
}; };
#else
EWOMS_WRAP_ISTL_SIMPLE_PRECONDITIONER(ILU0, Dune::SeqILU0)
EWOMS_WRAP_ISTL_PRECONDITIONER(ILUn, Dune::SeqILUn)
#endif
#undef EWOMS_WRAP_ISTL_PRECONDITIONER #undef EWOMS_WRAP_ISTL_PRECONDITIONER
}} // namespace Linear, Opm }} // namespace Linear, Opm

View File

@ -25,7 +25,6 @@
#include <dune/common/dynmatrix.hh> #include <dune/common/dynmatrix.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/version.hh>
#include <dune/common/typetraits.hh> #include <dune/common/typetraits.hh>
#include <dune/istl/superlu.hh> #include <dune/istl/superlu.hh>
@ -218,9 +217,6 @@ static inline void invertMatrix(Dune::DynamicMatrix<K>& matrix)
return; return;
} }
#if ! DUNE_VERSION_NEWER( DUNE_COMMON, 2, 7 )
Dune::FMatrixPrecision<K>::set_singular_limit(1.e-30);
#endif
matrix.invert(); matrix.invert();
} }

View File

@ -27,7 +27,6 @@
#ifndef EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH #ifndef EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH
#define EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH #define EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <dune/istl/scalarproducts.hh> #include <dune/istl/scalarproducts.hh>
@ -44,11 +43,7 @@ class OverlappingScalarProduct
public: public:
using field_type = typename OverlappingBlockVector::field_type; using field_type = typename OverlappingBlockVector::field_type;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>; using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>;
#else
using CollectiveCommunication = typename Dune::CollectiveCommunication<typename Dune::MPIHelper::MPICommunicator>;
#endif
using real_type = typename Dune::ScalarProduct<OverlappingBlockVector>::real_type; using real_type = typename Dune::ScalarProduct<OverlappingBlockVector>::real_type;
//! the kind of computations supported by the operator. Either overlapping or non-overlapping //! the kind of computations supported by the operator. Either overlapping or non-overlapping
@ -57,20 +52,11 @@ public:
OverlappingScalarProduct(const Overlap& overlap) OverlappingScalarProduct(const Overlap& overlap)
: overlap_(overlap), : overlap_(overlap),
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
comm_( Dune::MPIHelper::getCommunication() ) comm_( Dune::MPIHelper::getCommunication() )
#else
comm_( Dune::MPIHelper::getCollectiveCommunication() )
#endif
{} {}
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
field_type dot(const OverlappingBlockVector& x, field_type dot(const OverlappingBlockVector& x,
const OverlappingBlockVector& y) const override const OverlappingBlockVector& y) const override
#else
field_type dot(const OverlappingBlockVector& x,
const OverlappingBlockVector& y) override
#endif
{ {
field_type sum = 0; field_type sum = 0;
size_t numLocal = overlap_.numLocal(); size_t numLocal = overlap_.numLocal();
@ -83,11 +69,7 @@ public:
return comm_.sum( sum ); return comm_.sum( sum );
} }
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
real_type norm(const OverlappingBlockVector& x) const override real_type norm(const OverlappingBlockVector& x) const override
#else
real_type norm(const OverlappingBlockVector& x) override
#endif
{ return std::sqrt(dot(x, x)); } { return std::sqrt(dot(x, x)); }
private: private:

View File

@ -38,9 +38,9 @@
#include <dune/istl/paamg/pinfo.hh> #include <dune/istl/paamg/pinfo.hh>
#include <dune/istl/owneroverlapcopy.hh> #include <dune/istl/owneroverlapcopy.hh>
#include <dune/common/version.hh> #include <memory>
#include <tuple>
#include <iostream> #include <utility>
namespace Opm::Linear { namespace Opm::Linear {
template <class TypeTag> template <class TypeTag>
@ -109,12 +109,7 @@ class ParallelAmgBackend : public ParallelBaseBackend<TypeTag>
using SequentialSmoother = Dune::SeqSOR<IstlMatrix, Vector, Vector>; using SequentialSmoother = Dune::SeqSOR<IstlMatrix, Vector, Vector>;
// using SequentialSmoother = Dune::SeqSSOR<IstlMatrix,Vector,Vector>; // using SequentialSmoother = Dune::SeqSSOR<IstlMatrix,Vector,Vector>;
// using SequentialSmoother = Dune::SeqJac<IstlMatrix,Vector,Vector>; // using SequentialSmoother = Dune::SeqJac<IstlMatrix,Vector,Vector>;
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
// using SequentialSmoother = Dune::SeqILU<IstlMatrix,Vector,Vector>; // using SequentialSmoother = Dune::SeqILU<IstlMatrix,Vector,Vector>;
#else
// using SequentialSmoother = Dune::SeqILU0<IstlMatrix,Vector,Vector>;
// using SequentialSmoother = Dune::SeqILUn<IstlMatrix,Vector,Vector>;
#endif
#if HAVE_MPI #if HAVE_MPI
using OwnerOverlapCopyCommunication = Dune::OwnerOverlapCopyCommunication<Opm::Linear::Index>; using OwnerOverlapCopyCommunication = Dune::OwnerOverlapCopyCommunication<Opm::Linear::Index>;

View File

@ -251,11 +251,6 @@ public:
*/ */
bool solve(Vector& x) bool solve(Vector& x)
{ {
#if ! DUNE_VERSION_NEWER(DUNE_COMMON, 2,7)
Dune::FMatrixPrecision<LinearSolverScalar>::set_singular_limit(1.e-30);
Dune::FMatrixPrecision<LinearSolverScalar>::set_absolute_limit(1.e-30);
#endif
(*overlappingx_) = 0.0; (*overlappingx_) = 0.0;
auto parPreCond = asImp_().preparePreconditioner_(); auto parPreCond = asImp_().preparePreconditioner_();
@ -459,15 +454,9 @@ struct OverlappingLinearOperator<TypeTag, TTag::ParallelBaseLinearSolver>
OverlappingVector>; OverlappingVector>;
}; };
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
template<class TypeTag> template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver> struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; }; { using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
#else
template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
{ using type = Opm::Linear::PreconditionerWrapperILU0<TypeTag>; };
#endif
//! set the default overlap size to 2 //! set the default overlap size to 2
template<class TypeTag> template<class TypeTag>

View File

@ -152,15 +152,9 @@ template<class TypeTag>
struct LinearSolverWrapper<TypeTag, TTag::ParallelIstlLinearSolver> struct LinearSolverWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
{ using type = Opm::Linear::SolverWrapperBiCGStab<TypeTag>; }; { using type = Opm::Linear::SolverWrapperBiCGStab<TypeTag>; };
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
template<class TypeTag> template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver> struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; }; { using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
#else
template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
{ using type = Opm::Linear::PreconditionerWrapperILU0<TypeTag>; };
#endif
//! set the GMRes restart parameter to 10 by default //! set the GMRes restart parameter to 10 by default
template<class TypeTag> template<class TypeTag>