10 #ifndef __Teko_EpetraOperatorWrapper_hpp__
11 #define __Teko_EpetraOperatorWrapper_hpp__
13 #include "Thyra_LinearOpBase.hpp"
14 #include "Epetra_Map.h"
15 #include "Epetra_Comm.h"
16 #include "Epetra_MultiVector.h"
17 #include "Epetra_Operator.h"
25 class EpetraOperatorWrapper;
41 const Epetra_MultiVector& epetraX,
42 const Teuchos::Ptr<Thyra::MultiVectorBase<double> >& thyraX)
const = 0;
54 Epetra_MultiVector& epetraX)
const = 0;
58 virtual const RCP<const Epetra_Map>
domainMap()
const = 0;
61 virtual const RCP<const Epetra_Map>
rangeMap()
const = 0;
64 virtual std::string
toString()
const = 0;
78 const Epetra_MultiVector& epetraX,
79 const Teuchos::Ptr<Thyra::MultiVectorBase<double> >& thyraX) const
86 Epetra_MultiVector& epetraX)
const
100 return std::string(
"InverseMapping(") +
forwardStrategy_->toString() + std::string(
")");
117 const Epetra_Comm& comm);
130 const Epetra_MultiVector& epetraX,
131 const Teuchos::Ptr<Thyra::MultiVectorBase<double> >& thyraX)
const;
143 Epetra_MultiVector& epetraX)
const;
153 virtual std::string
toString()
const {
return std::string(
"DefaultMappingStrategy"); }
174 const RCP<const MappingStrategy>& mapStrategy);
181 int SetUseTranspose(
bool useTranspose) {
182 useTranspose_ = useTranspose;
187 int Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
190 int ApplyInverse(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
193 double NormInf()
const;
196 const char* Label()
const {
return label_.c_str(); }
199 bool UseTranspose()
const {
return useTranspose_; }
202 bool HasNormInf()
const {
return false; }
205 const Epetra_Comm& Comm()
const {
return *comm_; }
208 const Epetra_Map& OperatorDomainMap()
const {
return *mapStrategy_->domainMap(); }
211 const Epetra_Map& OperatorRangeMap()
const {
return *mapStrategy_->rangeMap(); }
214 const RCP<const Thyra::LinearOpBase<double> >
getThyraOp()
const {
return thyraOp_; }
226 Teuchos::RCP<const Epetra_Operator>
GetBlock(
int i,
int j)
const;
233 RCP<const Epetra_Comm> getEpetraComm(
const Thyra::LinearOpBase<double>& inOp)
const;
236 void SetOperator(
const RCP<
const Thyra::LinearOpBase<double> >& thyraOp,
bool buildMap =
true);
239 void SetMapStrategy(
const RCP<const MappingStrategy>& mapStrategy) { mapStrategy_ = mapStrategy; }
242 RCP<const MappingStrategy> mapStrategy_;
245 RCP<const Thyra::LinearOpBase<double> > thyraOp_;
251 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.