47 #ifndef __Teko_StridedEpetraOperator_hpp__
48 #define __Teko_StridedEpetraOperator_hpp__
51 #include "Epetra_Operator.h"
54 #include "Teuchos_RCP.hpp"
56 #include "Thyra_LinearOpBase.hpp"
59 #include "Teko_BlockedReordering.hpp"
60 #include "Teko_EpetraOperatorWrapper.hpp"
61 #include "Teko_StridedMappingStrategy.hpp"
66 class StridedEpetraOperator :
public EpetraOperatorWrapper {
68 enum eNormType { Inf, One, Frobenius};
70 StridedEpetraOperator(
int numVars,
const Teuchos::RCP<const Epetra_Operator> & content,
71 const std::string & label=
"<ANYM>");
72 StridedEpetraOperator(
const std::vector<int> & vars,
const Teuchos::RCP<const Epetra_Operator> & content,
73 const std::string & label=
"<ANYM>");
75 virtual void SetContent(
const std::vector<int> & vars,
const Teuchos::RCP<const Epetra_Operator> & content);
77 virtual void RebuildOps()
78 { BuildBlockedOperator(); }
80 virtual const Teuchos::RCP<const Epetra_Operator> GetContent()
const
81 {
return fullContent_; }
86 const Teuchos::RCP<const Epetra_Operator> GetBlock(
int i,
int j)
const;
91 void Reorder(
const BlockReorderManager & brm);
94 void RemoveReording();
98 virtual void WriteBlocks(
const std::string & prefix)
const;
107 virtual std::string PrintNorm(
const eNormType & nrmType=Frobenius,
const char newline=
'\n');
113 virtual ~StridedEpetraOperator() {}
118 virtual int SetUseTranspose(
bool )
121 virtual int ApplyInverse(
const Epetra_MultiVector &, Epetra_MultiVector &)
const
122 { TEUCHOS_ASSERT(
false);
return -1; }
124 virtual double NormInf()
const
125 { TEUCHOS_ASSERT(
false);
return 0.0; }
128 virtual bool UseTranspose()
const {
return false; }
129 virtual bool HasNormInf()
const {
return false; }
130 virtual const Epetra_Comm & Comm()
const {
return fullContent_->Comm(); }
133 #ifndef Teko_DEBUG_OFF
134 bool testAgainstFullOperator(
int count,
double tol)
const;
140 Teuchos::RCP<const Epetra_Operator> fullContent_;
141 Teuchos::RCP<StridedMappingStrategy> stridedMapping_;
142 Teuchos::RCP<Thyra::LinearOpBase<double> > stridedOperator_;
143 Teuchos::RCP<const BlockReorderManager> reorderManager_;
147 void BuildBlockedOperator();