Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_LSCPreconditionerFactory.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_LSCPreconditionerFactory_hpp__
11 #define __Teko_LSCPreconditionerFactory_hpp__
12 
13 #include "Teko_BlockPreconditionerFactory.hpp"
14 #include "Teko_LSCStrategy.hpp"
15 
16 namespace Teko {
17 namespace NS { // Navier-Stokes specialization
18 
28  public:
29  LSCPrecondState() {}
30 
32  LinearOp invMass_;
33 
36  ModifiableLinearOp BQBt_;
37 
40  ModifiableLinearOp BHBt_;
41 
44  LinearOp BQBtmC_;
45  InverseLinearOp invBQBtmC_;
46 
49  LinearOp BHBtmC_;
50  InverseLinearOp invBHBtmC_;
51 
53  LinearOp aiD_;
54 
56  double gamma_;
57 
61  double alpha_;
62 };
63 
64 class LSCPreconditionerFactory : public BlockPreconditionerFactory {
65  public:
67 
68 
70  LSCPreconditionerFactory(const LinearOp& invF, const LinearOp& invBQBtmC, const LinearOp& invD,
71  const LinearOp& invMass);
72 
74  LSCPreconditionerFactory(const LinearOp& invF, const LinearOp& invBQBtmC,
75  const LinearOp& invMass);
76 
78  LSCPreconditionerFactory(const Teuchos::RCP<LSCStrategy>& strategy);
79 
81  LSCPreconditionerFactory();
83 
85  virtual LinearOp buildPreconditionerOperator(BlockedLinearOp& blo,
86  BlockPreconditionerState& state) const;
87 
89  virtual RCP<PreconditionerState> buildPreconditionerState() const {
90  return rcp(new LSCPrecondState());
91  }
92 
94  virtual Teuchos::RCP<Teuchos::ParameterList> getRequestedParameters() const;
95 
97  virtual bool updateRequestedParameters(const Teuchos::ParameterList& pl);
98 
99  protected:
101 
102  // Gimmie object
103  Teuchos::RCP<LSCStrategy> invOpsStrategy_;
104  bool isSymmetric_;
105 
107  virtual void initializeFromParameterList(const Teuchos::ParameterList& pl);
108 
109  public:
122  static RCP<LSCStrategy> buildStrategy(const std::string& name,
123  const Teuchos::ParameterList& settings,
124  const RCP<const InverseLibrary>& invLib,
125  const RCP<RequestHandler>& rh);
126 
140  static void addStrategy(const std::string& name, const RCP<Cloneable>& clone);
141 
142  private:
144  static CloneFactory<LSCStrategy> strategyBuilder_;
145 
147  static void initializeStrategyBuilder();
148 };
149 
150 } // end namespace NS
151 } // end namespace Teko
152 
153 #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...
Abstract class which block preconditioner factories in Teko should be based on.
An implementation of a state object for block preconditioners.
LinearOp invMass_
Inverse mass operator ( )
Preconditioner state for the LSC factory.