Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_MultPreconditionerFactory.hpp
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 
10 #ifndef __Teko_MultiPreconditionerFactory_hpp__
11 #define __Teko_MultiPreconditionerFactory_hpp__
12 
13 #include "Teko_BlockPreconditionerFactory.hpp"
14 #include "Teko_Utilities.hpp"
15 #include "Teko_BlockImplicitLinearOp.hpp"
16 
17 namespace Teko {
18 
24  public:
25  MultPrecondState() {}
26 
27  Teuchos::RCP<BlockPreconditionerState> StateOne_;
28  Teuchos::RCP<BlockPreconditionerState> StateTwo_;
29 };
30 
55  public:
57  MultPrecsLinearOp(const Teko::LinearOp &A, const Teko::LinearOp &M1, const Teko::LinearOp &M2)
58  : A_(A), M1_(M1), M2_(M2) {}
59 
60  virtual Teko::VectorSpace range() const { return M1_->range(); }
61  virtual Teko::VectorSpace domain() const { return M1_->domain(); }
62  virtual void implicitApply(const Teko::BlockedMultiVector &r, Teko::BlockedMultiVector &y,
63  const double alpha = 1.0, const double beta = 0.0) const;
64 
65  protected:
67 
68  Teko::LinearOp A_, M1_, M2_;
69 
70  private:
71  // hide me!
74 };
75 
81  public:
84  const Teuchos::RCP<const Teko::BlockPreconditionerFactory> &FirstFactory,
85  const Teuchos::RCP<const Teko::BlockPreconditionerFactory> &SecondFactory);
86 
88 
90  Teko::LinearOp buildPreconditionerOperator(Teko::BlockedLinearOp &blo,
91  Teko::BlockPreconditionerState &state) const;
92 
94  virtual Teuchos::RCP<Teko::PreconditionerState> buildPreconditionerState() const;
95 
96  protected:
98 
99  // class members
100  Teuchos::RCP<const Teko::BlockPreconditionerFactory> FirstFactory_;
101  Teuchos::RCP<const Teko::BlockPreconditionerFactory> SecondFactory_;
102 
104  virtual void initializeFromParameterList(const Teuchos::ParameterList &pl);
105 };
106 
107 } // end namespace Teko
108 
109 #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.
virtual Teko::VectorSpace domain() const
Domain space of this operator.
virtual LinearOp buildPreconditionerOperator(BlockedLinearOp &blo, BlockPreconditionerState &state) const =0
Function that is called to build the preconditioner for the linear operator that is passed in...
virtual Teuchos::RCP< Teko::PreconditionerState > buildPreconditionerState() const
Build the MultPrecondState object.
virtual Teko::VectorSpace range() const
Range space of this operator.
virtual void initializeFromParameterList(const Teuchos::ParameterList &pl)
Initialize from a parameter list.
Abstract class which block preconditioner factories in Teko should be based on.
An implementation of a state object for block preconditioners.
A virtual class that simplifies the construction of custom operators.
MultPrecsLinearOp(const Teko::LinearOp &A, const Teko::LinearOp &M1, const Teko::LinearOp &M2)
Constructor.
Teko::LinearOp buildPreconditionerOperator(Teko::BlockedLinearOp &blo, Teko::BlockPreconditionerState &state) const
Function inherited from Teko::BlockPreconditionerFactory.
virtual void implicitApply(const Teko::BlockedMultiVector &r, Teko::BlockedMultiVector &y, const double alpha=1.0, const double beta=0.0) const
Perform a matrix vector multiply with this implicitly defined blocked operator.