diff --git a/dune.module b/dune.module index 01df44b44..f2546d468 100644 --- a/dune.module +++ b/dune.module @@ -10,4 +10,4 @@ Label: 2020.04-pre Maintainer: atgeirr@sintef.no MaintainerName: Atgeirr F. Rasmussen Url: http://opm-project.org -Depends: dune-istl (>= 2.4) opm-common opm-material opm-grid opm-models +Depends: dune-istl (>= 2.6) opm-common opm-material opm-grid opm-models diff --git a/ebos/collecttoiorank.hh b/ebos/collecttoiorank.hh index 3710ebf5b..fefc38e58 100644 --- a/ebos/collecttoiorank.hh +++ b/ebos/collecttoiorank.hh @@ -306,13 +306,8 @@ public: typedef typename Vanguard::GridView LocalGridView; const LocalGridView localGridView = vanguard.gridView(); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) typedef Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; ElementMapper elemMapper(localGridView, Dune::mcmgElementLayout()); -#else - typedef Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; - ElementMapper elemMapper(localGridView); -#endif localIdxToGlobalIdx_.resize(localGridView.size(0), -1); @@ -325,13 +320,8 @@ public: globalCartesianIndex_.resize(globalSize, -1); const EquilGridView equilGridView = vanguard.equilGrid().leafGridView(); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) typedef Dune::MultipleCodimMultipleGeomTypeMapper EquilElementMapper; EquilElementMapper equilElemMapper(equilGridView, Dune::mcmgElementLayout()); -#else - typedef Dune::MultipleCodimMultipleGeomTypeMapper EquilElementMapper; - EquilElementMapper equilElemMapper(equilGridView); -#endif // Scatter the global index to local index for lookup during restart ElementIndexScatterHandle handle(equilElemMapper, elemMapper, localIdxToGlobalIdx_); diff --git a/ebos/eclcpgridvanguard.hh b/ebos/eclcpgridvanguard.hh index 2eff72789..6e26ba43d 100644 --- a/ebos/eclcpgridvanguard.hh +++ b/ebos/eclcpgridvanguard.hh @@ -162,11 +162,7 @@ public: const auto& gridView = grid_->leafGridView(); unsigned numFaces = grid_->numFaces(); std::vector faceTrans(numFaces, 0.0); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) ElementMapper elemMapper(this->gridView(), Dune::mcmgElementLayout()); -#else - ElementMapper elemMapper(this->gridView()); -#endif auto elemIt = gridView.template begin(); const auto& elemEndIt = gridView.template end(); for (; elemIt != elemEndIt; ++ elemIt) { diff --git a/ebos/ecltracermodel.hh b/ebos/ecltracermodel.hh index 2cfa53a6e..c9a15578b 100644 --- a/ebos/ecltracermodel.hh +++ b/ebos/ecltracermodel.hh @@ -414,11 +414,7 @@ protected: typedef Dune::BiCGSTABSolver TracerSolver; typedef Dune::MatrixAdapter TracerOperator; typedef Dune::SeqScalarProduct< TracerVector > TracerScalarProduct ; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,6) typedef Dune::SeqILU< TracerMatrix, TracerVector, TracerVector > TracerPreconditioner; -#else - typedef Dune::SeqILUn< TracerMatrix, TracerVector, TracerVector > TracerPreconditioner; -#endif TracerOperator tracerOperator(M); TracerScalarProduct tracerScalarProduct; diff --git a/ebos/ecltransmissibility.hh b/ebos/ecltransmissibility.hh index 4af6d7278..ea86a999a 100644 --- a/ebos/ecltransmissibility.hh +++ b/ebos/ecltransmissibility.hh @@ -133,11 +133,7 @@ public: const auto& eclGrid = eclState.getInputGrid(); const auto& cartDims = cartMapper.cartesianDimensions(); auto& transMult = eclState.getTransMult(); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) ElementMapper elemMapper(gridView, Dune::mcmgElementLayout()); -#else - ElementMapper elemMapper(gridView); -#endif // get the ntg values, the ntg values are modified for the cells merged with minpv std::vector ntg; @@ -491,11 +487,7 @@ private: const auto& gridView = vanguard_.gridView(); const auto& cartMapper = vanguard_.cartesianIndexMapper(); const auto& cartDims = cartMapper.cartesianDimensions(); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) ElementMapper elemMapper(gridView, Dune::mcmgElementLayout()); -#else - ElementMapper elemMapper(gridView); -#endif const auto& fp = vanguard_.eclState().fieldProps(); const auto& inputTranxData = fp.get_global_double("TRANX"); diff --git a/ebos/eclwriter.hh b/ebos/eclwriter.hh index 67914a30c..75c7fe470 100644 --- a/ebos/eclwriter.hh +++ b/ebos/eclwriter.hh @@ -496,13 +496,8 @@ private: typedef typename EquilGrid :: LeafGridView GlobalGridView; const GlobalGridView& globalGridView = globalGrid().leafGridView(); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) typedef Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; ElementMapper globalElemMapper(globalGridView, Dune::mcmgElementLayout()); -#else - typedef Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; - ElementMapper globalElemMapper(globalGridView); -#endif const EclTransmissibility* globalTrans; @@ -603,15 +598,9 @@ private: typedef typename EquilGrid :: LeafGridView GlobalGridView; const GlobalGridView& globalGridView = globalGrid().leafGridView(); -#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6) typedef Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; ElementMapper globalElemMapper(globalGridView, Dune::mcmgElementLayout()); -#else - typedef Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; - ElementMapper globalElemMapper(globalGridView); -#endif - const EclTransmissibility* globalTrans; if (!collectToIORank_.isParallel()) { // in the sequential case we must use the transmissibilites defined by diff --git a/ebos/femcpgridcompat.hh b/ebos/femcpgridcompat.hh index a4c3100db..b6585025d 100644 --- a/ebos/femcpgridcompat.hh +++ b/ebos/femcpgridcompat.hh @@ -49,21 +49,6 @@ class EntityPointer; // specialization of dune-fem compatiblity functions for CpGrid, since CpGrid does not use the interface classes. namespace Fem { -//////////////////////////////////////////////////////////// -// -// make_entity for CpGrid entities -// -//////////////////////////////////////////////////////////// -#if ! DUNE_VERSION_NEWER(DUNE_GRID, 2, 6) -template -inline Dune::cpgrid::Entity make_entity(const Dune::cpgrid::EntityPointer& entityPointer) -{ return *entityPointer; } - -template -inline Dune::cpgrid::Entity make_entity(Dune::cpgrid::Entity entity) -{ return std::move(entity); } -#endif - //////////////////////////////////////////////////////////// // // GridEntityAccess for CpGrid entities diff --git a/flow/flow_blackoil_dunecpr.cpp b/flow/flow_blackoil_dunecpr.cpp index f8104be48..e147cedce 100644 --- a/flow/flow_blackoil_dunecpr.cpp +++ b/flow/flow_blackoil_dunecpr.cpp @@ -21,11 +21,7 @@ #include "config.h" #include "flow/flow_tag.hpp" -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) #include -#else -#include -#endif BEGIN_PROPERTIES NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem)); @@ -82,11 +78,7 @@ namespace Opm { //SET_TYPE_PROP(EclFlowProblemSimple, LinearSolverBackend, Opm::Linear::ParallelBiCGStabSolverBackend);//not work //SET_TYPE_PROP(EclFlowProblemSimple, LinearSolverBackend, Opm::Linear::SuperLUBackend)//not work //SET_TAG_PROP(EclFlowProblem, FluidState, Opm::BlackOilFluidState); -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) SET_TYPE_PROP(EclFlowProblemSimple, LinearSolverBackend, Opm::ISTLSolverEbosFlexible); -#else - SET_TYPE_PROP(EclFlowProblemSimple, LinearSolverBackend, Opm::ISTLSolverEbosCpr); -#endif SET_BOOL_PROP(EclFlowProblemSimple, EnableStorageCache, true); SET_BOOL_PROP(EclFlowProblemSimple, EnableIntensiveQuantityCache, true); diff --git a/opm/simulators/linalg/BlackoilAmg.hpp b/opm/simulators/linalg/BlackoilAmg.hpp index c0fe84ad8..cd99faeab 100644 --- a/opm/simulators/linalg/BlackoilAmg.hpp +++ b/opm/simulators/linalg/BlackoilAmg.hpp @@ -406,25 +406,18 @@ private: amg_->updateSolver(crit_, op_, comm_); } -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::SolverCategory::Category category() const override { return std::is_same::value ? Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping; } -#endif void apply(X& x, X& b, double reduction, Dune::InverseOperatorResult& res) override { DUNE_UNUSED_PARAMETER(reduction); DUNE_UNUSED_PARAMETER(res); -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) auto sp = Dune::createScalarProduct(comm_, op_.category()); -#else - using Chooser = Dune::ScalarProductChooser; - auto sp = Chooser::construct(comm_); -#endif Dune::Preconditioner* prec = amg_.get(); if ( ! amg_ ) { @@ -440,88 +433,27 @@ private: if ( param_->cpr_ell_solvetype_ == 0) { -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::BiCGSTABSolver solver(const_cast(op_), *sp, *prec, tolerance, maxit, verbosity); solver.apply(x,b,res); -#else - // Category of preconditioner will be checked at compile time. Therefore we need - // to cast to the derived class - if ( !amg_ ) - { - Dune::BiCGSTABSolver solver(const_cast(op_), *sp, - reinterpret_cast(*prec), - tolerance, maxit, verbosity); - solver.apply(x,b,res); - } - else - { - Dune::BiCGSTABSolver solver(const_cast(op_), *sp, - reinterpret_cast(*prec), - tolerance, maxit, verbosity); - solver.apply(x,b,res); - } -#endif } else if (param_->cpr_ell_solvetype_ == 1) { -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::CGSolver solver(const_cast(op_), *sp, *prec, tolerance, maxit, verbosity); solver.apply(x,b,res); -#else - // Category of preconditioner will be checked at compile time. Therefore we need - // to cast to the derived class - if ( !amg_ ) - { - Dune::CGSolver solver(const_cast(op_), *sp, - reinterpret_cast(*prec), - tolerance, maxit, verbosity); - solver.apply(x,b,res); - } - else - { - Dune::CGSolver solver(const_cast(op_), *sp, - reinterpret_cast(*prec), - tolerance, maxit, verbosity); - solver.apply(x,b,res); - } -#endif } else { -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::LoopSolver solver(const_cast(op_), *sp, *prec, tolerance, maxit, verbosity); solver.apply(x,b,res); -#else - if ( !amg_ ) - { - Dune::LoopSolver solver(const_cast(op_), *sp, - reinterpret_cast(*prec), - tolerance, maxit, verbosity); - solver.apply(x,b,res); - } - else - { - Dune::LoopSolver solver(const_cast(op_), *sp, - reinterpret_cast(*prec), - tolerance, maxit, verbosity); - solver.apply(x,b,res); - } - -#endif } // Warn if unknown options. if (param_->cpr_ell_solvetype_ > 2 && comm_.communicator().rank() == 0) { OpmLog::warning("cpr_ell_solver_type_unknown", "Unknown CPR elliptic solver type specification, using LoopSolver."); } - - -#if ! DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) - delete sp; -#endif } void apply(X& x, X& b, Dune::InverseOperatorResult& res) override @@ -742,11 +674,7 @@ public: if ( cpr_pressure_aggregation_ ) { -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) typedef Dune::Amg::PropertiesGraphCreator GraphCreator; -#else - typedef Dune::Amg::PropertiesGraphCreator GraphCreator; -#endif typedef typename GraphCreator::PropertiesGraph PropertiesGraph; typedef typename GraphCreator::GraphTuple GraphTuple; @@ -1025,19 +953,12 @@ protected: CoarseSolverPolicy, Smoother>; public: -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::SolverCategory::Category category() const override { return std::is_same::value ? Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping; } -#else - // define the category - enum { - //! \brief The category the precondtioner is part of. - category = Operator::category - }; -#endif + /** * \brief Constructor. * \param param The parameters used for configuring the solver. diff --git a/opm/simulators/linalg/BlackoilAmgCpr.hpp b/opm/simulators/linalg/BlackoilAmgCpr.hpp index a3b91cc50..a8fbe6ac0 100644 --- a/opm/simulators/linalg/BlackoilAmgCpr.hpp +++ b/opm/simulators/linalg/BlackoilAmgCpr.hpp @@ -95,19 +95,11 @@ namespace Opm CoarseSolverPolicy, Smoother>; public: -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::SolverCategory::Category category() const override { return std::is_same::value ? Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping; } -#else - // define the category - enum { - //! \brief The category the precondtioner is part of. - category = Operator::category - }; -#endif /** * \brief Constructor. diff --git a/opm/simulators/linalg/CPRPreconditioner.hpp b/opm/simulators/linalg/CPRPreconditioner.hpp index fa31581aa..df1432c01 100644 --- a/opm/simulators/linalg/CPRPreconditioner.hpp +++ b/opm/simulators/linalg/CPRPreconditioner.hpp @@ -305,19 +305,11 @@ createAMGPreconditionerPointer( Op& opA, const double relax, const MILU_VARIANT typedef typename X::field_type field_type; // define the category -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::SolverCategory::Category category() const override { return std::is_same::value ? Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping; } -#else - enum { - //! \brief The category the preconditioner is part of. - category = std::is_same::value? - Dune::SolverCategory::sequential:Dune::SolverCategory::overlapping - }; -#endif typedef ISTLUtility::CPRSelector CPRSelectorType ; @@ -447,15 +439,7 @@ createAMGPreconditionerPointer( Op& opA, const double relax, const MILU_VARIANT Dune::InverseOperatorResult result; // the scalar product chooser -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) auto sp = Dune::createScalarProduct(commAe_, category()); -#else - typedef Dune::ScalarProductChooser - ScalarProductChooser; - // the scalar product. - std::unique_ptr - sp(ScalarProductChooser::construct(commAe_)); -#endif if( amg_ ) { diff --git a/opm/simulators/linalg/ISTLSolverEbos.hpp b/opm/simulators/linalg/ISTLSolverEbos.hpp index 77abb629c..0bf6f06ec 100644 --- a/opm/simulators/linalg/ISTLSolverEbos.hpp +++ b/opm/simulators/linalg/ISTLSolverEbos.hpp @@ -113,20 +113,11 @@ public: typedef Dune::CollectiveCommunication< int > communication_type; #endif -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::SolverCategory::Category category() const override { return overlapping ? Dune::SolverCategory::overlapping : Dune::SolverCategory::sequential; } -#else - enum { - //! \brief The solver category. - category = overlapping ? - Dune::SolverCategory::overlapping : - Dune::SolverCategory::sequential - }; -#endif //! constructor: just store a reference to a matrix WellModelMatrixAdapter (const M& A, @@ -390,25 +381,15 @@ protected: /// \brief construct the CPR preconditioner and the solver. /// \tparam P The type of the parallel information. /// \param parallelInformation the information about the parallelization. -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) template -#else - template -#endif void constructPreconditionerAndSolve(LinearOperator& linearOperator, Vector& x, Vector& istlb, const POrComm& parallelInformation_arg, Dune::InverseOperatorResult& result) const { // Construct scalar product. -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) auto sp = Dune::createScalarProduct(parallelInformation_arg, category); -#else - typedef Dune::ScalarProductChooser ScalarProductChooser; - typedef std::unique_ptr SPPointer; - SPPointer sp(ScalarProductChooser::construct(parallelInformation_arg)); -#endif #if FLOW_SUPPORT_AMG // activate AMG if either flow_ebos is used or UMFPack is not available if( parameters_.linear_solver_use_amg_ || parameters_.use_cpr_) @@ -509,16 +490,9 @@ protected: #if HAVE_MPI typedef Dune::OwnerOverlapCopyCommunication Comm; -#if DUNE_VERSION_NEWER_REV(DUNE_ISTL, 2 , 5, 1) // 3x3 matrix block inversion was unstable from at least 2.3 until and // including 2.5.0 typedef ParallelOverlappingILU0 ParPreconditioner; -#else - typedef ParallelOverlappingILU0 >, - Vector, Vector, Comm> ParPreconditioner; -#endif template std::unique_ptr constructPrecond(Operator& opA, const Comm& comm) const diff --git a/opm/simulators/linalg/ISTLSolverEbosCpr.hpp b/opm/simulators/linalg/ISTLSolverEbosCpr.hpp index dd99c7ce7..3adcccfec 100644 --- a/opm/simulators/linalg/ISTLSolverEbosCpr.hpp +++ b/opm/simulators/linalg/ISTLSolverEbosCpr.hpp @@ -149,17 +149,9 @@ namespace Opm } } -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) constexpr Dune::SolverCategory::Category category=Dune::SolverCategory::overlapping; auto sp = Dune::createScalarProduct(*comm_, category); sp_ = std::move(sp); -#else - constexpr int category = Dune::SolverCategory::overlapping; - typedef Dune::ScalarProductChooser ScalarProductChooser; - typedef std::unique_ptr SPPointer; - SPPointer sp(ScalarProductChooser::construct(*comm_)); - sp_ = std::move(sp); -#endif using AMGOperator = Dune::OverlappingSchwarzOperator; // If clause is always execute as as Linearoperator is WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, false|true>; @@ -183,17 +175,9 @@ namespace Opm POrCommType parallelInformation_arg; typedef OperatorSerial LinearOperator; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) constexpr Dune::SolverCategory::Category category=Dune::SolverCategory::sequential; auto sp = Dune::createScalarProduct(parallelInformation_arg, category); sp_ = std::move(sp); -#else - constexpr int category = Dune::SolverCategory::sequential; - typedef Dune::ScalarProductChooser ScalarProductChooser; - typedef std::unique_ptr SPPointer; - SPPointer sp(ScalarProductChooser::construct(parallelInformation_arg)); - sp_ = std::move(sp); -#endif // If clause is always execute as as Linearoperator is WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, false|true>; if( ! std::is_same< LinearOperator, MatrixAdapter > :: value && diff --git a/opm/simulators/linalg/ParallelOverlappingILU0.hpp b/opm/simulators/linalg/ParallelOverlappingILU0.hpp index de3048c81..b990322e6 100644 --- a/opm/simulators/linalg/ParallelOverlappingILU0.hpp +++ b/opm/simulators/linalg/ParallelOverlappingILU0.hpp @@ -605,22 +605,12 @@ protected: }; public: -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) Dune::SolverCategory::Category category() const override { return std::is_same::value ? Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping; } -#else - // define the category - enum { - //! \brief The category the preconditioner is part of. - category = std::is_same::value ? - Dune::SolverCategory::sequential : Dune::SolverCategory::overlapping - }; -#endif - /*! \brief Constructor. Constructor gets all parameters to operate the prec. diff --git a/opm/simulators/linalg/amgcpr.hh b/opm/simulators/linalg/amgcpr.hh index 7ee995f5f..301683cdb 100644 --- a/opm/simulators/linalg/amgcpr.hh +++ b/opm/simulators/linalg/amgcpr.hh @@ -26,58 +26,6 @@ namespace Dune { namespace Amg { -#if !DUNE_VERSION_NEWER(DUNE_ISTL, 2, 5) - template - struct DirectSolverSelector - { -#if DISABLE_AMG_DIRECTSOLVER - static constexpr bool isDirectSolver = false; - using type = void; -#elif HAVE_SUITESPARSE_UMFPACK - using field_type = typename M::field_type; - using type = typename std::conditional::value, UMFPack, - typename std::conditional, field_type>::value, - UMFPack, - void>::type>::type; - static constexpr bool isDirectSolver = std::is_same, type>::value; -#elif HAVE_SUPERLU - static constexpr bool isDirectSolver = true; - using type = SuperLU; -#else - static constexpr bool isDirectSolver = false; - using type = void; -#endif - - static type* create(const M& mat, bool verbose, bool reusevector ) - { - return create(mat, verbose, reusevector, std::integral_constant()); - } - static type* create(const M& /* mat */, bool /* verbose */, bool /* reusevector */, std::integral_constant ) - { - DUNE_THROW(NotImplemented,"DirectSolver not selected"); - return nullptr; - } - - static type* create(const M& mat, bool verbose, bool reusevector, std::integral_constant ) - { - return new type(mat, verbose, reusevector); - } - static std::string name() - { - if(std::is_same::value) - return "None"; -#if HAVE_SUITESPARSE_UMFPACK - if(std::is_same >::value) - return "UMFPack"; -#endif -#if HAVE_SUPERLU - if(std::is_same >::value) - return "SuperLU"; -#endif - } - }; - -#endif #if HAVE_MPI @@ -212,19 +160,11 @@ namespace Dune /** \copydoc Preconditioner::apply */ void apply(Domain& v, const Range& d); -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) //! Category of the preconditioner (see SolverCategory::Category) virtual SolverCategory::Category category() const { return category_; } -#else - enum { - //! \brief The category the preconditioner is part of. - category = std::is_same::value? - Dune::SolverCategory::sequential:Dune::SolverCategory::overlapping - }; -#endif /** \copydoc Preconditioner::post */ void post(Domain& x); @@ -441,10 +381,8 @@ namespace Dune bool additive; bool coarsesolverconverged; std::shared_ptr coarseSmoother_; -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) /** @brief The solver category. */ SolverCategory::Category category_; -#endif /** @brief The verbosity level. */ std::size_t verbosity_; }; @@ -459,9 +397,7 @@ namespace Dune buildHierarchy_(amg.buildHierarchy_), additive(amg.additive), coarsesolverconverged(amg.coarsesolverconverged), coarseSmoother_(amg.coarseSmoother_), -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) category_(amg.category_), -#endif verbosity_(amg.verbosity_) { if(amg.rhs_) @@ -483,10 +419,8 @@ namespace Dune postSteps_(parms.getNoPostSmoothSteps()), buildHierarchy_(false), additive(parms.getAdditive()), coarsesolverconverged(true), coarseSmoother_(), -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) // #warning should category be retrieved from matrices? category_(SolverCategory::category(*smoothers_->coarsest())), -#endif verbosity_(parms.debugLevel()) { assert(matrices_->isBuilt()); @@ -508,15 +442,11 @@ namespace Dune postSteps_(criterion.getNoPostSmoothSteps()), buildHierarchy_(true), additive(criterion.getAdditive()), coarsesolverconverged(true), coarseSmoother_(), -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) category_(SolverCategory::category(pinfo)), -#endif verbosity_(criterion.debugLevel()) { -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) if(SolverCategory::category(matrix) != SolverCategory::category(pinfo)) DUNE_THROW(InvalidSolverCategory, "Matrix and Communication must have the same SolverCategory!"); -#endif createHierarchies(criterion, const_cast(matrix), pinfo); } @@ -612,14 +542,7 @@ namespace Dune coarseSmoother_.reset(ConstructionTraits::construct(cargs)); #endif -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) scalarProduct_ = createScalarProduct(cargs.getComm(),category()); -#else - typedef Dune::ScalarProductChooser - ScalarProductChooser; - // the scalar product. - scalarProduct_.reset(ScalarProductChooser::construct(cargs.getComm())); -#endif typedef DirectSolverSelector< typename M::matrix_type, X > SolverSelector; diff --git a/opm/simulators/linalg/twolevelmethodcpr.hh b/opm/simulators/linalg/twolevelmethodcpr.hh index 468381955..82294b2ad 100644 --- a/opm/simulators/linalg/twolevelmethodcpr.hh +++ b/opm/simulators/linalg/twolevelmethodcpr.hh @@ -302,12 +302,10 @@ private: return apply(x,b,1e-8,res); } -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) virtual SolverCategory::Category category() const { return amg_.category(); } -#endif ~AMGInverseOperator() { @@ -401,16 +399,6 @@ public: */ typedef S SmootherType; - // define the category -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) - -#else - enum { - //! \brief The category the preconditioner is part of. - category=SolverCategory::sequential - }; -#endif - /** * @brief Constructs a two level method. * @@ -510,13 +498,12 @@ public: postsmooth(context, postSteps_); } -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) // //! Category of the preconditioner (see SolverCategory::Category) virtual SolverCategory::Category category() const { return SolverCategory::sequential; } -#endif + private: /** * @brief Struct containing the level information. diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index 535ddb164..481a9a296 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -94,13 +94,7 @@ namespace Opm { typedef Dune::FieldVector VectorBlockType; typedef Dune::BlockVector BVector; -#if DUNE_VERSION_NEWER_REV(DUNE_ISTL, 2 , 5, 1) - // 3x3 matrix block inversion was unstable from at least 2.3 until and - // including 2.5.0 typedef Dune::FieldMatrix MatrixBlockType; -#else - typedef Dune::FieldMatrix MatrixBlockType; -#endif typedef Opm::BlackOilPolymerModule PolymerModule;