NoPreconditioner.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::NoPreconditioner
29
30Description
31 Null preconditioner for both symmetric and asymmetric matrices.
32
33SourceFiles
34 NoPreconditioner.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef NoPreconditioner_H
39#define NoPreconditioner_H
40
41#include "LduMatrix.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class NoPreconditioner Declaration
50\*---------------------------------------------------------------------------*/
51
52template<class Type, class DType, class LUType>
54:
55 public LduMatrix<Type, DType, LUType>::preconditioner
56{
57 // Private Member Functions
58
59 //- No copy construct
60 NoPreconditioner(const NoPreconditioner&) = delete;
61
62 //- No copy assignment
63 void operator=(const NoPreconditioner&) = delete;
64
65
66public:
67
68 //- Runtime type information
69 TypeName("none");
70
71
72 // Constructors
73
74 //- Construct from matrix components and preconditioner data dictionary
76 (
78 const dictionary& preconditionerDict
79 );
80
81
82 // Destructor
84 virtual ~NoPreconditioner() = default;
85
86
87 // Member Functions
88
89 //- Read and reset the preconditioner parameters from the given
90 // dictionary
91 virtual void read(const dictionary& preconditionerDict);
92
93 //- Return wA the preconditioned form of residual rA
94 virtual void precondition
95 (
96 Field<Type>& wA,
97 const Field<Type>& rA
98 ) const;
99
100 //- Return wT the transpose-matrix preconditioned form of
101 // residual rT.
102 virtual void preconditionT
103 (
104 Field<Type>& wT,
105 const Field<Type>& rT
106 ) const
107 {
108 return(precondition(wT, rT));
109 }
110};
111
112
113// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114
115} // End namespace Foam
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119#ifdef NoRepository
120 #include "NoPreconditioner.C"
121#endif
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125#endif
126
127// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
Abstract base-class for LduMatrix solvers.
Definition: LduMatrix.H:116
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: LduMatrix.H:88
Null preconditioner for both symmetric and asymmetric matrices.
virtual ~NoPreconditioner()=default
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const
Return wA the preconditioned form of residual rA.
TypeName("none")
Runtime type information.
virtual void read(const dictionary &preconditionerDict)
Read and reset the preconditioner parameters from the given.
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73