6#ifndef DUNE_ISTL_SOLVERREGISTRY_HH
7#define DUNE_ISTL_SOLVERREGISTRY_HH
13#define DUNE_REGISTER_DIRECT_SOLVER(name, ...) \
14 DUNE_REGISTRY_PUT(DirectSolverTag, name, __VA_ARGS__)
16#define DUNE_REGISTER_PRECONDITIONER(name, ...) \
17 DUNE_REGISTRY_PUT(PreconditionerTag, name, __VA_ARGS__)
19#define DUNE_REGISTER_ITERATIVE_SOLVER(name, ...) \
20 DUNE_REGISTRY_PUT(IterativeSolverTag, name, __VA_ARGS__)
28 struct DirectSolverTag {};
29 struct PreconditionerTag {};
30 struct IterativeSolverTag {};
32 template<
template<
class,
class,
class,
int>
class Preconditioner,
int blockLevel=1>
34 return [](
auto typeList,
const auto& matrix,
const Dune::ParameterTree& config)
36 using Matrix =
typename Dune::TypeListElement<0,
decltype(typeList)>::type;
37 using Domain =
typename Dune::TypeListElement<1,
decltype(typeList)>::type;
38 using Range =
typename Dune::TypeListElement<2,
decltype(typeList)>::type;
39 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
40 = std::make_shared<Preconditioner<Matrix, Domain, Range, blockLevel>>(matrix, config);
41 return preconditioner;
45 template<
template<
class,
class,
class>
class Preconditioner>
47 return [](
auto typeList,
const auto& matrix,
const Dune::ParameterTree& config)
49 using Matrix =
typename Dune::TypeListElement<0,
decltype(typeList)>::type;
50 using Domain =
typename Dune::TypeListElement<1,
decltype(typeList)>::type;
51 using Range =
typename Dune::TypeListElement<2,
decltype(typeList)>::type;
52 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
53 = std::make_shared<Preconditioner<Matrix, Domain, Range>>(matrix, config);
54 return preconditioner;
58 template<
template<
class...>
class Solver>
60 return [](
auto typeList,
61 const auto& linearOperator,
62 const auto& scalarProduct,
63 const auto& preconditioner,
64 const Dune::ParameterTree& config)
66 using Domain =
typename Dune::TypeListElement<0,
decltype(typeList)>::type;
67 using Range =
typename Dune::TypeListElement<1,
decltype(typeList)>::type;
68 std::shared_ptr<Dune::InverseOperator<Domain, Range>> solver
69 = std::make_shared<Solver<Domain>>(linearOperator, scalarProduct, preconditioner, config);
Define general, extensible interface for inverse operators.
auto defaultIterativeSolverCreator()
Definition solverregistry.hh:59
auto defaultPreconditionerBlockLevelCreator()
Definition solverregistry.hh:33
auto defaultPreconditionerCreator()
Definition solverregistry.hh:46
Definition allocator.hh:11
constexpr std::size_t blockLevel()
Determine the block level of a possibly nested vector/matrix type.
Definition blocklevel.hh:176
A generic dynamic dense matrix.
Definition matrix.hh:561
Definition solverregistry.hh:77
Definition solverregistry.hh:79