47#ifndef __Teko_PreconditionerLinearOp_hpp__
48#define __Teko_PreconditionerLinearOp_hpp__
50#include "Teko_PreconditionerLinearOpDecl.hpp"
52#include "Thyra_LinearOpBase.hpp"
53#include "Thyra_PreconditionerBase.hpp"
57template <
typename ScalarT>
58PreconditionerLinearOp<ScalarT>::PreconditionerLinearOp()
61template <
typename ScalarT>
62PreconditionerLinearOp<ScalarT>::PreconditionerLinearOp(
const Teuchos::RCP<Thyra::PreconditionerBase<ScalarT> > & prec)
64 preconditioner_.initialize(prec);
67template <
typename ScalarT>
68PreconditionerLinearOp<ScalarT>::PreconditionerLinearOp(
const Teuchos::RCP<
const Thyra::PreconditionerBase<ScalarT> > & prec)
70 preconditioner_.initialize(prec);
74template <
typename ScalarT>
78 preconditioner_.initialize(prec);
82template <
typename ScalarT>
86 preconditioner_.initialize(prec);
90template <
typename ScalarT>
97template <
typename ScalarT>
100 return getOperator_cnoc()->
range();
104template <
typename ScalarT>
107 return getOperator_cnoc()->
domain();
110template <
typename ScalarT>
112 const Thyra::EOpTransp M_trans)
const
114 return getOperator_cnoc()->opSupported(M_trans);
117template <
typename ScalarT>
119 const Thyra::EOpTransp M_trans,
120 const Thyra::MultiVectorBase<ScalarT> & x,
121 const Teuchos::Ptr<Thyra::MultiVectorBase<ScalarT> > & y,
126 getOperator_cnoc()->apply(M_trans, x, y, alpha, beta);
131template <
typename ScalarT>
134 return preconditioner_.getNonconstObj();
138template <
typename ScalarT>
141 return preconditioner_.getConstObj();
145template <
typename ScalarT>
148 Teuchos::ConstNonconstObjectContainer<Thyra::LinearOpBase<ScalarT> > oper;
149 oper.
initialize(preconditioner_.getConstObj()->getUnspecifiedPrecOp());
155template <
typename ScalarT>
158 Teuchos::ConstNonconstObjectContainer<Thyra::LinearOpBase<ScalarT> > oper;
159 oper.
initialize(preconditioner_.getNonconstObj()->getNonconstUnspecifiedPrecOp());
164template <
typename ScalarT>
166 const Teuchos::EVerbosityLevel verbLevel)
const
168 using Teuchos::OSTab;
170 Teuchos::RCP<Teuchos::FancyOStream> out = rcp(&out_arg,
false);
173 case Teuchos::VERB_DEFAULT:
174 case Teuchos::VERB_LOW:
175 *out << this->description() <<
" ( [Operator] = " << getOperator_cnoc()->description() <<
" )" << std::endl;
177 case Teuchos::VERB_MEDIUM:
178 case Teuchos::VERB_HIGH:
179 case Teuchos::VERB_EXTREME:
181 *out << Teuchos::Describable::description() <<
"{"
182 <<
"rangeDim=" << this->range()->dim()
183 <<
",domainDim=" << this->domain()->dim()
187 *out <<
"[Operator] = ";
188 *out << Teuchos::describe(*getOperator_cnoc(),verbLevel);
193 TEUCHOS_TEST_FOR_EXCEPT(
true);
197inline Teko::LinearOp extractOperatorFromPrecOp(
const Teko::LinearOp & lo)
199 Teuchos::RCP<const Teko::PreconditionerLinearOp<double> > plo =
200 Teuchos::rcp_dynamic_cast<const Teko::PreconditionerLinearOp<double> >(lo);
201 if(plo!=Teuchos::null)
202 return plo->getOperator();
Class that wraps a PreconditionerBase object it makes it behave like a linear operator.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > range() const
Range space of this operator.
void initialize(const Teuchos::RCP< Thyra::PreconditionerBase< ScalarT > > &prec)
build a linear operator using this preconditioner, this initialization permits changes
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< ScalarT > > domain() const
Domain space of this operator.
void uninitialize()
Disassociate this object with the currently owned preconditioner.