10 #include "Teko_AddPreconditionerFactory.hpp"
16 AddPreconditionerFactory::AddPreconditionerFactory(
17 const RCP<const BlockPreconditionerFactory> &FirstFactory,
18 const RCP<const BlockPreconditionerFactory> &SecondFactory)
19 : FirstFactory_(FirstFactory), SecondFactory_(SecondFactory) {}
21 AddPreconditionerFactory::AddPreconditionerFactory() {}
24 RCP<PreconditionerState> AddPreconditionerFactory::buildPreconditionerState()
const {
27 FirstFactory_->buildPreconditionerState());
29 SecondFactory_->buildPreconditionerState());
34 LinearOp AddPreconditionerFactory ::buildPreconditionerOperator(
42 TEUCHOS_ASSERT(MyState != 0);
44 LinearOp M1 = FirstFactory_->buildPreconditionerOperator(blockOp, *MyState->StateOne_);
45 LinearOp M2 = SecondFactory_->buildPreconditionerOperator(blockOp, *MyState->StateTwo_);
47 LinearOp invA = add(M1, M2);
54 void AddPreconditionerFactory::initializeFromParameterList(
const Teuchos::ParameterList &pl) {
55 RCP<const InverseLibrary> invLib = getInverseLibrary();
58 std::string aStr =
"", bStr =
"";
61 aStr = pl.get<std::string>(
"Preconditioner A");
62 bStr = pl.get<std::string>(
"Preconditioner B");
64 RCP<const Teuchos::ParameterList> aSettings = invLib->getParameterList(aStr);
65 RCP<const Teuchos::ParameterList> bSettings = invLib->getParameterList(bStr);
68 std::string aType = aSettings->get<std::string>(
"Preconditioner Type");
70 aType, aSettings->sublist(
"Preconditioner Settings"), invLib);
73 std::string bType = bSettings->get<std::string>(
"Preconditioner Type");
75 bType, bSettings->sublist(
"Preconditioner Settings"), invLib);
Abstract class which block preconditioner factories in Teko should be based on.
An implementation of a state object for block preconditioners.
static Teuchos::RCP< PreconditionerFactory > buildPreconditionerFactory(const std::string &name, const Teuchos::ParameterList &settings, const Teuchos::RCP< const InverseLibrary > &invLib=Teuchos::null)
Builder function for creating preconditioner factories (yes this is a factory factory).