Teko Version of the Day
Loading...
Searching...
No Matches
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
16namespace Teko {
17namespace NS { // Navier-Stokes specialization
18
28 public:
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
82 public:
84
85
87 LSCPreconditionerFactory(const LinearOp& invF, const LinearOp& invBQBtmC, const LinearOp& invD,
88 const LinearOp& invMass);
89
91 LSCPreconditionerFactory(const LinearOp& invF, const LinearOp& invBQBtmC,
92 const LinearOp& invMass);
93
95 LSCPreconditionerFactory(const Teuchos::RCP<LSCStrategy>& strategy);
96
100
102 virtual LinearOp buildPreconditionerOperator(BlockedLinearOp& blo,
103 BlockPreconditionerState& state) const;
104
106 virtual RCP<PreconditionerState> buildPreconditionerState() const {
107 return rcp(new LSCPrecondState());
108 }
109
111 virtual Teuchos::RCP<Teuchos::ParameterList> getRequestedParameters() const;
112
114 virtual bool updateRequestedParameters(const Teuchos::ParameterList& pl);
115
116 protected:
118
119 // Gimmie object
120 Teuchos::RCP<LSCStrategy> invOpsStrategy_;
121 bool isSymmetric_;
122
124 virtual void initializeFromParameterList(const Teuchos::ParameterList& pl);
125
126 public:
139 static RCP<LSCStrategy> buildStrategy(const std::string& name,
140 const Teuchos::ParameterList& settings,
141 const RCP<const InverseLibrary>& invLib,
142 const RCP<RequestHandler>& rh);
143
157 static void addStrategy(const std::string& name, const RCP<Cloneable>& clone);
158
159 private:
161 static CloneFactory<LSCStrategy> strategyBuilder_;
162
164 static void initializeStrategyBuilder();
165};
166
167} // end namespace NS
168} // end namespace Teko
169
170#endif
Abstract class which block preconditioner factories in Teko should be based on.
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.
An implementation of a state object for block preconditioners.
Preconditioner state for the LSC factory.
LinearOp invMass_
Inverse mass operator ( )
Least-Squares Commutator (LSC) block preconditioner factory for incompressible Navier-Stokes saddle-p...
virtual bool updateRequestedParameters(const Teuchos::ParameterList &pl)
For assiting in construction of the preconditioner.
virtual void initializeFromParameterList(const Teuchos::ParameterList &pl)
Initialize from a parameter list.
static RCP< LSCStrategy > buildStrategy(const std::string &name, const Teuchos::ParameterList &settings, const RCP< const InverseLibrary > &invLib, const RCP< RequestHandler > &rh)
Builder function for creating strategies.
virtual Teuchos::RCP< Teuchos::ParameterList > getRequestedParameters() const
For assiting in construction of the preconditioner.
static void addStrategy(const std::string &name, const RCP< Cloneable > &clone)
Add a strategy to the builder. This is done using the clone pattern.
LSCPreconditionerFactory(const Teuchos::RCP< LSCStrategy > &strategy)
fully generic constructor
virtual RCP< PreconditionerState > buildPreconditionerState() const
Build the LSCPrecondState object.
virtual LinearOp buildPreconditionerOperator(BlockedLinearOp &blo, BlockPreconditionerState &state) const
for PreconditionerFactoryBase