10 #ifndef __Teko_EpetraHelpers_hpp__
11 #define __Teko_EpetraHelpers_hpp__
17 #include "Epetra_Operator.h"
18 #include "Epetra_CrsMatrix.h"
19 #include "Epetra_MultiVector.h"
22 #include "Teuchos_RCP.hpp"
25 #include "Thyra_VectorBase.hpp"
26 #include "Thyra_DefaultSpmdMultiVector.hpp"
41 void fillDefaultSpmdMultiVector(Teuchos::RCP<Thyra::DefaultSpmdMultiVector<double> >& spmdMV,
42 Teuchos::RCP<Epetra_MultiVector>& epetraMV);
54 const Teuchos::RCP<const Thyra::LinearOpBase<double> > thyraDiagOp(
55 const Teuchos::RCP<const Epetra_Vector>& ev,
const Epetra_Map& map,
56 const std::string& lbl =
"ANYM");
68 const Teuchos::RCP<Thyra::LinearOpBase<double> > thyraDiagOp(
const Teuchos::RCP<Epetra_Vector>& ev,
69 const Epetra_Map& map,
70 const std::string& lbl =
"ANYM");
81 void identityRowIndices(
const Epetra_Map& rowMap,
const Epetra_CrsMatrix& mat,
82 std::vector<int>& outIndices);
94 void zeroMultiVectorRowIndices(Epetra_MultiVector& mv,
const std::vector<int>& zeroIndices);
111 const Teuchos::RCP<const Epetra_Operator>& op);
123 int Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
126 int ApplyInverse(
const Epetra_MultiVector& , Epetra_MultiVector& )
const {
131 double NormInf()
const {
return -1.0; }
134 const char* Label()
const {
return label_.c_str(); }
137 bool UseTranspose()
const {
return false; }
140 bool HasNormInf()
const {
return false; }
143 const Epetra_Comm& Comm()
const {
return epetraOp_->Comm(); }
146 const Epetra_Map& OperatorDomainMap()
const {
return epetraOp_->OperatorDomainMap(); }
149 const Epetra_Map& OperatorRangeMap()
const {
return epetraOp_->OperatorRangeMap(); }
154 std::vector<int> zeroIndices_;
155 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.