53 #if defined(HAVE_MUELU_EXPERIMENTAL) && defined(HAVE_MUELU_TEKO) 57 #include "Teuchos_RCP.hpp" 58 #include "Teuchos_ParameterList.hpp" 59 #include "Teuchos_TestForException.hpp" 60 #include "Teuchos_AbstractFactoryStd.hpp" 64 void enableMueLu(DefaultLinearSolverBuilder &builder,
const std::string &stratName) {
65 #if (defined(HAVE_MUELU_EPETRA) && !defined(HAVE_MUELU_TPETRA)) || \ 66 (defined(HAVE_MUELU_TPETRA) && defined(HAVE_TPETRA_INST_INT_INT) && defined(HAVE_TPETRA_INST_SERIAL)) 67 const Teuchos::RCP<const Teuchos::ParameterList> precValidParams = Teuchos::sublist(builder.getValidParameters(),
"Preconditioner Types");
69 TEUCHOS_TEST_FOR_EXCEPTION(precValidParams->isParameter(stratName), std::logic_error,
70 "Stratimikos::enableMueLu cannot add \"" + stratName +
"\" because it is already included in builder!");
72 typedef Thyra::PreconditionerFactoryBase<double> Base;
74 builder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), stratName);
76 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
77 "Stratimikos::enableMueLu cannot add \"" + stratName +
"\" because MueLu is compiled without support for " 78 "GO=int and/or NO=Serial.\n Add support for GO=int and NO=Serial in Tpetra or compile only for Epetra.");
82 #if defined(HAVE_MUELU_EXPERIMENTAL) && defined(HAVE_MUELU_TEKO) 85 const Teuchos::RCP<const Teuchos::ParameterList> precValidParams = Teuchos::sublist(builder.getValidParameters(),
"Preconditioner Types");
87 TEUCHOS_TEST_FOR_EXCEPTION(precValidParams->isParameter(stratName), std::logic_error,
88 "Stratimikos::enableMueLuTpetraQ2Q1 cannot add \"" + stratName +
"\" because it is already included in builder!");
90 typedef Thyra::PreconditionerFactoryBase<double> Base;
93 builder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), stratName);
void enableMueLuTpetraQ2Q1(DefaultLinearSolverBuilder &builder, const std::string &stratName="MueLu")
Concrete preconditioner factory subclass based on MueLu.
Concrete preconditioner factory subclass for Thyra based on MueLu.Add support for MueLu preconditione...
void enableMueLu(DefaultLinearSolverBuilder &builder, const std::string &stratName)