Teko Version of the Day
Loading...
Searching...
No Matches
Teko_InvModALStrategy.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/*
11 * Author: Zhen Wang
12 * Email: wangz@ornl.gov
13 * zhen.wang@alum.emory.edu
14 */
15
16#ifndef __Teko_ModALStrategy_hpp__
17#define __Teko_ModALStrategy_hpp__
18
19#include "Teuchos_RCP.hpp"
20
21#include "Thyra_LinearOpBase.hpp"
22
23#include "Teko_Utilities.hpp"
24#include "Teko_InverseFactory.hpp"
25#include "Teko_BlockPreconditionerFactory.hpp"
26
27namespace Teko {
28
29namespace NS {
30
31class ModALPrecondState;
32
47 public:
50
51 InvModALStrategy(const Teuchos::RCP<InverseFactory>& factory);
52
53 InvModALStrategy(const Teuchos::RCP<InverseFactory>& factory, LinearOp& pressureMassMatrix);
54
55 InvModALStrategy(const Teuchos::RCP<InverseFactory>& invFactA,
56 const Teuchos::RCP<InverseFactory>& invFactS);
57
58 InvModALStrategy(const Teuchos::RCP<InverseFactory>& invFactA,
59 const Teuchos::RCP<InverseFactory>& invFactS, LinearOp& pressureMassMatrix);
60
62 virtual ~InvModALStrategy() {}
63
71 virtual LinearOp getInvA11p(BlockPreconditionerState& state) const;
72
80 virtual LinearOp getInvA22p(BlockPreconditionerState& state) const;
81
89 virtual LinearOp getInvA33p(BlockPreconditionerState& state) const;
90
98 virtual LinearOp getInvS(BlockPreconditionerState& state) const;
99
107 virtual void buildState(const BlockedLinearOp& A, BlockPreconditionerState& state) const;
108
112 virtual void initializeState(const BlockedLinearOp& A, ModALPrecondState* state) const;
113
120 virtual void computeInverses(const BlockedLinearOp& A, ModALPrecondState* state) const;
121
127 void setPressureMassMatrix(const LinearOp& pressureMassMatrix);
128
134 void setGamma(double gamma);
135
140 virtual void setSymmetric(bool isSymmetric) { isSymmetric_ = isSymmetric; }
141
142 protected:
143 // In the modified AL preconditioner, we need to two methods,
144 // one for solving \f$ A_{ii}, i = 1, 2(, 3) \f$,
145 // the other for solving \f$ S \f$.
146 Teuchos::RCP<InverseFactory> invFactoryA_;
147 Teuchos::RCP<InverseFactory> invFactoryS_;
148 LinearOp pressureMassMatrix_;
149 double gamma_;
150
151 DiagonalType scaleType_;
152 bool isSymmetric_;
153 int dim_;
154};
155
156} // end namespace NS
157
158} // end namespace Teko
159
160#endif /* __Teko_ModALStrategy_hpp__ */
DiagonalType
Type describing the type of diagonal to construct.
An implementation of a state object for block preconditioners.
Strategy object for the modified augmented-Lagrangian (ModAL) Navier-Stokes preconditioner.
virtual ~InvModALStrategy()
Destructor.
void setPressureMassMatrix(const LinearOp &pressureMassMatrix)
virtual void buildState(const BlockedLinearOp &A, BlockPreconditionerState &state) const
virtual void initializeState(const BlockedLinearOp &A, ModALPrecondState *state) const
virtual LinearOp getInvA33p(BlockPreconditionerState &state) const
virtual LinearOp getInvS(BlockPreconditionerState &state) const
virtual LinearOp getInvA22p(BlockPreconditionerState &state) const
virtual LinearOp getInvA11p(BlockPreconditionerState &state) const
virtual void setSymmetric(bool isSymmetric)
virtual void computeInverses(const BlockedLinearOp &A, ModALPrecondState *state) const
Class for saving state variables for ModALPreconditionerFactory.