10 #ifndef __Teko_StridedTpetraOperator_hpp__
11 #define __Teko_StridedTpetraOperator_hpp__
14 #include "Tpetra_Operator.hpp"
17 #include "Teuchos_RCP.hpp"
19 #include "Thyra_LinearOpBase.hpp"
22 #include "Teko_BlockedReordering.hpp"
23 #include "Teko_TpetraOperatorWrapper.hpp"
24 #include "Teko_TpetraStridedMappingStrategy.hpp"
25 #include "Teko_ConfigDefs.hpp"
28 namespace TpetraHelpers {
30 class StridedTpetraOperator :
public TpetraOperatorWrapper {
32 enum eNormType { Inf, One, Frobenius };
34 StridedTpetraOperator(
int numVars,
35 const Teuchos::RCP<
const Tpetra::Operator<ST, LO, GO, NT> > &content,
36 const std::string &label =
"<ANYM>");
37 StridedTpetraOperator(
const std::vector<int> &vars,
38 const Teuchos::RCP<
const Tpetra::Operator<ST, LO, GO, NT> > &content,
39 const std::string &label =
"<ANYM>");
41 virtual void SetContent(
const std::vector<int> &vars,
42 const Teuchos::RCP<
const Tpetra::Operator<ST, LO, GO, NT> > &content);
44 virtual void RebuildOps() { BuildBlockedOperator(); }
46 virtual const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > GetContent()
const {
53 const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > GetBlock(
int i,
int j)
const;
58 void Reorder(
const BlockReorderManager &brm);
61 void RemoveReording();
65 virtual void WriteBlocks(
const std::string &prefix)
const;
74 virtual std::string PrintNorm(
const eNormType &nrmType = Frobenius,
const char newline =
'\n');
80 virtual ~StridedTpetraOperator() {}
85 virtual int SetUseTranspose(
bool ) {
return -1; }
87 virtual int applyInverse(
const Tpetra::MultiVector<ST, LO, GO, NT> & ,
88 Tpetra::MultiVector<ST, LO, GO, NT> & )
const {
89 TEUCHOS_ASSERT(
false);
93 virtual ST NormInf()
const {
94 TEUCHOS_ASSERT(
false);
99 virtual bool UseTranspose()
const {
return false; }
100 virtual bool HasNormInf()
const {
return false; }
101 virtual const Teuchos::Comm<int> &Comm()
const {
return *fullContent_->getRangeMap()->getComm(); }
104 bool testAgainstFullOperator(
int count, ST tol)
const;
108 Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > fullContent_;
109 Teuchos::RCP<TpetraStridedMappingStrategy> stridedMapping_;
110 Teuchos::RCP<Thyra::LinearOpBase<ST> > stridedOperator_;
111 Teuchos::RCP<const BlockReorderManager> reorderManager_;
115 void BuildBlockedOperator();