10 #ifndef __Teko_StridedEpetraOperator_hpp__
11 #define __Teko_StridedEpetraOperator_hpp__
14 #include "Epetra_Operator.h"
17 #include "Teuchos_RCP.hpp"
19 #include "Thyra_LinearOpBase.hpp"
22 #include "Teko_BlockedReordering.hpp"
23 #include "Teko_EpetraOperatorWrapper.hpp"
24 #include "Teko_StridedMappingStrategy.hpp"
29 class StridedEpetraOperator :
public EpetraOperatorWrapper {
31 enum eNormType { Inf, One, Frobenius };
33 StridedEpetraOperator(
int numVars,
const Teuchos::RCP<const Epetra_Operator> &content,
34 const std::string &label =
"<ANYM>");
35 StridedEpetraOperator(
const std::vector<int> &vars,
36 const Teuchos::RCP<const Epetra_Operator> &content,
37 const std::string &label =
"<ANYM>");
39 virtual void SetContent(
const std::vector<int> &vars,
40 const Teuchos::RCP<const Epetra_Operator> &content);
42 virtual void RebuildOps() { BuildBlockedOperator(); }
44 virtual const Teuchos::RCP<const Epetra_Operator> GetContent()
const {
return fullContent_; }
49 const Teuchos::RCP<const Epetra_Operator> GetBlock(
int i,
int j)
const;
54 void Reorder(
const BlockReorderManager &brm);
57 void RemoveReording();
61 virtual void WriteBlocks(
const std::string &prefix)
const;
70 virtual std::string PrintNorm(
const eNormType &nrmType = Frobenius,
const char newline =
'\n');
76 virtual ~StridedEpetraOperator() {}
81 virtual int SetUseTranspose(
bool ) {
return -1; }
83 virtual int ApplyInverse(
const Epetra_MultiVector & , Epetra_MultiVector & )
const {
84 TEUCHOS_ASSERT(
false);
88 virtual double NormInf()
const {
89 TEUCHOS_ASSERT(
false);
94 virtual bool UseTranspose()
const {
return false; }
95 virtual bool HasNormInf()
const {
return false; }
96 virtual const Epetra_Comm &Comm()
const {
return fullContent_->Comm(); }
99 bool testAgainstFullOperator(
int count,
double tol)
const;
103 Teuchos::RCP<const Epetra_Operator> fullContent_;
104 Teuchos::RCP<StridedMappingStrategy> stridedMapping_;
105 Teuchos::RCP<Thyra::LinearOpBase<double> > stridedOperator_;
106 Teuchos::RCP<const BlockReorderManager> reorderManager_;
110 void BuildBlockedOperator();