9 #ifndef Thyra_MultiVectorPreconditioner_hpp
10 #define Thyra_MultiVectorPreconditioner_hpp
12 #include "Thyra_PreconditionerBase.hpp"
13 #include "Teuchos_ConstNonconstObjectContainer.hpp"
15 #include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
22 template<
class Scalar>
34 const RCP<PreconditionerBase<Scalar> > &prec,
35 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
36 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
45 const RCP<
const PreconditionerBase<Scalar> > &prec,
46 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
47 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain) {
54 RCP<PreconditionerBase<Scalar> >
57 RCP<const PreconditionerBase<Scalar> >
72 {
return prec_.getConstObj()->isLeftPrecOpConst(); }
75 {
return nonconstMultiVectorLinearOp(
76 prec_.getNonconstObj()->getNonconstLeftPrecOp(),
81 {
return multiVectorLinearOp(
82 prec_.getConstObj()->getLeftPrecOp(),
87 {
return prec_.getConstObj()->isRightPrecOpConst(); }
90 {
return nonconstMultiVectorLinearOp(
91 prec_.getNonconstObj()->getNonconstRightPrecOp(),
96 {
return multiVectorLinearOp(
97 prec_.getConstObj()->getRightPrecOp(),
102 {
return prec_.getConstObj()->isUnspecifiedPrecOpConst(); }
105 {
return nonconstMultiVectorLinearOp(
106 prec_.getNonconstObj()->getNonconstUnspecifiedPrecOp(),
111 {
return multiVectorLinearOp(
112 prec_.getNonconstObj()->getUnspecifiedPrecOp(),
123 typedef Teuchos::ConstNonconstObjectContainer<PreconditionerBase<Scalar> >
CNPB;
136 const RCP<
const PreconditionerBase<Scalar> > &prec,
137 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
138 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
141 TEUCHOS_TEST_FOR_EXCEPT(is_null(prec));
142 TEUCHOS_TEST_FOR_EXCEPT(is_null(multiVecRange));
143 TEUCHOS_TEST_FOR_EXCEPT(is_null(multiVecDomain));
144 TEUCHOS_TEST_FOR_EXCEPT( multiVecRange->numBlocks() != multiVecDomain->numBlocks() );
148 (void)multiVecDomain;
158 template<
class Scalar>
159 RCP<MultiVectorPreconditioner<Scalar> >
169 template<
class Scalar>
170 RCP<MultiVectorPreconditioner<Scalar> >
172 const RCP<PreconditionerBase<Scalar> > &prec,
173 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
174 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
177 RCP<MultiVectorPreconditioner<Scalar> >
179 mvprec->nonconstInitialize(prec,multiVecRange,multiVecDomain);
187 template<
class Scalar>
188 RCP<MultiVectorPreconditioner<Scalar> >
190 const RCP<
const PreconditionerBase<Scalar> > &prec,
191 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecRange,
192 const RCP<
const DefaultMultiVectorProductVectorSpace<Scalar> > &multiVecDomain
195 RCP<MultiVectorPreconditioner<Scalar> >
197 mvprec->initialize(prec,multiVecRange,multiVecDomain);
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstLeftPrecOp()
RCP< PreconditionerBase< Scalar > > getNonconstPreconditioner()
bool isUnspecifiedPrecOpConst() const
void nonconstInitialize(const RCP< PreconditionerBase< Scalar > > &prec, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
Teuchos::RCP< const LinearOpBase< Scalar > > getLeftPrecOp() const
RCP< MultiVectorPreconditioner< Scalar > > multiVectorPreconditioner()
Nonmember constructor function.
RCP< const PreconditionerBase< Scalar > > getPreconditioner() const
bool isRightPrecOpConst() const
Teuchos::ConstNonconstObjectContainer< PreconditionerBase< Scalar > > CNPB
RCP< MultiVectorPreconditioner< Scalar > > nonconstMultiVectorPreconditioner(const RCP< PreconditionerBase< Scalar > > &prec, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
Nonmember constructor function.
Teuchos::RCP< const LinearOpBase< Scalar > > getRightPrecOp() const
static void validateInitialize(const RCP< const PreconditionerBase< Scalar > > &prec, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > multiVecRange_
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstRightPrecOp()
RCP< MultiVectorPreconditioner< Scalar > > multiVectorPreconditioner(const RCP< const PreconditionerBase< Scalar > > &prec, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
Nonmember constructor function.
RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > multiVecDomain_
Teuchos::RCP< const LinearOpBase< Scalar > > getUnspecifiedPrecOp() const
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstUnspecifiedPrecOp()
Concrete PreconditionerBase subclass that wraps a preconditioner operator in MultiVectorLinearOp.
MultiVectorPreconditioner()
Construct to uninitialized.
void initialize(const RCP< const PreconditionerBase< Scalar > > &prec, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecRange, const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &multiVecDomain)
bool isLeftPrecOpConst() const