47 #include "Teko_DiagonalPreconditionerOp.hpp"
48 #include "Thyra_EpetraThyraWrappers.hpp"
49 #include "EpetraExt_PointToBlockDiagPermute.h"
50 #include "Epetra_MultiVector.h"
52 using Teuchos::rcpFromRef;
53 using Teuchos::rcp_dynamic_cast;
54 using Teuchos::rcp_const_cast;
57 using Thyra::MultiVectorBase;
61 DiagonalPreconditionerOp::DiagonalPreconditionerOp(Teuchos::RCP<EpetraExt_PointToBlockDiagPermute> BDP,
const VectorSpace range,
const VectorSpace domain):
67 void DiagonalPreconditionerOp::implicitApply(
const MultiVector & x, MultiVector & y,
68 const double alpha,
const double beta)
const
72 const Epetra_Map & rangemap_=BDP_->OperatorRangeMap();
73 const Epetra_Map & domainmap_=BDP_->OperatorDomainMap();
75 RCP<const Epetra_MultiVector> x_=Thyra::get_Epetra_MultiVector(domainmap_,x);
76 RCP<Epetra_MultiVector> y_=Thyra::get_Epetra_MultiVector(rangemap_,y);
77 TEUCHOS_ASSERT(x_!=Teuchos::null);
78 TEUCHOS_ASSERT(y_!=Teuchos::null);
83 BDP_->ApplyInverse(*x_,*y_);
87 MultiVector y0=deepcopy(y);
88 BDP_->ApplyInverse(*x_,*y_);
89 update(alpha,y,beta,y0);
93 void DiagonalPreconditionerOp::describe(Teuchos::FancyOStream & out_arg,
94 const Teuchos::EVerbosityLevel verbLevel)
const
99 case Teuchos::VERB_DEFAULT:
100 case Teuchos::VERB_LOW:
101 out_arg << this->description() << std::endl;
103 case Teuchos::VERB_MEDIUM:
104 case Teuchos::VERB_HIGH:
105 case Teuchos::VERB_EXTREME:
106 if(BDP_!=Teuchos::null)
107 BDP_->Print(out_arg);
110 TEUCHOS_TEST_FOR_EXCEPT(
true);