10 #include "Teko_ReorderedLinearOp.hpp"
14 ReorderedLinearOp::ReorderedLinearOp(
const Teuchos::RCP<const BlockReorderManager>& mgr,
15 const Teuchos::RCP<Thyra::LinearOpBase<double> >& blockedOp)
16 : mgr_(mgr), blockedOp_(blockedOp) {
17 range_ = buildFlatVectorSpace(*mgr_, blockedOp_->range());
18 domain_ = buildFlatVectorSpace(*mgr_, blockedOp_->domain());
26 const double beta)
const {
27 using Teuchos::rcp_dynamic_cast;
30 *mgr_, rcp_dynamic_cast<
const Thyra::ProductMultiVectorBase<double> >(x));
32 *mgr_, rcp_dynamic_cast<Thyra::ProductMultiVectorBase<double> >(y));
35 Thyra::apply(*blockedOp_, Thyra::NOTRANS, *reorderX, reorderY.ptr(), alpha, beta);
38 void ReorderedLinearOp::describe(Teuchos::FancyOStream& out_arg,
39 const Teuchos::EVerbosityLevel verbLevel)
const {
43 RCP<Teuchos::FancyOStream> out = rcp(&out_arg,
false);
46 case Teuchos::VERB_DEFAULT:
47 case Teuchos::VERB_LOW: *out << this->description() << std::endl;
break;
48 case Teuchos::VERB_MEDIUM:
49 case Teuchos::VERB_HIGH:
50 case Teuchos::VERB_EXTREME: {
51 *out << Teuchos::Describable::description() <<
"{"
52 <<
"rangeDim=" << this->range()->dim() <<
",domainDim=" << this->domain()->dim()
56 *out <<
"[Blocked Op] = ";
57 *out << Teuchos::describe(*blockedOp_, verbLevel);
61 *out <<
"[Blocked Manager] = ";
62 *out << mgr_->toString() << std::endl;
66 default: TEUCHOS_TEST_FOR_EXCEPT(
true);
Teuchos::RCP< const Thyra::MultiVectorBase< double > > buildReorderedMultiVector(const BlockReorderManager &mgr, const Teuchos::RCP< const Thyra::ProductMultiVectorBase< double > > &blkVec)
Convert a flat multi vector into a reordered multivector.
virtual VectorSpace range() const
Range space of this operator.
virtual VectorSpace domain() const
Domain space of this operator.
virtual void implicitApply(const MultiVector &x, MultiVector &y, const double alpha=1.0, const double beta=0.0) const
Perform a matrix vector multiply with this implicitly defined blocked operator.