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>
27 using DiagonalPreconditioner = itl::pc::diagonal<Matrix>;
37 template <
class Matrix>
38 using MassLumpingPreconditioner = itl::pc::masslumping<Matrix>;
49 template <
class Matrix>
50 using IdentityPreconditioner = itl::pc::identity<Matrix>;
63 template <
class Matrix>
64 using ILUPreconditioner = itl::pc::ilu_0<Matrix>;
75 template <
class Matrix>
76 using ICPreconditioner = itl::pc::ic_0<Matrix>;
79 template <
class Mat,
class Vec>
84 template <
template <
class>
class ITLPrecon>
93 auto pc_diag =
new PreconCreator<DiagonalPreconditioner>;
94 Map::addCreator(
"diag", pc_diag);
95 Map::addCreator(
"jacobi", pc_diag);
97 auto pc_mass =
new PreconCreator<MassLumpingPreconditioner>;
98 Map::addCreator(
"masslumping", pc_mass);
100 auto pc_ilu =
new PreconCreator<ILUPreconditioner>;
101 Map::addCreator(
"ilu", pc_ilu);
102 Map::addCreator(
"ilu0", pc_ilu);
104 auto pc_ic =
new PreconCreator<ICPreconditioner>;
105 Map::addCreator(
"ic", pc_ic);
106 Map::addCreator(
"ic0", pc_ic);
108 auto pc_id =
new PreconCreator<IdentityPreconditioner>;
109 Map::addCreator(
"identity", pc_id);
110 Map::addCreator(
"no", pc_id);
113 Map::addCreator(
"solver", pc_solver);
115 Map::addCreator(
"default", pc_id);
117 init_hypre(std::is_same<
typename Dune::FieldTraits<typename Mat::value_type>::real_type,
double>{});
120 static void init_hypre(std::false_type) {}
121 static void init_hypre(std::true_type)
123 #if AMDIS_HAS_HYPRE && HAVE_MPI 124 auto pc_hypre =
new typename HyprePrecon<Mat,Vec>::Creator;
125 Map::addCreator(
"hypre", pc_hypre);
130 template <
class Mat,
class Vec,
class X>
131 itl::pc::solver<PreconditionerInterface<Mat,Vec>,
X,
false>
137 template <
class Mat,
class Vec,
class X>
138 itl::pc::solver<PreconditionerInterface<Mat,Vec>,
X,
true>
A creator to be used instead of the constructor.
Definition: SolverPrecon.hpp:31
A creator to be used instead of the constructor.
Definition: Preconditioner.hpp:26
A CreatorMap is used to construct objects, which types depends on key words determined at run time...
Definition: CreatorMap.hpp:29
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
Definition: CreatorMap.hpp:16
Interface for Preconditioner y = M*x.
Definition: PreconditionerInterface.hpp:9
void init(int &argc, char **&argv, std::string const &initFileName="")
Initialized the Environment for MPI.
Definition: AMDiS.hpp:29
auto X()
Generator for CoordsFunction.
Definition: CoordsGridFunction.hpp:123