47 #ifndef __Teko_EpetraOperatorWrapper_hpp__
48 #define __Teko_EpetraOperatorWrapper_hpp__
50 #include "Thyra_LinearOpBase.hpp"
51 #include "Epetra_Map.h"
52 #include "Epetra_Comm.h"
53 #include "Epetra_MultiVector.h"
54 #include "Epetra_Operator.h"
63 class EpetraOperatorWrapper;
79 const Teuchos::Ptr<Thyra::MultiVectorBase<double> > & thyraX)
const = 0;
91 Epetra_MultiVector& epetraX)
const = 0;
95 virtual const RCP<const Epetra_Map>
domainMap()
const = 0;
98 virtual const RCP<const Epetra_Map>
rangeMap()
const = 0;
101 virtual std::string
toString()
const = 0;
117 const Teuchos::Ptr<Thyra::MultiVectorBase<double> > & thyraX) const
122 Epetra_MultiVector& epetraX)
const
131 virtual const RCP<const Epetra_Map>
rangeMap()
const
136 {
return std::string(
"InverseMapping(")+
forwardStrategy_->toString()+std::string(
")"); }
163 const Teuchos::Ptr<Thyra::MultiVectorBase<double> > & thyraX)
const;
174 virtual void copyThyraIntoEpetra(
const RCP<
const Thyra::MultiVectorBase<double> > & thyraX,
175 Epetra_MultiVector& epetraX)
const;
186 {
return std::string(
"DefaultMappingStrategy"); }
208 const RCP<const MappingStrategy> & mapStrategy);
215 int SetUseTranspose(
bool useTranspose) {
216 useTranspose_ = useTranspose;
221 int Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const ;
224 int ApplyInverse(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
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 Epetra_Comm & Comm()
const {
return *comm_;}
242 const Epetra_Map& OperatorDomainMap()
const {
return *mapStrategy_->domainMap();}
245 const Epetra_Map& OperatorRangeMap()
const {
return *mapStrategy_->rangeMap();}
248 const RCP<const Thyra::LinearOpBase<double> >
getThyraOp()
const
253 {
return mapStrategy_; }
262 Teuchos::RCP<const Epetra_Operator>
GetBlock(
int i,
int j)
const;
269 RCP<const Epetra_Comm> getEpetraComm(
const Thyra::LinearOpBase<double> & inOp)
const;
272 void SetOperator(
const RCP<
const Thyra::LinearOpBase<double> > & 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<double> > thyraOp_;
288 RCP<const Epetra_Comm> comm_;
RCP< const Thyra::VectorSpaceBase< double > > domainSpace_
Domain space object.
RCP< const Epetra_Map > domainMap_
Pointer to the constructed domain map.
virtual int GetBlockColCount()
Get the number of block columns in this operator.
RCP< const Epetra_Map > rangeMap_
Pointer to the constructed range map.
virtual const RCP< const Epetra_Map > rangeMap() const
Range map for this strategy.
virtual void copyEpetraIntoThyra(const Epetra_MultiVector &epetraX, const Teuchos::Ptr< Thyra::MultiVectorBase< double > > &thyraX) const
Copy an Epetra_MultiVector into a Thyra::MultiVectorBase.
virtual std::string toString() const =0
Identifier string.
virtual const RCP< const Epetra_Map > rangeMap() const
Range map for this strategy.
virtual void copyEpetraIntoThyra(const Epetra_MultiVector &epetraX, const Teuchos::Ptr< Thyra::MultiVectorBase< double > > &thyraX) const
Copy an Epetra_MultiVector into a Thyra::MultiVectorBase.
const RCP< const MappingStrategy > forwardStrategy_
Forward mapping strategy object.
Teuchos::RCP< const Epetra_Operator > GetBlock(int i, int j) const
Grab the i,j block.
virtual std::string toString() const
Identifier string.
virtual int GetBlockRowCount()
Get the number of block rows in this operator.
virtual const RCP< const Epetra_Map > domainMap() const =0
Domain map for this strategy.
Implements the Epetra_Operator interface with a Thyra LinearOperator. This enables the use of absrtac...
virtual std::string toString() const
Identifier string.
virtual void copyEpetraIntoThyra(const Epetra_MultiVector &epetraX, const Teuchos::Ptr< Thyra::MultiVectorBase< double > > &thyraX) const =0
Copy an Epetra_MultiVector into a Thyra::MultiVectorBase.
Flip a mapping strategy object around to give the "inverse" mapping strategy.
const RCP< const MappingStrategy > getMapStrategy() const
Get the mapping strategy for this wrapper (translate between Thyra and Epetra)
virtual const RCP< const Epetra_Map > domainMap() const
Domain map for this strategy.
virtual const RCP< const Epetra_Map > rangeMap() const =0
Range map for this strategy.
virtual void copyThyraIntoEpetra(const RCP< const Thyra::MultiVectorBase< double > > &thyraX, Epetra_MultiVector &epetraX) const =0
Copy an Thyra::MultiVectorBase into a Epetra_MultiVector.
virtual void copyThyraIntoEpetra(const RCP< const Thyra::MultiVectorBase< double > > &thyraX, Epetra_MultiVector &epetraX) const
Copy an Thyra::MultiVectorBase into a Epetra_MultiVector.
virtual void copyThyraIntoEpetra(const RCP< const Thyra::MultiVectorBase< double > > &thyraX, Epetra_MultiVector &epetraX) 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 EpetraOperatorWrapper
const RCP< const Thyra::LinearOpBase< double > > getThyraOp() const
Return the thyra operator associated with this wrapper.
RCP< const Thyra::VectorSpaceBase< double > > rangeSpace_
Range space object.
Abstract Mapping strategy for an EpetraOperatorWrapper.
virtual const RCP< const Epetra_Map > domainMap() const
Domain map for this strategy.