49 #include "Thyra_DefaultProductVectorSpace.hpp"
50 #include "Thyra_ProductMultiVectorBase.hpp"
51 #include "Thyra_DefaultMultipliedLinearOp.hpp"
52 #include "Thyra_MultiVectorStdOps.hpp"
54 using namespace Thyra;
55 using Teuchos::ArrayRCP;
56 using Teuchos::dyn_cast;
63 LU2x2InverseOp::LU2x2InverseOp(
const BlockedLinearOp& A,
const LinearOp& invA00,
69 A10_(A->getBlock(1, 0)),
70 A01_(A->getBlock(0, 1)) {
72 using Thyra::productVectorSpace;
92 LU2x2InverseOp::LU2x2InverseOp(
const BlockedLinearOp& A,
const LinearOp& hatInvA00,
93 const LinearOp& tildeInvA00,
const LinearOp& invS)
95 hatInvA00_(hatInvA00),
96 tildeInvA00_(tildeInvA00),
98 A10_(A->getBlock(1, 0)),
99 A01_(A->getBlock(0, 1)) {
100 using Teuchos::tuple;
101 using Thyra::productVectorSpace;
111 const double alpha,
const double beta)
const {
113 MultiVector f = getBlock(0, x);
114 MultiVector g = getBlock(1, x);
117 MultiVector ps = deepcopy(g);
120 MultiVector u = getBlock(0, y);
121 MultiVector p = getBlock(1, y);
143 applyOp(
A10_, uc, ps, -1.0, 1.0);
144 applyOp(
invS_, ps, pc, -1.0);
145 applyOp(invA00_A01, pc, uc, -1.0, 1.0);
149 update(alpha, uc, beta, u);
150 update(alpha, pc, beta, p);
151 }
else if (alpha != 1.0) {
157 void LU2x2InverseOp::describe(Teuchos::FancyOStream& out_arg,
158 const Teuchos::EVerbosityLevel verbLevel)
const {
159 using Teuchos::OSTab;
161 RCP<Teuchos::FancyOStream> out = rcp(&out_arg,
false);
164 case Teuchos::VERB_DEFAULT:
165 case Teuchos::VERB_LOW: *out << this->description() << std::endl;
break;
166 case Teuchos::VERB_MEDIUM:
167 case Teuchos::VERB_HIGH:
168 case Teuchos::VERB_EXTREME: {
169 *out << Teuchos::Describable::description() <<
"{"
170 <<
"rangeDim=" << this->
range()->dim() <<
",domainDim=" << this->
domain()->dim()
174 *out << Teuchos::describe(*
invS_, verbLevel);
176 *out <<
"[hatInvA00]:\n";
177 *out << Teuchos::describe(*
hatInvA00_, verbLevel);
179 *out <<
"[tildeInvA00]:\n";
183 *out << Teuchos::describe(*
A10_, verbLevel);
186 *out << Teuchos::describe(*
A01_, verbLevel);
190 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