5#include <dune/common/classname.hh>
6#include <dune/common/version.hh>
8#include <dune/common/ftraits.hh>
10#include <amdis/CreatorMap.hpp>
11#include <amdis/Output.hpp>
13#include <amdis/linearalgebra/istl/ISTLSolverCreator.hpp>
14#include <amdis/linearalgebra/istl/precompiled/Solvers.hpp>
35 template <
class Traits>
38 using M =
typename Traits::M;
39 using X =
typename Traits::X;
40 using Y =
typename Traits::Y;
42 using FTraits = Dune::FieldTraits<typename M::field_type>;
45 using Creator = ISTLSolverCreator<S,Traits>;
52 auto cg =
new Creator<Dune::CGSolver<X>>;
53 Map::addCreator(
"cg", cg);
56 auto pcg =
new Creator<Dune::GeneralizedPCGSolver<X>>;
57 Map::addCreator(
"pcg", pcg);
59 auto fcg =
new Creator<Dune::RestartedFCGSolver<X>>;
60 Map::addCreator(
"fcg", fcg);
62 auto cfcg =
new Creator<Dune::CompleteFCGSolver<X>>;
63 Map::addCreator(
"cfcg", cfcg);
65 auto bicgstab =
new Creator<Dune::BiCGSTABSolver<X>>;
66 Map::addCreator(
"bicgstab", bicgstab);
67 Map::addCreator(
"bcgs", bicgstab);
68 Map::addCreator(
"default", bicgstab);
70 auto minres =
new Creator<Dune::MINRESSolver<X>>;
71 Map::addCreator(
"minres", minres);
73 auto gmres =
new Creator<Dune::RestartedGMResSolver<X,Y>>;
74 Map::addCreator(
"gmres", gmres);
76 auto fgmres =
new Creator<Dune::RestartedFlexibleGMResSolver<X,Y>>;
77 Map::addCreator(
"fgmres", fgmres);
79 init_direct(std::is_same<typename FTraits::real_type, double>{});
82 static void init_direct(std::false_type)
84 warning(
"Direct solvers not created for the matrix with real_type = {}.",
85 Dune::className<typename FTraits::real_type>());
88 static void init_direct(std::true_type)
90#if HAVE_SUITESPARSE_UMFPACK
91 auto umfpack =
new Creator<Dune::UMFPack<M>>;
92 Map::addCreator(
"umfpack", umfpack);
95#if HAVE_SUITESPARSE_LDL
96 auto ldl =
new Creator<Dune::LDL<M>>;
97 Map::addCreator(
"ldl", ldl);
100#if HAVE_SUITESPARSE_SPQR
101 auto spqr =
new Creator<Dune::SPQR<M>>;
102 Map::addCreator(
"spqr", spqr);
106 auto superlu =
new Creator<Dune::SuperLU<M>>;
107 Map::addCreator(
"superlu", superlu);
111#if HAVE_SUITESPARSE_UMFPACK
112 Map::addCreator(
"direct", umfpack);
114 Map::addCreator(
"direct", superlu);
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