47 #ifndef __Teko_EpetraHelpers_hpp__
48 #define __Teko_EpetraHelpers_hpp__
54 #include "Epetra_Operator.h"
55 #include "Epetra_CrsMatrix.h"
56 #include "Epetra_MultiVector.h"
59 #include "Teuchos_RCP.hpp"
62 #include "Thyra_VectorBase.hpp"
63 #include "Thyra_DefaultSpmdMultiVector.hpp"
78 void fillDefaultSpmdMultiVector(Teuchos::RCP<Thyra::DefaultSpmdMultiVector<double> > & spmdMV,
79 Teuchos::RCP<Epetra_MultiVector> & epetraMV);
91 const Teuchos::RCP<const Thyra::LinearOpBase<double> > thyraDiagOp(
const Teuchos::RCP<const Epetra_Vector> & ev,
92 const Epetra_Map & map,
const std::string & lbl=
"ANYM");
104 const Teuchos::RCP<Thyra::LinearOpBase<double> > thyraDiagOp(
const Teuchos::RCP<Epetra_Vector> & ev,
105 const Epetra_Map & map,
const std::string & lbl=
"ANYM");
116 void identityRowIndices(
const Epetra_Map & rowMap,
const Epetra_CrsMatrix & mat,std::vector<int> & outIndices);
128 void zeroMultiVectorRowIndices(Epetra_MultiVector & mv,
const std::vector<int> & zeroIndices);
144 ZeroedOperator(
const std::vector<int> & zeroIndices,
const Teuchos::RCP<const Epetra_Operator> & op);
156 int Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
159 int ApplyInverse(
const Epetra_MultiVector& , Epetra_MultiVector& )
const
163 double NormInf()
const {
return -1.0; }
166 const char* Label()
const
167 {
return (
"zeroed( "+std::string(epetraOp_->Label())+
" )").c_str(); }
170 bool UseTranspose()
const {
return false;}
173 bool HasNormInf()
const {
return false;}
176 const Epetra_Comm & Comm()
const {
return epetraOp_->Comm(); }
179 const Epetra_Map& OperatorDomainMap()
const {
return epetraOp_->OperatorDomainMap(); }
182 const Epetra_Map& OperatorRangeMap()
const {
return epetraOp_->OperatorRangeMap(); }
187 std::vector<int> zeroIndices_;
188 const Teuchos::RCP<const Epetra_Operator> epetraOp_;
int SetUseTranspose(bool)
Can't transpose a ZeroedOperator.
int ApplyInverse(const Epetra_MultiVector &, Epetra_MultiVector &) const
Can't call ApplyInverse on a zeroed operator.
ZeroedOperator(const std::vector< int > &zeroIndices, const Teuchos::RCP< const Epetra_Operator > &op)
Constructor for a ZeroedOperator.
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Perform a matrix-vector product with certain rows zeroed out.
virtual ~ZeroedOperator()
Do nothing destructor.