DICPreconditioner.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::DICPreconditioner
29 
30 Group
31  grpLduMatrixPreconditioners
32 
33 Description
34  Simplified diagonal-based incomplete Cholesky preconditioner for symmetric
35  matrices (symmetric equivalent of DILU). The reciprocal of the
36  preconditioned diagonal is calculated and stored.
37 
38 SourceFiles
39  DICPreconditioner.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef DICPreconditioner_H
44 #define DICPreconditioner_H
45 
46 #include "lduMatrix.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class DICPreconditioner 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("DIC");
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 ~DICPreconditioner() = 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 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace Foam
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 #endif
109 
110 // ************************************************************************* //
Foam::DICPreconditioner::precondition
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
Definition: DICPreconditioner.C:95
Foam::DICPreconditioner::calcReciprocalD
static void calcReciprocalD(solveScalarField &, const lduMatrix &)
Calculate the reciprocal of the preconditioned diagonal.
Definition: DICPreconditioner.C:65
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::DICPreconditioner::DICPreconditioner
DICPreconditioner(const lduMatrix::solver &, const dictionary &solverControlsUnused)
Construct from matrix components and preconditioner solver controls.
Definition: DICPreconditioner.C:47
Foam::lduMatrix::solver
Abstract base-class for lduMatrix solvers.
Definition: lduMatrix.H:98
lduMatrix.H
Foam::DICPreconditioner::~DICPreconditioner
virtual ~DICPreconditioner()=default
Destructor.
Foam::Field< solveScalar >
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::DICPreconditioner
Simplified diagonal-based incomplete Cholesky preconditioner for symmetric matrices (symmetric equiva...
Definition: DICPreconditioner.H:56
Foam::DICPreconditioner::TypeName
TypeName("DIC")
Runtime type information.
Foam::lduMatrix::preconditioner
Abstract base-class for lduMatrix preconditioners.
Definition: lduMatrix.H:433