13 const std::string
type =
"RELAXATION";
15 Ifpack2::Factory factory;
16 prec_mp = factory.create(type, A);
18 params_mp = Teuchos::rcp(
new Teuchos::ParameterList );
36 const Teuchos::RCP<matrix_t>& A,
37 const Teuchos::RCP<vector_t>& b)
39 prec_mp->apply(*b, *x, Teuchos::NO_TRANS,
40 Teuchos::ScalarTraits<scalar_t>::one(),
41 Teuchos::ScalarTraits<scalar_t>::zero());
47 std::map<std::string, Smoother> map;
49 map[
"GS"] = Smoother::GAUSS_SEIDEL;
50 map[
"SGS"] = Smoother::SGS;
55 if ( sm == map.end() )
57 "No smoother '" + smoother +
"'.");
66 params_mp = Teuchos::rcp(
new Teuchos::ParameterList );
69 std::string
type =
"";
71 std::pair<bool, scalar_t> l1 = std::make_pair(
true, 1.5);
73 bool backward =
false;
74 std::pair<bool, scalar_t> fix = std::make_pair(
true, 1.0
e-5);
81 type =
"Gauss-Seidel";
88 type =
"Symmetric Gauss-Seidel";
102 params_mp->set(
"relaxation: type", type);
103 params_mp->set(
"relaxation: sweeps", nSweeps);
104 params_mp->set(
"relaxation: zero starting solution",
false);
105 params_mp->set(
"relaxation: damping factor", damping);
106 params_mp->set(
"relaxation: use l1", l1.first);
107 params_mp->set(
"relaxation: l1 eta", l1.second);
108 params_mp->set(
"relaxation: backward mode", backward);
109 params_mp->set(
"relaxation: fix tiny diagonal entries", fix.first);
110 params_mp->set(
"relaxation: min diagonal value", fix.second);
111 params_mp->set(
"relaxation: check diagonal entries", check);
constexpr double e
The value of .
The base class for all OPAL exceptions.
Teuchos::RCP< preconditioner_t > prec_mp
Preconditioner instance.
std::string toUpper(const std::string &str)
Smoother
All supported Ifpack2 smoothers.
void initParameter_m(const Smoother &smoother, lo_t nSweeps)
Teuchos::RCP< Teuchos::ParameterList > params_mp
Parameters of preconditioner.
static Smoother convertToEnumSmoother(const std::string &smoother)
AmrSmoother(const Teuchos::RCP< const matrix_t > &A, const Smoother &smoother, lo_t nSweeps)
amr::local_ordinal_t lo_t
void smooth(const Teuchos::RCP< vector_t > &x, const Teuchos::RCP< matrix_t > &A, const Teuchos::RCP< vector_t > &b)