4#include <boost/numeric/itl/itl.hpp>
5#include <boost/numeric/itl/pc/ilu_0.hpp>
6#include <boost/numeric/itl/pc/ic_0.hpp>
7#include <boost/numeric/mtl/vector/assigner.hpp>
9#include <amdis/CreatorMap.hpp>
10#include <amdis/linearalgebra/mtl/HyprePrecon.hpp>
11#include <amdis/linearalgebra/mtl/Preconditioner.hpp>
12#include <amdis/linearalgebra/mtl/SolverPrecon.hpp>
13#include <amdis/linearalgebra/mtl/Traits.hpp>
14#include <amdis/linearalgebra/mtl/itl/masslumping.hpp>
26 template <
class Matrix>
37 template <
class Matrix>
38 using MassLumpingPreconditioner = itl::pc::masslumping<Matrix>;
49 template <
class Matrix>
63 template <
class Matrix>
75 template <
class Matrix>
79 template <
class M,
class X,
class Y>
84 template <
template <
class>
class ITLPrecon>
92 auto pc_diag =
new PreconCreator<DiagonalPreconditioner>;
93 Map::addCreator(
"diag", pc_diag);
94 Map::addCreator(
"jacobi", pc_diag);
96 auto pc_mass =
new PreconCreator<MassLumpingPreconditioner>;
97 Map::addCreator(
"masslumping", pc_mass);
99 auto pc_ilu =
new PreconCreator<ILUPreconditioner>;
100 Map::addCreator(
"ilu", pc_ilu);
101 Map::addCreator(
"ilu0", pc_ilu);
103 auto pc_ic =
new PreconCreator<ICPreconditioner>;
104 Map::addCreator(
"ic", pc_ic);
105 Map::addCreator(
"ic0", pc_ic);
107 auto pc_id =
new PreconCreator<IdentityPreconditioner>;
108 Map::addCreator(
"identity", pc_id);
109 Map::addCreator(
"no", pc_id);
112 Map::addCreator(
"solver", pc_solver);
114 Map::addCreator(
"default", pc_id);
116 init_hypre(std::is_same<
typename Dune::FieldTraits<typename M::value_type>::real_type,
double>{});
119 static void init_hypre(std::false_type) {}
120 static void init_hypre(std::true_type)
122#if AMDIS_HAS_HYPRE && HAVE_MPI
123 auto pc_hypre =
new typename HyprePrecon<M,X,Y>::Creator;
124 Map::addCreator(
"hypre", pc_hypre);
129 template <
class M,
class X,
class Y>
130 itl::pc::solver<PreconditionerInterface<M,X,Y>, X,
false>
136 template <
class M,
class X,
class Y>
137 itl::pc::solver<PreconditionerInterface<M,X,Y>, X,
true>
138 adjoint_solve(PreconditionerInterface<M,X,Y>
const& P, X
const& vin)
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
ITL_Preconditioner implementation of diagonal (jacobi) preconditioner,.
ITL_Preconditioner implementation of IC (Incomplete Cholesky factorization) preconditioner.
ITL_Preconditioner implementation of ILU (Incomplete LU factorization) preconditioner.
ITL_Preconditioner implementation of identity preconditioner,.
Interface for Preconditioner y = M*x.
Definition: PreconditionerInterface.hpp:10
A creator to be used instead of the constructor.
Definition: Preconditioner.hpp:23
A creator to be used instead of the constructor.
Definition: SolverPrecon.hpp:30