Teko Version of the Day
Loading...
Searching...
No Matches
Teko_LU2x2Strategy.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_LU2x2Strategy_hpp__
11#define __Teko_LU2x2Strategy_hpp__
12
13#include "Teuchos_RCP.hpp"
14#include "Thyra_LinearOpBase.hpp"
15
16#include "Teko_Utilities.hpp"
17#include "Teko_InverseFactory.hpp"
18#include "Teko_BlockPreconditionerFactory.hpp"
19
20namespace Teko {
21
66 public:
67 virtual ~LU2x2Strategy() {}
68
70 virtual const Teko::LinearOp getHatInvA00(const Teko::BlockedLinearOp& A,
71 BlockPreconditionerState& state) const = 0;
72
74 virtual const Teko::LinearOp getTildeInvA00(const Teko::BlockedLinearOp& A,
75 BlockPreconditionerState& state) const = 0;
76
78 virtual const Teko::LinearOp getInvS(const Teko::BlockedLinearOp& A,
79 BlockPreconditionerState& state) const = 0;
80
92 virtual void initializeFromParameterList(const Teuchos::ParameterList& /* settings */,
93 const InverseLibrary& /* invLib */) {}
94
109 virtual Teuchos::RCP<Teuchos::ParameterList> getRequestedParameters() const {
110 return Teuchos::null;
111 }
112
126 virtual bool updateRequestedParameters(const Teuchos::ParameterList& /* pl */) { return true; }
127
129 void setRequestHandler(const Teuchos::RCP<RequestHandler>& rh) { requestHandler_ = rh; }
130
132 Teuchos::RCP<RequestHandler> getRequestHandler() const { return requestHandler_; }
133
134 private:
135 Teuchos::RCP<RequestHandler> requestHandler_;
136};
137
147 public:
156 StaticLU2x2Strategy(const Teko::LinearOp& hInvA00, const Teko::LinearOp& tInvA00,
157 const Teko::LinearOp& invS)
158 : hatInvA00_(hInvA00), tildeInvA00_(tInvA00), invS_(invS) {}
159
160 virtual ~StaticLU2x2Strategy() {}
161
164
166 virtual const Teko::LinearOp getHatInvA00(const Teko::BlockedLinearOp& /* A */,
167 BlockPreconditionerState& /* state */) const {
168 return hatInvA00_;
169 }
170
172 virtual const Teko::LinearOp getTildeInvA00(const Teko::BlockedLinearOp& /* A */,
173 BlockPreconditionerState& /* state */) const {
174 return tildeInvA00_;
175 }
176
178 virtual const Teko::LinearOp getInvS(const Teko::BlockedLinearOp& /* A */,
179 BlockPreconditionerState& /* state */) const {
180 return invS_;
181 }
182
184
185 protected:
186 const Teko::LinearOp hatInvA00_;
187 const Teko::LinearOp tildeInvA00_;
188 const Teko::LinearOp invS_;
189
190 private:
191 // hide me!
193};
194
195} // end namespace Teko
196
197#endif
An implementation of a state object for block preconditioners.
Abstract strategy for computing inv(F) and inv(S) in the LU2x2PreconditionerFactory.
Teuchos::RCP< RequestHandler > getRequestHandler() const
This method gets the request handler uses by this object.
virtual const Teko::LinearOp getInvS(const Teko::BlockedLinearOp &A, BlockPreconditionerState &state) const =0
virtual void initializeFromParameterList(const Teuchos::ParameterList &, const InverseLibrary &)
This function builds the internals of the state from a parameter list.
virtual const Teko::LinearOp getTildeInvA00(const Teko::BlockedLinearOp &A, BlockPreconditionerState &state) const =0
void setRequestHandler(const Teuchos::RCP< RequestHandler > &rh)
This method sets the request handler for this object.
virtual bool updateRequestedParameters(const Teuchos::ParameterList &)
Update this object with the fields from a parameter list.
virtual Teuchos::RCP< Teuchos::ParameterList > getRequestedParameters() const
Request the additional parameters this preconditioner factory needs.
virtual const Teko::LinearOp getHatInvA00(const Teko::BlockedLinearOp &A, BlockPreconditionerState &state) const =0
A simple strategy for use with LU2x2PreconditionerFactory, that offers static objects for inv(F) and ...
virtual const Teko::LinearOp getInvS(const Teko::BlockedLinearOp &, BlockPreconditionerState &) const
const Teko::LinearOp hatInvA00_
virtual const Teko::LinearOp getHatInvA00(const Teko::BlockedLinearOp &, BlockPreconditionerState &) const
const Teko::LinearOp tildeInvA00_
StaticLU2x2Strategy(const Teko::LinearOp &hInvA00, const Teko::LinearOp &tInvA00, const Teko::LinearOp &invS)
Constructor that takes the static and objects.
virtual const Teko::LinearOp getTildeInvA00(const Teko::BlockedLinearOp &, BlockPreconditionerState &) const