47 #include "Teko_MultPreconditionerFactory.hpp"
54 const double ,
const double )
const
62 Teko::MultiVector MOne_r = Teko::deepcopy(r);
63 Teko::MultiVector t = Teko::deepcopy(r);
64 Teko::MultiVector w = Teko::toMultiVector(y);
66 Teko::applyOp(M1_, r, MOne_r);
67 Teko::applyOp(A_, MOne_r, t);
68 Teko::update(1.,r,-1.,t);
69 Teko::applyOp(M2_, t, w);
70 Teko::update(1.,MOne_r, 1., w);
74 MultPreconditionerFactory
75 ::MultPreconditionerFactory(
const RCP<const Teko::BlockPreconditionerFactory> & FirstFactory,
76 const RCP<const Teko::BlockPreconditionerFactory> & SecondFactory)
77 : FirstFactory_(FirstFactory), SecondFactory_(SecondFactory)
80 MultPreconditionerFactory::MultPreconditionerFactory()
88 mystate->StateTwo_ = Teuchos::rcp_dynamic_cast<
BlockPreconditionerState>(SecondFactory_->buildPreconditionerState());
101 TEUCHOS_ASSERT(MyState != 0);
103 Teko::LinearOp M1 = FirstFactory_->buildPreconditionerOperator(blockOp, *MyState->StateOne_);
104 Teko::LinearOp M2 = SecondFactory_->buildPreconditionerOperator(blockOp, *MyState->StateTwo_);
134 std::string aStr=
"", bStr=
"";
137 aStr = pl.get<std::string>(
"Preconditioner A");
138 bStr = pl.get<std::string>(
"Preconditioner B");
140 RCP<const Teuchos::ParameterList> aSettings = invLib->getParameterList(aStr);
141 RCP<const Teuchos::ParameterList> bSettings = invLib->getParameterList(bStr);
144 std::string aType = aSettings->get<std::string>(
"Preconditioner Type");
145 RCP<Teko::PreconditionerFactory> precA
149 std::string bType = bSettings->get<std::string>(
"Preconditioner Type");
150 RCP<Teko::PreconditionerFactory> precB
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.