45 using V =
typename F::Vector;
49 using field_type =
typename V::field_type;
51 static constexpr int maxblocksize = 6;
56 F::addCreator(
"ilu0", [](
const O&
op,
const P& prm,
const std::function<V()>&, std::size_t,
const C& comm) {
57 const double w = prm.
get<
double>(
"relaxation", 1.0);
59 auto gpuPrec = std::make_shared<GpuILU0>(
op.getmat(),
w);
60 return std::make_shared<gpuistl::GpuBlockPreconditioner<V, V, C>>(
gpuPrec, comm);
63 F::addCreator(
"jac", [](
const O&
op,
const P& prm,
const std::function<V()>&, std::size_t,
const C& comm) {
64 const double w = prm.
get<
double>(
"relaxation", 1.0);
66 auto gpuPrec = std::make_shared<GpuJac>(
op.getmat(),
w);
67 return std::make_shared<gpuistl::GpuBlockPreconditioner<V, V, C>>(
gpuPrec, comm);
70 F::addCreator(
"dilu", [](
const O&
op, [[
maybe_unused]]
const P& prm,
const std::function<V()>&, std::size_t,
const C& comm) -> PrecPtr {
71 return op.getmat().dispatchOnBlocksize([&](
auto blockSizeVal) -> PrecPtr {
73 const auto cpuMatrix = gpuistl::detail::makeCPUMatrix<O, Dune::FieldMatrix<field_type, blockSize, blockSize>>(
op);
77 const bool reorder = prm.
get<
bool>(
"reorder",
true);
81 return std::make_shared<gpuistl::GpuBlockPreconditioner<V, V, C>>(
gpuPrec, comm);
85 F::addCreator(
"opmilu0", [](
const O&
op, [[
maybe_unused]]
const P& prm,
const std::function<V()>&, std::size_t,
const C& comm) -> PrecPtr {
86 return op.getmat().dispatchOnBlocksize([&](
auto blockSizeVal) -> PrecPtr {
88 const auto cpuMatrix = gpuistl::detail::makeCPUMatrix<O, Dune::FieldMatrix<field_type, blockSize, blockSize>>(
op);
95 return std::make_shared<gpuistl::GpuBlockPreconditioner<V, V, C>>(
gpuPrec, comm);
std::shared_ptr< Dune::PreconditionerWithUpdate< Vector, Vector > > PrecPtr
The type of pointer returned by create().
Definition PreconditionerFactory.hpp:71
T get(const std::string &key) const
Retrieve property value given hierarchical property key.
Definition PropertyTree.cpp:59
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240