47 #ifndef __Teko_StridedTpetraOperator_hpp__
48 #define __Teko_StridedTpetraOperator_hpp__
51 #include "Tpetra_Operator.hpp"
54 #include "Teuchos_RCP.hpp"
56 #include "Thyra_LinearOpBase.hpp"
59 #include "Teko_BlockedReordering.hpp"
60 #include "Teko_TpetraOperatorWrapper.hpp"
61 #include "Teko_TpetraStridedMappingStrategy.hpp"
62 #include "Teko_ConfigDefs.hpp"
65 namespace TpetraHelpers {
67 class StridedTpetraOperator :
public TpetraOperatorWrapper {
69 enum eNormType { Inf, One, Frobenius};
71 StridedTpetraOperator(
int numVars,
const Teuchos::RCP<
const Tpetra::Operator<ST,LO,GO,NT> > & content,
72 const std::string & label=
"<ANYM>");
73 StridedTpetraOperator(
const std::vector<int> & vars,
const Teuchos::RCP<
const Tpetra::Operator<ST,LO,GO,NT> > & content,
74 const std::string & label=
"<ANYM>");
76 virtual void SetContent(
const std::vector<int> & vars,
const Teuchos::RCP<
const Tpetra::Operator<ST,LO,GO,NT> > & content);
78 virtual void RebuildOps()
79 { BuildBlockedOperator(); }
81 virtual const Teuchos::RCP<const Tpetra::Operator<ST,LO,GO,NT> > GetContent()
const
82 {
return fullContent_; }
87 const Teuchos::RCP<const Tpetra::Operator<ST,LO,GO,NT> > GetBlock(
int i,
int j)
const;
92 void Reorder(
const BlockReorderManager & brm);
95 void RemoveReording();
99 virtual void WriteBlocks(
const std::string & prefix)
const;
108 virtual std::string PrintNorm(
const eNormType & nrmType=Frobenius,
const char newline=
'\n');
114 virtual ~StridedTpetraOperator() {}
119 virtual int SetUseTranspose(
bool )
122 virtual int applyInverse(
const Tpetra::MultiVector<ST,LO,GO,NT> &, Tpetra::MultiVector<ST,LO,GO,NT> &)
const
123 { TEUCHOS_ASSERT(
false);
return -1; }
125 virtual ST NormInf()
const
126 { TEUCHOS_ASSERT(
false);
return 0.0; }
129 virtual bool UseTranspose()
const {
return false; }
130 virtual bool HasNormInf()
const {
return false; }
131 virtual const Teuchos::Comm<int> & Comm()
const {
return *fullContent_->getRangeMap()->getComm(); }
135 bool testAgainstFullOperator(
int count,ST tol)
const;
139 Teuchos::RCP<const Tpetra::Operator<ST,LO,GO,NT> > fullContent_;
140 Teuchos::RCP<TpetraStridedMappingStrategy> stridedMapping_;
141 Teuchos::RCP<Thyra::LinearOpBase<ST> > stridedOperator_;
142 Teuchos::RCP<const BlockReorderManager> reorderManager_;
146 void BuildBlockedOperator();