12 #include "Thyra_DefaultProductVectorSpace.hpp"
13 #include "Thyra_ProductMultiVectorBase.hpp"
14 #include "Thyra_DefaultMultipliedLinearOp.hpp"
15 #include "Thyra_MultiVectorStdOps.hpp"
17 using namespace Thyra;
18 using Teuchos::ArrayRCP;
19 using Teuchos::dyn_cast;
26 LU2x2InverseOp::LU2x2InverseOp(
const BlockedLinearOp& A,
const LinearOp& invA00,
32 A10_(A->getBlock(1, 0)),
33 A01_(A->getBlock(0, 1)) {
35 using Thyra::productVectorSpace;
55 LU2x2InverseOp::LU2x2InverseOp(
const BlockedLinearOp& A,
const LinearOp& hatInvA00,
56 const LinearOp& tildeInvA00,
const LinearOp& invS)
58 hatInvA00_(hatInvA00),
59 tildeInvA00_(tildeInvA00),
61 A10_(A->getBlock(1, 0)),
62 A01_(A->getBlock(0, 1)) {
64 using Thyra::productVectorSpace;
74 const double alpha,
const double beta)
const {
76 MultiVector f = getBlock(0, x);
77 MultiVector g = getBlock(1, x);
80 MultiVector ps = deepcopy(g);
83 MultiVector u = getBlock(0, y);
84 MultiVector p = getBlock(1, y);
106 applyOp(
A10_, uc, ps, -1.0, 1.0);
107 applyOp(
invS_, ps, pc, -1.0);
108 applyOp(invA00_A01, pc, uc, -1.0, 1.0);
112 update(alpha, uc, beta, u);
113 update(alpha, pc, beta, p);
114 }
else if (alpha != 1.0) {
120 void LU2x2InverseOp::describe(Teuchos::FancyOStream& out_arg,
121 const Teuchos::EVerbosityLevel verbLevel)
const {
122 using Teuchos::OSTab;
124 RCP<Teuchos::FancyOStream> out = rcp(&out_arg,
false);
127 case Teuchos::VERB_DEFAULT:
128 case Teuchos::VERB_LOW: *out << this->description() << std::endl;
break;
129 case Teuchos::VERB_MEDIUM:
130 case Teuchos::VERB_HIGH:
131 case Teuchos::VERB_EXTREME: {
132 *out << Teuchos::Describable::description() <<
"{"
133 <<
"rangeDim=" << this->
range()->dim() <<
",domainDim=" << this->
domain()->dim()
137 *out << Teuchos::describe(*
invS_, verbLevel);
139 *out <<
"[hatInvA00]:\n";
140 *out << Teuchos::describe(*
hatInvA00_, verbLevel);
142 *out <<
"[tildeInvA00]:\n";
146 *out << Teuchos::describe(*
A10_, verbLevel);
149 *out << Teuchos::describe(*
A01_, verbLevel);
153 default: TEUCHOS_TEST_FOR_EXCEPT(
true);
const LinearOp hatInvA00_
inverse of
Teuchos::RCP< const Thyra::ProductVectorSpaceBase< double > > productRange_
Range vector space.
const LinearOp A01_
operator
Teuchos::RCP< const Thyra::ProductVectorSpaceBase< double > > productDomain_
Domain vector space.
virtual VectorSpace domain() const
Domain space of this operator.
virtual void implicitApply(const BlockedMultiVector &x, BlockedMultiVector &y, const double alpha=1.0, const double beta=0.0) const
Perform a matrix vector multiply with this operator.
const LinearOp invS_
inverse of
virtual VectorSpace range() const
Range space of this operator.
const LinearOp A10_
operator
const LinearOp tildeInvA00_
inverse of