49 #include "Thyra_DefaultProductVectorSpace.hpp"
50 #include "Thyra_ProductMultiVectorBase.hpp"
51 #include "Thyra_DefaultMultipliedLinearOp.hpp"
52 #include "Thyra_MultiVectorStdOps.hpp"
54 using namespace Thyra;
56 using Teuchos::ArrayRCP;
57 using Teuchos::dyn_cast;
63 LU2x2InverseOp::LU2x2InverseOp(
const BlockedLinearOp & A,
64 const LinearOp & invA00,
65 const LinearOp & invS)
66 : A_(A), hatInvA00_(invA00), tildeInvA00_(invA00), invS_(invS),
67 A10_(A->getBlock(1,0)), A01_(A->getBlock(0,1))
70 using Thyra::productVectorSpace;
90 LU2x2InverseOp::LU2x2InverseOp(
const BlockedLinearOp & A,
91 const LinearOp & hatInvA00,
92 const LinearOp & tildeInvA00,
93 const LinearOp & invS)
94 : A_(A), hatInvA00_(hatInvA00), tildeInvA00_(tildeInvA00), invS_(invS),
95 A10_(A->getBlock(1,0)), A01_(A->getBlock(0,1))
98 using Thyra::productVectorSpace;
108 const double alpha,
const double beta)
const
111 MultiVector f = getBlock(0,x);
112 MultiVector g = getBlock(1,x);
115 MultiVector ps = deepcopy(g);
118 MultiVector u = getBlock(0,y);
119 MultiVector p = getBlock(1,y);
141 applyOp(
A10_, uc, ps, -1.0, 1.0);
142 applyOp(
invS_, ps, pc, -1.0);
143 applyOp(invA00_A01, pc, uc, -1.0, 1.0);
147 update(alpha,uc,beta,u);
148 update(alpha,pc,beta,p);
150 else if(alpha!=1.0) {
156 void LU2x2InverseOp::describe(Teuchos::FancyOStream & out_arg,
157 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:
166 *out << this->description() << std::endl;
168 case Teuchos::VERB_MEDIUM:
169 case Teuchos::VERB_HIGH:
170 case Teuchos::VERB_EXTREME:
172 *out << Teuchos::Describable::description() <<
"{"
173 <<
"rangeDim=" << this->
range()->dim()
174 <<
",domainDim=" << this->
domain()->dim()
179 *out << Teuchos::describe(*
invS_,verbLevel);
181 *out <<
"[hatInvA00]:\n";
182 *out << Teuchos::describe(*
hatInvA00_,verbLevel);
184 *out <<
"[tildeInvA00]:\n";
188 *out << Teuchos::describe(*
A10_,verbLevel);
191 *out << Teuchos::describe(*
A01_,verbLevel);
196 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