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.
This commit is contained in:
Markus Blatt
2021-09-13 12:25:49 +02:00
parent e6c8f6985c
commit c84b55c452
3 changed files with 15 additions and 1 deletions

View File

@@ -21,9 +21,10 @@
#ifndef OPM_FLEXIBLE_SOLVER_IMPL_HEADER_INCLUDED
#define OPM_FLEXIBLE_SOLVER_IMPL_HEADER_INCLUDED
#include <opm/simulators/linalg/matrixblock.hh>
#include <opm/simulators/linalg/ilufirstelement.hh>
#include <opm/simulators/linalg/FlexibleSolver.hpp>
#include <opm/simulators/linalg/PreconditionerFactory.hpp>
#include <opm/simulators/linalg/matrixblock.hh>
#include <dune/common/fmatrix.hh>
#include <dune/istl/bcrsmatrix.hh>

View File

@@ -25,6 +25,7 @@
#include <opm/common/ErrorMacros.hpp>
#include <dune/common/version.hh>
#include <dune/istl/preconditioner.hh>
#include <dune/istl/ilu.hh>
#include <dune/istl/paamg/smoother.hh>
#include <dune/istl/paamg/graph.hh>
#include <dune/istl/paamg/pinfo.hh>
@@ -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;

View File

@@ -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;