10 #ifndef STRATIMIKOS_MUELU_TPETRA_HELPERS_HPP
11 #define STRATIMIKOS_MUELU_TPETRA_HELPERS_HPP
14 #include "Stratimikos_LinearSolverBuilder.hpp"
20 #if defined(HAVE_MUELU_EXPERIMENTAL) && defined(HAVE_MUELU_TEKO)
27 #include "Teuchos_AbstractFactoryStd.hpp"
31 namespace Stratimikos {
33 template <
typename Scalar = MueLu::DefaultScalar,
typename LocalOrdinal = MueLu::DefaultLocalOrdinal,
typename GlobalOrdinal = MueLu::DefaultGlobalOrdinal,
typename Node = MueLu::DefaultNode>
34 void enableMueLu(LinearSolverBuilder<Scalar>& builder,
const std::string& stratName =
"MueLu") {
35 #if defined(HAVE_MUELU_STRATIMIKOS) && defined(HAVE_MUELU_THYRA)
39 "Stratimikos::enableMueLu cannot add \"" + stratName +
"\" because it is already included in builder!");
41 typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
42 typedef Thyra::MueLuPreconditionerFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node> Impl;
44 builder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), stratName);
48 template <
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
49 MUELU_DEPRECATED
void enableMueLu(LinearSolverBuilder<double>& builder,
const std::string& stratName =
"MueLu") {
50 enableMueLu<double, LocalOrdinal, GlobalOrdinal, Node>(builder, stratName);
53 template <
typename Scalar = MueLu::DefaultScalar,
typename LocalOrdinal = MueLu::DefaultLocalOrdinal,
typename GlobalOrdinal = MueLu::DefaultGlobalOrdinal,
typename Node = MueLu::DefaultNode>
54 void enableMueLuRefMaxwell(LinearSolverBuilder<Scalar>& builder,
const std::string& stratName =
"MueLuRefMaxwell") {
55 #if defined(HAVE_MUELU_STRATIMIKOS) && defined(HAVE_MUELU_THYRA)
59 "Stratimikos::enableMueLuRefMaxwell cannot add \"" + stratName +
"\" because it is already included in builder!");
61 typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
62 typedef Thyra::MueLuRefMaxwellPreconditionerFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node> Impl;
64 builder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), stratName);
68 template <
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
69 MUELU_DEPRECATED
void enableMueLuRefMaxwell(LinearSolverBuilder<double>& builder,
const std::string& stratName =
"MueLuRefMaxwell") {
70 enableMueLuRefMaxwell<double, LocalOrdinal, GlobalOrdinal, Node>(builder, stratName);
73 template <
typename Scalar = MueLu::DefaultScalar,
typename LocalOrdinal = MueLu::DefaultLocalOrdinal,
typename GlobalOrdinal = MueLu::DefaultGlobalOrdinal,
typename Node = MueLu::DefaultNode>
74 void enableMueLuMaxwell1(LinearSolverBuilder<Scalar>& builder,
const std::string& stratName =
"MueLuMaxwell1") {
75 #if defined(HAVE_MUELU_STRATIMIKOS) && defined(HAVE_MUELU_THYRA)
79 "Stratimikos::enableMueLuRefMaxwell cannot add \"" + stratName +
"\" because it is already included in builder!");
81 typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
82 typedef Thyra::MueLuMaxwell1PreconditionerFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node> Impl;
84 builder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), stratName);
88 template <
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
89 MUELU_DEPRECATED
void enableMueLuMaxwell1(LinearSolverBuilder<double>& builder,
const std::string& stratName =
"MueLuMaxwell1") {
90 enableMueLuMaxwell1<double, LocalOrdinal, GlobalOrdinal, Node>(builder, stratName);
93 #if defined(HAVE_MUELU_EXPERIMENTAL) && defined(HAVE_MUELU_TEKO)
96 void enableMueLuTpetraQ2Q1(DefaultLinearSolverBuilder &builder,
const std::string &stratName =
"MueLu");
99 template <
typename Scalar = MueLu::DefaultScalar,
typename LocalOrdinal = MueLu::DefaultLocalOrdinal,
typename GlobalOrdinal = MueLu::DefaultGlobalOrdinal,
typename Node = MueLu::DefaultNode>
104 "Stratimikos::enableMueLuTpetraQ2Q1 cannot add \"" + stratName +
"\" because it is already included in builder!");
106 typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
109 builder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), stratName);
112 template <
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
113 MUELU_DEPRECATED
void enableMueLuTpetraQ2Q1(LinearSolverBuilder<double>& builder,
const std::string& stratName =
"MueLu") {
114 enableMueLuTpetraQ2Q1<double, LocalOrdinal, GlobalOrdinal, Node>(builder, stratName);
void enableMueLu(LinearSolverBuilder< Scalar > &builder, const std::string &stratName="MueLu")
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Concrete preconditioner factory subclass based on MueLu.
void enableMueLuTpetraQ2Q1(LinearSolverBuilder< Scalar > &builder, const std::string &stratName="MueLu")
bool isParameter(const std::string &name) const
void enableMueLuRefMaxwell(LinearSolverBuilder< Scalar > &builder, const std::string &stratName="MueLuRefMaxwell")
void enableMueLuMaxwell1(LinearSolverBuilder< Scalar > &builder, const std::string &stratName="MueLuMaxwell1")