From c84b55c452232bc57ed42aeeca141329e5747d78 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 13 Sep 2021 12:25:49 +0200 Subject: [PATCH] Fixes ILU for Dune 2.8 We got compile errors like: /home/build/opm-simulators/opm/simulators/linalg/FlexibleSolver1.cpp:24:1: required from here /usr/include/dune/istl/ilu.hh:140:29: error: 'double' is not a class, struct, or union type without this patch. Hence we use the new internal ILU functions if available. --- opm/simulators/linalg/FlexibleSolver_impl.hpp | 3 ++- opm/simulators/linalg/ParallelOverlappingILU0.hpp | 9 +++++++++ tests/test_milu.cpp | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/opm/simulators/linalg/FlexibleSolver_impl.hpp b/opm/simulators/linalg/FlexibleSolver_impl.hpp index e1674f834..f8f5bd8fa 100644 --- a/opm/simulators/linalg/FlexibleSolver_impl.hpp +++ b/opm/simulators/linalg/FlexibleSolver_impl.hpp @@ -21,9 +21,10 @@ #ifndef OPM_FLEXIBLE_SOLVER_IMPL_HEADER_INCLUDED #define OPM_FLEXIBLE_SOLVER_IMPL_HEADER_INCLUDED +#include +#include #include #include -#include #include #include diff --git a/opm/simulators/linalg/ParallelOverlappingILU0.hpp b/opm/simulators/linalg/ParallelOverlappingILU0.hpp index 9cca2e75c..99a320369 100644 --- a/opm/simulators/linalg/ParallelOverlappingILU0.hpp +++ b/opm/simulators/linalg/ParallelOverlappingILU0.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -430,7 +431,11 @@ namespace Opm detail::IsPositiveFunctor() ); break; default: +#if DUNE_VERSION_LT(DUNE_GRID, 2, 8) bilu0_decomposition( ILU ); +#else + Dune::ILU::blockILU0Decomposition( ILU ); +#endif break; } } @@ -1022,7 +1027,11 @@ public: break; default: if (interiorSize_ == A_->N()) +#if DUNE_VERSION_LT(DUNE_GRID, 2, 8) bilu0_decomposition( *ILU ); +#else + Dune::ILU::blockILU0Decomposition( *ILU ); +#endif else detail::ghost_last_bilu0_decomposition(*ILU, interiorSize_); break; diff --git a/tests/test_milu.cpp b/tests/test_milu.cpp index d6ff84a93..7e1cc413e 100644 --- a/tests/test_milu.cpp +++ b/tests/test_milu.cpp @@ -85,7 +85,11 @@ void test_milu0(M& A) // Test that (LU)^-1Ae=e A.mv(e, x1); +#if DUNE_VERSION_GTE(DUNE_ISTL, 2, 8) + Dune::ILU::blockILUBacksolve(ILU, x2, x1); +#else bilu_backsolve(ILU, x2, x1); +#endif diff = x2; diff -= e;