mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 09:16:27 -06:00
minimum dune version required is now 2.7
This commit is contained in:
parent
acf5ef823b
commit
dcc67bd11d
@ -47,7 +47,6 @@
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@ -157,15 +156,9 @@ template<class TypeTag>
|
||||
struct LinearSolverWrapper<TypeTag, TTag::WaterAirBaseProblem>
|
||||
{ using type = Opm::Linear::SolverWrapperRestartedGMRes<TypeTag>; };
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
|
||||
template<class TypeTag>
|
||||
struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
|
||||
{ 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>
|
||||
struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; };
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
|
||||
#include <opm/models/discretization/common/fvbaseproperties.hh>
|
||||
#include <opm/models/utils/timer.hh>
|
||||
#include <opm/models/utils/timerguard.hh>
|
||||
|
||||
@ -42,7 +43,6 @@
|
||||
|
||||
#include <dune/istl/istlexception.hh>
|
||||
#include <dune/common/classname.hh>
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/common/parallel/mpihelper.hh>
|
||||
|
||||
#include <iostream>
|
||||
@ -127,11 +127,7 @@ class NewtonMethod
|
||||
using ConvergenceWriter = GetPropType<TypeTag, Properties::NewtonConvergenceWriter>;
|
||||
|
||||
using Communicator = typename Dune::MPIHelper::MPICommunicator;
|
||||
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||
using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>;
|
||||
#else
|
||||
using CollectiveCommunication = Dune::CollectiveCommunication<Communicator>;
|
||||
#endif
|
||||
|
||||
public:
|
||||
NewtonMethod(Simulator& simulator)
|
||||
|
@ -28,7 +28,9 @@
|
||||
#ifndef 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/simulators/linalg/linalgproperties.hh>
|
||||
|
||||
namespace Opm::Properties {
|
||||
|
@ -31,13 +31,13 @@
|
||||
#include <opm/models/io/restart.hh>
|
||||
#include <opm/models/utils/parametersystem.hh>
|
||||
|
||||
#include <opm/models/utils/basicproperties.hh>
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
#include <opm/models/utils/timer.hh>
|
||||
#include <opm/models/utils/timerguard.hh>
|
||||
#include <opm/models/parallel/mpiutil.hh>
|
||||
#include <opm/models/discretization/common/fvbaseproperties.hh>
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/common/parallel/mpihelper.hh>
|
||||
|
||||
#include <iostream>
|
||||
@ -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<TypeTag, Properties::Problem>;
|
||||
|
||||
using MPIComm = typename Dune::MPIHelper::MPICommunicator;
|
||||
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
|
||||
using Communication = Dune::Communication<MPIComm>;
|
||||
#else
|
||||
using Communication = Dune::CollectiveCommunication<MPIComm>;
|
||||
#endif
|
||||
|
||||
using Communication = Dune::Communication<MPIComm>;
|
||||
|
||||
public:
|
||||
// do not allow to copy simulators around
|
||||
|
@ -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 <class TypeTag>
|
||||
@ -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
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include <dune/common/dynmatrix.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/common/typetraits.hh>
|
||||
|
||||
#include <dune/istl/superlu.hh>
|
||||
@ -218,9 +217,6 @@ static inline void invertMatrix(Dune::DynamicMatrix<K>& matrix)
|
||||
return;
|
||||
}
|
||||
|
||||
#if ! DUNE_VERSION_NEWER( DUNE_COMMON, 2, 7 )
|
||||
Dune::FMatrixPrecision<K>::set_singular_limit(1.e-30);
|
||||
#endif
|
||||
matrix.invert();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
#ifndef EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH
|
||||
#define EWOMS_OVERLAPPING_SCALAR_PRODUCT_HH
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
#include <dune/common/parallel/mpihelper.hh>
|
||||
#include <dune/istl/scalarproducts.hh>
|
||||
|
||||
@ -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<typename Dune::MPIHelper::MPICommunicator>;
|
||||
#else
|
||||
using CollectiveCommunication = typename Dune::CollectiveCommunication<typename Dune::MPIHelper::MPICommunicator>;
|
||||
#endif
|
||||
using real_type = typename Dune::ScalarProduct<OverlappingBlockVector>::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:
|
||||
|
@ -38,9 +38,9 @@
|
||||
#include <dune/istl/paamg/pinfo.hh>
|
||||
#include <dune/istl/owneroverlapcopy.hh>
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
namespace Opm::Linear {
|
||||
template <class TypeTag>
|
||||
@ -109,12 +109,7 @@ class ParallelAmgBackend : public ParallelBaseBackend<TypeTag>
|
||||
using SequentialSmoother = Dune::SeqSOR<IstlMatrix, Vector, Vector>;
|
||||
// using SequentialSmoother = Dune::SeqSSOR<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>;
|
||||
#else
|
||||
// using SequentialSmoother = Dune::SeqILU0<IstlMatrix,Vector,Vector>;
|
||||
// using SequentialSmoother = Dune::SeqILUn<IstlMatrix,Vector,Vector>;
|
||||
#endif
|
||||
|
||||
#if HAVE_MPI
|
||||
using OwnerOverlapCopyCommunication = Dune::OwnerOverlapCopyCommunication<Opm::Linear::Index>;
|
||||
|
@ -251,11 +251,6 @@ public:
|
||||
*/
|
||||
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;
|
||||
|
||||
auto parPreCond = asImp_().preparePreconditioner_();
|
||||
@ -459,15 +454,9 @@ struct OverlappingLinearOperator<TypeTag, TTag::ParallelBaseLinearSolver>
|
||||
OverlappingVector>;
|
||||
};
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
|
||||
template<class TypeTag>
|
||||
struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
|
||||
{ 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
|
||||
template<class TypeTag>
|
||||
|
@ -152,15 +152,9 @@ template<class TypeTag>
|
||||
struct LinearSolverWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
|
||||
{ using type = Opm::Linear::SolverWrapperBiCGStab<TypeTag>; };
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
|
||||
template<class TypeTag>
|
||||
struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
|
||||
{ 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
|
||||
template<class TypeTag>
|
||||
|
Loading…
Reference in New Issue
Block a user