47 #include "Teko_AddPreconditionerFactory.hpp"
53 AddPreconditionerFactory::AddPreconditionerFactory(
54 const RCP<const BlockPreconditionerFactory> & FirstFactory,
55 const RCP<const BlockPreconditionerFactory> & SecondFactory)
56 : FirstFactory_(FirstFactory), SecondFactory_(SecondFactory)
59 AddPreconditionerFactory::AddPreconditionerFactory()
63 RCP<PreconditionerState> AddPreconditionerFactory::buildPreconditionerState()
const
67 mystate->StateTwo_ = Teuchos::rcp_dynamic_cast<
BlockPreconditionerState>(SecondFactory_->buildPreconditionerState());
72 LinearOp AddPreconditionerFactory
73 ::buildPreconditionerOperator(BlockedLinearOp & blockOp,
82 TEUCHOS_ASSERT(MyState != 0);
84 LinearOp M1 = FirstFactory_->buildPreconditionerOperator(blockOp, *MyState->StateOne_);
85 LinearOp M2 = SecondFactory_->buildPreconditionerOperator(blockOp, *MyState->StateTwo_);
87 LinearOp invA = add(M1, M2);
94 void AddPreconditionerFactory::initializeFromParameterList(
const Teuchos::ParameterList & pl)
96 RCP<const InverseLibrary> invLib = getInverseLibrary();
99 std::string aStr=
"", bStr=
"";
102 aStr = pl.get<std::string>(
"Preconditioner A");
103 bStr = pl.get<std::string>(
"Preconditioner B");
105 RCP<const Teuchos::ParameterList> aSettings = invLib->getParameterList(aStr);
106 RCP<const Teuchos::ParameterList> bSettings = invLib->getParameterList(bStr);
109 std::string aType = aSettings->get<std::string>(
"Preconditioner Type");
110 RCP<Teko::PreconditionerFactory> precA
114 std::string bType = bSettings->get<std::string>(
"Preconditioner Type");
115 RCP<Teko::PreconditionerFactory> precB
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).