47 #ifndef __Teko_TpetraOperatorWrapper_hpp__
48 #define __Teko_TpetraOperatorWrapper_hpp__
50 #include "Thyra_LinearOpBase.hpp"
51 #include "Tpetra_Map.hpp"
52 #include "Tpetra_MultiVector.hpp"
53 #include "Tpetra_Operator.hpp"
54 #include "Teko_ConfigDefs.hpp"
60 namespace TpetraHelpers {
63 class TpetraOperatorWrapper;
79 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> > & thyraX)
const = 0;
91 Tpetra::MultiVector<ST,LO,GO,NT>& tpetraX)
const = 0;
95 virtual const RCP<const Tpetra::Map<LO,GO,NT> >
domainMap()
const = 0;
98 virtual const RCP<const Tpetra::Map<LO,GO,NT> >
rangeMap()
const = 0;
101 virtual std::string
toString()
const = 0;
117 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> > & thyraX) const
122 Tpetra::MultiVector<ST,LO,GO,NT>& tpetraX)
const
127 virtual const RCP<const Tpetra::Map<LO,GO,NT> >
domainMap()
const
131 virtual const RCP<const Tpetra::Map<LO,GO,NT> >
rangeMap()
const
136 {
return std::string(
"InverseMapping(")+
forwardStrategy_->toString()+std::string(
")"); }
150 DefaultMappingStrategy(
const RCP<
const Thyra::LinearOpBase<ST> > & thyraOp,
const Teuchos::Comm<Thyra::Ordinal> & comm);
163 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> > & thyraX)
const;
175 Tpetra::MultiVector<ST,LO,GO,NT>& tpetraX)
const;
186 {
return std::string(
"DefaultMappingStrategy"); }
208 const RCP<const MappingStrategy> & mapStrategy);
215 int SetUseTranspose(
bool useTranspose) {
216 useTranspose_ = useTranspose;
221 void apply(
const Tpetra::MultiVector<ST,LO,GO,NT>& X, Tpetra::MultiVector<ST,LO,GO,NT>& Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, ST alpha=Teuchos::ScalarTraits< ST >::one(), ST beta=Teuchos::ScalarTraits< ST >::zero())
const ;
224 void applyInverse(
const Tpetra::MultiVector<ST,LO,GO,NT>& X, Tpetra::MultiVector<ST,LO,GO,NT>& Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, ST alpha=Teuchos::ScalarTraits< ST >::one(), ST beta=Teuchos::ScalarTraits< ST >::zero())
const ;
227 double NormInf()
const ;
230 const char* Label()
const {
return label_.c_str();}
233 bool UseTranspose()
const {
return useTranspose_;}
236 bool HasNormInf()
const {
return false;}
239 const Teuchos::RCP<const Teuchos::Comm<Thyra::Ordinal> > & Comm()
const {
return comm_;}
242 Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > getDomainMap()
const {
return mapStrategy_->domainMap();}
245 Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > getRangeMap()
const {
return mapStrategy_->rangeMap();}
253 {
return mapStrategy_; }
262 Teuchos::RCP<const Tpetra::Operator<ST,LO,GO,NT> >
GetBlock(
int i,
int j)
const;
269 RCP<const Teuchos::Comm<Thyra::Ordinal> > getThyraComm(
const Thyra::LinearOpBase<ST> & inOp)
const;
272 void SetOperator(
const RCP<
const Thyra::LinearOpBase<ST> > & thyraOp,
bool buildMap=
true);
275 void SetMapStrategy(
const RCP<const MappingStrategy> & mapStrategy)
276 { mapStrategy_ = mapStrategy; }
279 RCP<const MappingStrategy> mapStrategy_;
282 RCP<const Thyra::LinearOpBase<ST> > thyraOp_;
288 RCP<const Teuchos::Comm<Thyra::Ordinal> > comm_;
RCP< const Thyra::VectorSpaceBase< ST > > domainSpace_
Domain space object.
virtual void copyTpetraIntoThyra(const Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX, const Teuchos::Ptr< Thyra::MultiVectorBase< ST > > &thyraX) const =0
Copy an Epetra_MultiVector into a Thyra::MultiVectorBase.
virtual const RCP< const Tpetra::Map< LO, GO, NT > > rangeMap() const
Range map for this strategy.
virtual std::string toString() const
Identifier string.
virtual void copyThyraIntoTpetra(const RCP< const Thyra::MultiVectorBase< ST > > &thyraX, Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX) const
Copy an Thyra::MultiVectorBase into a Epetra_MultiVector.
InverseMappingStrategy(const RCP< const MappingStrategy > &forward)
Constructor to build a inverse MappingStrategy from a forward map.
default mapping strategy for the basic TpetraOperatorWrapper
virtual void copyThyraIntoTpetra(const RCP< const Thyra::MultiVectorBase< ST > > &thyraX, Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX) const
Copy an Thyra::MultiVectorBase into a Epetra_MultiVector.
Abstract Mapping strategy for an TpetraOperatorWrapper.
RCP< const Thyra::VectorSpaceBase< ST > > rangeSpace_
Range space object.
virtual const RCP< const Tpetra::Map< LO, GO, NT > > rangeMap() const =0
Range map for this strategy.
const RCP< const Thyra::LinearOpBase< ST > > getThyraOp() const
Return the thyra operator associated with this wrapper.
virtual void copyThyraIntoTpetra(const RCP< const Thyra::MultiVectorBase< ST > > &thyraX, Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX) const =0
Copy an Thyra::MultiVectorBase into a Epetra_MultiVector.
RCP< const Tpetra::Map< LO, GO, NT > > domainMap_
Pointer to the constructed domain map.
virtual const RCP< const Tpetra::Map< LO, GO, NT > > domainMap() const
Domain map for this strategy.
virtual std::string toString() const
Identifier string.
const RCP< const MappingStrategy > forwardStrategy_
Forward mapping strategy object.
Flip a mapping strategy object around to give the "inverse" mapping strategy.
RCP< const Tpetra::Map< LO, GO, NT > > rangeMap_
Pointer to the constructed range map.
virtual void copyTpetraIntoThyra(const Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX, const Teuchos::Ptr< Thyra::MultiVectorBase< ST > > &thyraX) const
Copy an Epetra_MultiVector into a Thyra::MultiVectorBase.
virtual std::string toString() const =0
Identifier string.
Teuchos::RCP< const Tpetra::Operator< ST, LO, GO, NT > > GetBlock(int i, int j) const
Grab the i,j block.
virtual const RCP< const Tpetra::Map< LO, GO, NT > > rangeMap() const
Range map for this strategy.
const RCP< const MappingStrategy > getMapStrategy() const
Get the mapping strategy for this wrapper (translate between Thyra and Epetra)
virtual void copyTpetraIntoThyra(const Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX, const Teuchos::Ptr< Thyra::MultiVectorBase< ST > > &thyraX) const
Copy an Epetra_MultiVector into a Thyra::MultiVectorBase.
virtual int GetBlockRowCount()
Get the number of block rows in this operator.
virtual const RCP< const Tpetra::Map< LO, GO, NT > > domainMap() const
Domain map for this strategy.
virtual int GetBlockColCount()
Get the number of block columns in this operator.
virtual const RCP< const Tpetra::Map< LO, GO, NT > > domainMap() const =0
Domain map for this strategy.
Implements the Epetra_Operator interface with a Thyra LinearOperator. This enables the use of absrtac...