DILUPreconditioner.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 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::DILUPreconditioner
29 
30 Group
31  grpLduMatrixPreconditioners
32 
33 Description
34  Simplified diagonal-based incomplete LU preconditioner for asymmetric
35  matrices. The reciprocal of the preconditioned diagonal is calculated
36  and stored.
37 
38 SourceFiles
39  DILUPreconditioner.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef DILUPreconditioner_H
44 #define DILUPreconditioner_H
45 
46 #include "lduMatrix.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class DILUPreconditioner Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
60 {
61  // Private data
62 
63  //- The reciprocal preconditioned diagonal
64  solveScalarField rD_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("DILU");
71 
72 
73  // Constructors
74 
75  //- Construct from matrix components and preconditioner solver controls
77  (
78  const lduMatrix::solver&,
79  const dictionary& solverControlsUnused
80  );
81 
82 
83  //- Destructor
84  virtual ~DILUPreconditioner() = default;
85 
86 
87  // Member Functions
88 
89  //- Calculate the reciprocal of the preconditioned diagonal
90  static void calcReciprocalD(solveScalarField&, const lduMatrix&);
91 
92  //- Return wA the preconditioned form of residual rA
93  virtual void precondition
94  (
95  solveScalarField& wA,
96  const solveScalarField& rA,
97  const direction cmpt=0
98  ) const;
99 
100  //- Return wT the transpose-matrix preconditioned form of residual rT.
101  virtual void preconditionT
102  (
103  solveScalarField& wT,
104  const solveScalarField& rT,
105  const direction cmpt=0
106  ) const;
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #endif
117 
118 // ************************************************************************* //
Foam::DILUPreconditioner::preconditionT
virtual void preconditionT(solveScalarField &wT, const solveScalarField &rT, const direction cmpt=0) const
Return wT the transpose-matrix preconditioned form of residual rT.
Definition: DILUPreconditioner.C:143
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::lduMatrix::solver
Abstract base-class for lduMatrix solvers.
Definition: lduMatrix.H:98
Foam::DILUPreconditioner::DILUPreconditioner
DILUPreconditioner(const lduMatrix::solver &, const dictionary &solverControlsUnused)
Construct from matrix components and preconditioner solver controls.
Definition: DILUPreconditioner.C:47
lduMatrix.H
Foam::DILUPreconditioner::~DILUPreconditioner
virtual ~DILUPreconditioner()=default
Destructor.
Foam::DILUPreconditioner::precondition
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
Definition: DILUPreconditioner.C:96
Foam::DILUPreconditioner::TypeName
TypeName("DILU")
Runtime type information.
Foam::DILUPreconditioner
Simplified diagonal-based incomplete LU preconditioner for asymmetric matrices. The reciprocal of the...
Definition: DILUPreconditioner.H:56
Foam::Field< solveScalar >
Foam::DILUPreconditioner::calcReciprocalD
static void calcReciprocalD(solveScalarField &, const lduMatrix &)
Calculate the reciprocal of the preconditioned diagonal.
Definition: DILUPreconditioner.C:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::lduMatrix::preconditioner
Abstract base-class for lduMatrix preconditioners.
Definition: lduMatrix.H:433