Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_DefaultPreconditioner_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Thyra: Interfaces and Support for Abstract Numerical Algorithms
4//
5// Copyright 2004 NTESS and the Thyra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef THYRA_DEFUALT_PRECONDITIONER_DECL_HPP
11#define THYRA_DEFUALT_PRECONDITIONER_DECL_HPP
12
13#include "Thyra_PreconditionerBase.hpp"
14#include "Teuchos_ConstNonconstObjectContainer.hpp"
15
16
17namespace Thyra {
18
19
47template <class Scalar>
48class DefaultPreconditioner : virtual public PreconditionerBase<Scalar>
49{
50public:
51
54
58
63 const Teuchos::RCP<LinearOpBase<Scalar> > &leftPrecOp,
64 const Teuchos::RCP<LinearOpBase<Scalar> > &rightPrecOp
65 );
66
71 const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp,
72 const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
73 );
74
78 const Teuchos::RCP<LinearOpBase<Scalar> > &unspecifiedPrecOp
79 );
80
84 const Teuchos::RCP<const LinearOpBase<Scalar> > &unspecifiedPrecOp
85 );
86
89 void initializeLeft(
90 const Teuchos::RCP<LinearOpBase<Scalar> > &leftPrecOp
91 );
92
95 void initializeLeft(
96 const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
97 );
98
101 void initializeRight(
102 const Teuchos::RCP<LinearOpBase<Scalar> > &rightPrecOp
103 );
104
107 void initializeRight(
108 const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
109 );
110
114 const Teuchos::RCP<LinearOpBase<Scalar> > &leftPrecOp
115 ,const Teuchos::RCP<LinearOpBase<Scalar> > &rightPrecOp
116 );
117
121 const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
122 ,const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
123 );
124
129 const Teuchos::RCP<LinearOpBase<Scalar> > &unspecifiedPrecOp
130 );
131
136 const Teuchos::RCP<const LinearOpBase<Scalar> > &unspecifiedPrecOp
137 );
138
145 void uninitialize();
146
148
152 std::string description() const;
154 void describe(
156 const Teuchos::EVerbosityLevel verbLevel
157 ) const;
159
163 bool isLeftPrecOpConst() const;
169 bool isRightPrecOpConst() const;
175 bool isUnspecifiedPrecOpConst() const;
181
182private:
183
187
188};
189
190// ///////////////////////
191// Related functions
192
193
199template <class Scalar>
202 const Teuchos::RCP<const LinearOpBase<Scalar> > &unspecifiedPrecOp
203 )
204{
205 return Teuchos::rcp(new DefaultPreconditioner<Scalar>(unspecifiedPrecOp));
206}
207
208
214template <class Scalar>
217 const Teuchos::RCP<LinearOpBase<Scalar> > &unspecifiedPrecOp
218 )
219{
220 return Teuchos::rcp(new DefaultPreconditioner<Scalar>(unspecifiedPrecOp));
221}
222
223
229template <class Scalar>
232 const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
233 )
234{
236}
237
243template <class Scalar>
246 const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
247 )
248{
250}
251
257template <class Scalar>
260 const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
261 ,const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
262 )
263{
264 return Teuchos::rcp(new DefaultPreconditioner<Scalar>(leftPrecOp,rightPrecOp));
265}
266
267
268} // namespace Thyra
269
270
271#endif // THYRA_DEFUALT_PRECONDITIONER_DECL_HPP
Default implementation of a PreconditionerBase that just accepts precreated preconditioner linear ope...
Teuchos::RCP< const DefaultPreconditioner< Scalar > > rightPrec(const Teuchos::RCP< const LinearOpBase< Scalar > > &rightPrecOp)
Create a precondioner from a single linear operator targeted to be used on the right.
void initializeUnspecified(const Teuchos::RCP< LinearOpBase< Scalar > > &unspecifiedPrecOp)
Initialize a single unspecified preconditioner operator.
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstRightPrecOp()
Teuchos::RCP< DefaultPreconditioner< Scalar > > nonconstUnspecifiedPrec(const Teuchos::RCP< LinearOpBase< Scalar > > &unspecifiedPrecOp)
Create a precondioner from a single linear operator not targeted to be used on the left or the right.
Teuchos::RCP< const DefaultPreconditioner< Scalar > > leftPrec(const Teuchos::RCP< const LinearOpBase< Scalar > > &leftPrecOp)
Create a precondioner from a single linear operator targeted to be used on the left.
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstLeftPrecOp()
Teuchos::RCP< const LinearOpBase< Scalar > > getRightPrecOp() const
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Teuchos::RCP< const LinearOpBase< Scalar > > getUnspecifiedPrecOp() const
Teuchos::RCP< const DefaultPreconditioner< Scalar > > unspecifiedPrec(const Teuchos::RCP< const LinearOpBase< Scalar > > &unspecifiedPrecOp)
Create a precondioner from a single linear operator not targeted to be used on the left or the right.
void initializeLeft(const Teuchos::RCP< LinearOpBase< Scalar > > &leftPrecOp)
Initialize a left preconditioner.
Teuchos::RCP< const DefaultPreconditioner< Scalar > > splitPrec(const Teuchos::RCP< const LinearOpBase< Scalar > > &leftPrecOp, const Teuchos::RCP< const LinearOpBase< Scalar > > &rightPrecOp)
Create a split precondioner from two linear operators, one to be applied on the left and one to be ap...
DefaultPreconditioner()
Construct to uninitialized.
void initializeRight(const Teuchos::RCP< LinearOpBase< Scalar > > &rightPrecOp)
Initialize a right preconditioner.
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstUnspecifiedPrecOp()
Teuchos::RCP< const LinearOpBase< Scalar > > getLeftPrecOp() const
void initializeLeftRight(const Teuchos::RCP< LinearOpBase< Scalar > > &leftPrecOp, const Teuchos::RCP< LinearOpBase< Scalar > > &rightPrecOp)
Initialize a split left/right preconditioner.
Base class for all linear operators.
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
T_To & dyn_cast(T_From &from)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)