Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_BlockPreconditionerFactory.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_BlockPreconditionerFactory_hpp__
11 #define __Teko_BlockPreconditionerFactory_hpp__
12 
13 #include "Teuchos_ParameterListAcceptor.hpp"
14 
15 // Thyra includes
16 #include "Thyra_SolveSupportTypes.hpp"
17 #include "Thyra_LinearOpSourceBase.hpp"
18 #include "Thyra_PreconditionerFactoryBase.hpp"
19 #include "Thyra_DefaultBlockedLinearOp.hpp"
20 #include "Thyra_DefaultPreconditioner.hpp"
21 
22 // Teko includes
23 #include "Teko_Utilities.hpp"
24 #include "Teko_InverseLibrary.hpp"
25 #include "Teko_CloneFactory.hpp"
26 #include "Teko_PreconditionerState.hpp"
27 #include "Teko_PreconditionerFactory.hpp"
28 
29 namespace Teko {
30 
31 using Teuchos::ParameterList;
32 using Teuchos::rcp;
33 using Teuchos::RCP;
34 using Thyra::DefaultPreconditioner;
35 using Thyra::LinearOpBase;
36 
44  public:
46  virtual void setBlockSourceVector(const Teko::BlockedMultiVector &srcVec) {
47  setSourceVector(srcVec);
48  }
49 
51  virtual const Teko::BlockedMultiVector getBlockedSourceVector() const {
52  return toBlockedMultiVector(getSourceVector());
53  }
54 };
55 
64  public:
78  virtual LinearOp buildPreconditionerOperator(BlockedLinearOp &blo,
79  BlockPreconditionerState &state) const = 0;
80 
93  virtual RCP<PreconditionerState> buildPreconditionerState() const {
94  return rcp(new BlockPreconditionerState());
95  }
96 
103  RCP<BlockPreconditionerState> buildBlockPreconditionerState() const {
104  return Teuchos::rcp_dynamic_cast<BlockPreconditionerState>(buildPreconditionerState());
105  }
106 
107  virtual LinearOp buildPreconditionerOperator(LinearOp &blo, PreconditionerState &state) const;
108 
110  bool isCompatible(const Thyra::LinearOpSourceBase<double> &fwdOpSrc) const;
111 };
112 
113 } // end namespace Teko
114 
115 #endif
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 void setSourceVector(const Teko::MultiVector &srcVec)
Set the vector associated with this operator (think nonlinear system)
virtual const Teko::MultiVector getSourceVector() const
Set the vector associated with this operator (think nonlinear system)
bool isCompatible(const Thyra::LinearOpSourceBase< double > &fwdOpSrc) const
is this operator compatiable with the preconditioner factory?
Abstract class which block preconditioner factories in Teko should be based on.
Abstract class which block preconditioner factories in Teko should be based on.
An implementation of a state object for block preconditioners.
virtual RCP< PreconditionerState > buildPreconditionerState() const
Function that permits the construction of an arbitrary BlockPreconditionerState object.
virtual const Teko::BlockedMultiVector getBlockedSourceVector() const
Set the vector associated with this operator (think nonlinear system)
virtual void setBlockSourceVector(const Teko::BlockedMultiVector &srcVec)
Set the vector associated with this operator (think nonlinear system)
An implementation of a state object preconditioners.
RCP< BlockPreconditionerState > buildBlockPreconditionerState() const
Function that constructs a BlockPreconditionerState object.