5#include <amdis/CreatorInterface.hpp>
6#include <amdis/CreatorMap.hpp>
7#include <amdis/common/TypeTraits.hpp>
8#include <amdis/linearalgebra/istl/AMGPrecon.hpp>
9#include <amdis/linearalgebra/istl/ISTLPreconCreator.hpp>
10#include <amdis/linearalgebra/istl/precompiled/Preconditioners.hpp>
29 template <
class Traits>
32 using M =
typename Traits::M;
33 using X =
typename Traits::X;
34 using Y =
typename Traits::Y;
36 template <
class Precon>
40 using FTraits = Dune::FieldTraits<typename M::field_type>;
46 Map::addCreator(
"diag", jacobi);
47 Map::addCreator(
"jacobi", jacobi);
50 Map::addCreator(
"gs", gs);
51 Map::addCreator(
"gauss_seidel", gs);
54 Map::addCreator(
"sor", sor);
57 Map::addCreator(
"ssor", ssor);
59 init_ilu(std::is_arithmetic<typename FTraits::field_type>{});
60 init_amg(std::is_same<typename FTraits::real_type, double>{});
63 Map::addCreator(
"richardson", richardson);
64 Map::addCreator(
"default", richardson);
67 Map::addCreator(
"solver", solver);
69 init_bjacobi(
Types<TYPEOF(std::declval<typename Traits::Comm>().impl())>{}, Dune::PriorityTag<10>{});
72 static void init_ilu(std::false_type)
74 warning(
"ILU preconditioners not created for the matrix with field_type = {}.",
75 Dune::className<typename FTraits::field_type>());
78 static void init_ilu(std::true_type)
81 Map::addCreator(
"ilu", ilu);
82 Map::addCreator(
"ilu0", ilu);
85 Map::addCreator(
"ildl", ildl);
88 static void init_amg(std::false_type)
90 warning(
"AMG preconditioners not created for the matrix with real_type = {}.",
91 Dune::className<typename FTraits::real_type>());
94 static void init_amg(std::true_type)
97 Map::addCreator(
"amg", amg);
99 Map::addCreator(
"fastamg", fastamg);
101 Map::addCreator(
"kamg", kamg);
106 template <
class Comm>
107 static void init_bjacobi(
Types<Comm>, Dune::PriorityTag<1>)
110 Map::addCreator(
"pssor", pssor);
113 Map::addCreator(
"bjacobi", bjacobi);
Definition: AMGPrecon.hpp:188
A CreatorMap is used to construct objects, which types depends on key words determined at run time....
Definition: CreatorMap.hpp:30
Definition: CreatorMap.hpp:16
Default precon creator.
Definition: ISTLPreconCreator.hpp:72
A variadic type list.
Definition: TypeTraits.hpp:146