4#ifndef DUNE_ISTL_SOLVERREGISTRY_HH
5#define DUNE_ISTL_SOLVERREGISTRY_HH
11#define DUNE_REGISTER_DIRECT_SOLVER(name, ...) \
12 DUNE_REGISTRY_PUT(DirectSolverTag, name, __VA_ARGS__)
14#define DUNE_REGISTER_PRECONDITIONER(name, ...) \
15 DUNE_REGISTRY_PUT(PreconditionerTag, name, __VA_ARGS__)
17#define DUNE_REGISTER_ITERATIVE_SOLVER(name, ...) \
18 DUNE_REGISTRY_PUT(IterativeSolverTag, name, __VA_ARGS__)
26 struct DirectSolverTag {};
27 struct PreconditionerTag {};
28 struct IterativeSolverTag {};
30 template<
template<
class,
class,
class,
int>
class Preconditioner,
int blockLevel=1>
32 return [](
auto typeList,
const auto& matrix,
const Dune::ParameterTree& config)
34 using Matrix =
typename Dune::TypeListElement<0,
decltype(typeList)>::type;
35 using Domain =
typename Dune::TypeListElement<1,
decltype(typeList)>::type;
36 using Range =
typename Dune::TypeListElement<2,
decltype(typeList)>::type;
37 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
38 = std::make_shared<Preconditioner<Matrix, Domain, Range, blockLevel>>(matrix, config);
39 return preconditioner;
43 template<
template<
class,
class,
class>
class Preconditioner>
45 return [](
auto typeList,
const auto& matrix,
const Dune::ParameterTree& config)
47 using Matrix =
typename Dune::TypeListElement<0,
decltype(typeList)>::type;
48 using Domain =
typename Dune::TypeListElement<1,
decltype(typeList)>::type;
49 using Range =
typename Dune::TypeListElement<2,
decltype(typeList)>::type;
50 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
51 = std::make_shared<Preconditioner<Matrix, Domain, Range>>(matrix, config);
52 return preconditioner;
56 template<
template<
class...>
class Solver>
58 return [](
auto typeList,
59 const auto& linearOperator,
60 const auto& scalarProduct,
61 const auto& preconditioner,
62 const Dune::ParameterTree& config)
64 using Domain =
typename Dune::TypeListElement<0,
decltype(typeList)>::type;
65 using Range =
typename Dune::TypeListElement<1,
decltype(typeList)>::type;
66 std::shared_ptr<Dune::InverseOperator<Domain, Range>> solver
67 = std::make_shared<Solver<Domain>>(linearOperator, scalarProduct, preconditioner, config);
Define general, extensible interface for inverse operators.
auto defaultIterativeSolverCreator()
Definition: solverregistry.hh:57
auto defaultPreconditionerBlockLevelCreator()
Definition: solverregistry.hh:31
auto defaultPreconditionerCreator()
Definition: solverregistry.hh:44
Definition: allocator.hh:9
constexpr std::size_t blockLevel()
Determine the block level of a possibly nested vector/matrix type.
Definition: blocklevel.hh:174
A generic dynamic dense matrix.
Definition: matrix.hh:559
Definition: solverregistry.hh:75
Definition: solverregistry.hh:77