Skip to content
Snippets Groups Projects
Commit 88ed6234 authored by Mathis Kelm's avatar Mathis Kelm
Browse files

[linear] Adapt istl solver factories to OperatorTraits

parent 52d66e0e
No related branches found
No related tags found
1 merge request!3857[linear] Adapt istl solver factories to OperatorTraits
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <dune/common/exceptions.hh> #include <dune/common/exceptions.hh>
#include <dune/common/shared_ptr.hh> #include <dune/common/shared_ptr.hh>
#include <dune/common/version.hh>
#include <dune/common/parallel/indexset.hh> #include <dune/common/parallel/indexset.hh>
#include <dune/common/parallel/mpicommunication.hh> #include <dune/common/parallel/mpicommunication.hh>
#include <dune/grid/common/capabilities.hh> #include <dune/grid/common/capabilities.hh>
...@@ -499,10 +500,15 @@ private: ...@@ -499,10 +500,15 @@ private:
using LinearOperator = typename std::decay_t<decltype(op)>::element_type; using LinearOperator = typename std::decay_t<decltype(op)>::element_type;
const auto& params = params_.sub("preconditioner"); const auto& params = params_.sub("preconditioner");
using Prec = Dune::Preconditioner<typename LinearOperator::domain_type, typename LinearOperator::range_type>; using Prec = Dune::Preconditioner<typename LinearOperator::domain_type, typename LinearOperator::range_type>;
#if DUNE_VERSION_GTE(DUNE_ISTL,2,11)
using OpTraits = Dune::OperatorTraits<LinearOperator>;
std::shared_ptr<Prec> prec = PreconditionerFactory{}(OpTraits{}, op, params);
#else
using TL = Dune::TypeList<typename LinearOperator::matrix_type, typename LinearOperator::domain_type, typename LinearOperator::range_type>; using TL = Dune::TypeList<typename LinearOperator::matrix_type, typename LinearOperator::domain_type, typename LinearOperator::range_type>;
std::shared_ptr<Prec> prec = PreconditionerFactory{}(TL{}, op, params); std::shared_ptr<Prec> prec = PreconditionerFactory{}(TL{}, op, params);
#endif
#if HAVE_MPI #if HAVE_MPI && DUNE_VERSION_LT(DUNE_ISTL,2,11)
if (prec->category() != op->category() && prec->category() == Dune::SolverCategory::sequential) if (prec->category() != op->category() && prec->category() == Dune::SolverCategory::sequential)
prec = Dune::wrapPreconditioner4Parallel(prec, op); prec = Dune::wrapPreconditioner4Parallel(prec, op);
#endif #endif
...@@ -870,7 +876,6 @@ using SuperLUIstlSolver = Detail::DirectIstlSolver<LSTraits, LATraits, Dune::Sup ...@@ -870,7 +876,6 @@ using SuperLUIstlSolver = Detail::DirectIstlSolver<LSTraits, LATraits, Dune::Sup
#if HAVE_UMFPACK #if HAVE_UMFPACK
#include <dune/istl/umfpack.hh> #include <dune/istl/umfpack.hh>
#include <dune/common/version.hh>
namespace Dumux { namespace Dumux {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment