10 #include "Teko_MultPreconditionerFactory.hpp"
17 Teko::BlockedMultiVector &y,
const double ,
18 const double )
const {
25 Teko::MultiVector MOne_r = Teko::deepcopy(r);
26 Teko::MultiVector t = Teko::deepcopy(r);
27 Teko::MultiVector w = Teko::toMultiVector(y);
29 Teko::applyOp(M1_, r, MOne_r);
30 Teko::applyOp(A_, MOne_r, t);
31 Teko::update(1., r, -1., t);
32 Teko::applyOp(M2_, t, w);
33 Teko::update(1., MOne_r, 1., w);
37 MultPreconditionerFactory ::MultPreconditionerFactory(
38 const RCP<const Teko::BlockPreconditionerFactory> &FirstFactory,
39 const RCP<const Teko::BlockPreconditionerFactory> &SecondFactory)
40 : FirstFactory_(FirstFactory), SecondFactory_(SecondFactory) {}
42 MultPreconditionerFactory::MultPreconditionerFactory() {}
48 FirstFactory_->buildPreconditionerState());
50 SecondFactory_->buildPreconditionerState());
59 TEUCHOS_ASSERT(MyState != 0);
61 Teko::LinearOp M1 = FirstFactory_->buildPreconditionerOperator(blockOp, *MyState->StateOne_);
62 Teko::LinearOp M2 = SecondFactory_->buildPreconditionerOperator(blockOp, *MyState->StateTwo_);
92 std::string aStr =
"", bStr =
"";
95 aStr = pl.get<std::string>(
"Preconditioner A");
96 bStr = pl.get<std::string>(
"Preconditioner B");
98 RCP<const Teuchos::ParameterList> aSettings = invLib->getParameterList(aStr);
99 RCP<const Teuchos::ParameterList> bSettings = invLib->getParameterList(bStr);
102 std::string aType = aSettings->get<std::string>(
"Preconditioner Type");
103 RCP<Teko::PreconditionerFactory> precA =
105 aType, aSettings->sublist(
"Preconditioner Settings"), invLib);
108 std::string bType = bSettings->get<std::string>(
"Preconditioner Type");
109 RCP<Teko::PreconditionerFactory> precB =
111 bType, bSettings->sublist(
"Preconditioner Settings"), invLib);
virtual Teuchos::RCP< Teko::PreconditionerState > buildPreconditionerState() const
Build the MultPrecondState object.
virtual void initializeFromParameterList(const Teuchos::ParameterList &pl)
Initialize from a parameter list.
Abstract class which block preconditioner factories in Teko should be based on.
An implementation of a state object for block preconditioners.
Teuchos::RCP< const InverseLibrary > getInverseLibrary() const
Get the inverse library used by this preconditioner factory.
Teko::LinearOp buildPreconditionerOperator(Teko::BlockedLinearOp &blo, Teko::BlockPreconditionerState &state) const
Function inherited from Teko::BlockPreconditionerFactory.
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).
virtual void implicitApply(const Teko::BlockedMultiVector &r, Teko::BlockedMultiVector &y, const double alpha=1.0, const double beta=0.0) const
Perform a matrix vector multiply with this implicitly defined blocked operator.