Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_LU2x2InverseOp.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teko: A package for block and physics based preconditioning
4 //
5 // Copyright 2010 NTESS and the Teko contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
15 #ifndef __Teko_LU2x2InverseOp_hpp__
16 #define __Teko_LU2x2InverseOp_hpp__
17 
18 #include "Teko_Utilities.hpp"
19 #include "Teko_BlockImplicitLinearOp.hpp"
20 
21 namespace Teko {
22 
65  public:
77  LU2x2InverseOp(const BlockedLinearOp &A, const LinearOp &invA00, const LinearOp &invS);
78 
90  LU2x2InverseOp(const BlockedLinearOp &A, const LinearOp &hatInvA00, const LinearOp &tildeInvA00,
91  const LinearOp &invS);
92 
94 
95 
97  virtual VectorSpace range() const { return productRange_; }
98 
100  virtual VectorSpace domain() const { return productDomain_; }
101 
114  virtual void implicitApply(const BlockedMultiVector &x, BlockedMultiVector &y,
115  const double alpha = 1.0, const double beta = 0.0) const;
117 
118  virtual void describe(Teuchos::FancyOStream &out_arg,
119  const Teuchos::EVerbosityLevel verbLevel) const;
120 
121  protected:
123 
124  // fundamental operators to use
125  const BlockedLinearOp A_;
126  const LinearOp hatInvA00_;
127  const LinearOp tildeInvA00_;
128  const LinearOp invS_;
129 
130  // some blocks of A
131  const LinearOp A10_;
132  const LinearOp A01_;
133 
134  Teuchos::RCP<const Thyra::ProductVectorSpaceBase<double> >
136  Teuchos::RCP<const Thyra::ProductVectorSpaceBase<double> >
138 
139  private:
140  // hide me!
141  LU2x2InverseOp();
143 };
144 
158 inline LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &invA00, LinearOp &invS) {
159  return Teuchos::rcp(new LU2x2InverseOp(A, invA00, invS));
160 }
161 
176 inline LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &invA00, LinearOp &invS,
177  const std::string &str) {
178  Teuchos::RCP<Thyra::LinearOpBase<double> > result =
179  Teuchos::rcp(new LU2x2InverseOp(A, invA00, invS));
180  result->setObjectLabel(str);
181 
182  return result;
183 }
184 
199 inline LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &hatInvA00, LinearOp &tildeInvA00,
200  LinearOp &invS) {
201  return Teuchos::rcp(new LU2x2InverseOp(A, hatInvA00, tildeInvA00, invS));
202 }
203 
219 inline LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &hatInvA00, LinearOp &tildeInvA00,
220  LinearOp &invS, const std::string &str) {
221  Teuchos::RCP<Thyra::LinearOpBase<double> > result =
222  Teuchos::rcp(new LU2x2InverseOp(A, hatInvA00, tildeInvA00, invS));
223  result->setObjectLabel(str);
224 
225  return result;
226 }
227 
228 } // end namespace Teko
229 
230 #endif
virtual void implicitApply(const BlockedMultiVector &x, BlockedMultiVector &y, const double alpha=1.0, const double beta=0.0) const =0
Perform a matrix vector multiply with this implicitly defined blocked operator.
This linear operator approximates the inverse of a block operator using a block decomposition...
const LinearOp hatInvA00_
inverse of
Teuchos::RCP< const Thyra::ProductVectorSpaceBase< double > > productRange_
Range vector space.
const LinearOp A01_
operator
LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &hatInvA00, LinearOp &tildeInvA00, LinearOp &invS)
Constructor method for building LU2x2InverseOp.
Teuchos::RCP< const Thyra::ProductVectorSpaceBase< double > > productDomain_
Domain vector space.
virtual VectorSpace domain() const
Domain space of this operator.
LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &hatInvA00, LinearOp &tildeInvA00, LinearOp &invS, const std::string &str)
Constructor method for building LU2x2InverseOp.
LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &invA00, LinearOp &invS, const std::string &str)
Constructor method for building LU2x2InverseOp.
const BlockedLinearOp A_
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.
A virtual class that simplifies the construction of custom operators.
const LinearOp invS_
inverse of
LinearOp createLU2x2InverseOp(BlockedLinearOp &A, LinearOp &invA00, LinearOp &invS)
Constructor method for building LU2x2InverseOp.
virtual VectorSpace range() const
Range space of this operator.
const LinearOp A10_
operator
const LinearOp tildeInvA00_
inverse of