DICSmoother.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::DICSmoother
29 
30 Group
31  grpLduMatrixSmoothers
32 
33 Description
34  Simplified diagonal-based incomplete Cholesky smoother for symmetric
35  matrices.
36 
37  To improve efficiency, the residual is evaluated after every nSweeps
38  sweeps.
39 
40 SourceFiles
41  DICSmoother.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef DICSmoother_H
46 #define DICSmoother_H
47 
48 #include "lduMatrix.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class DICSmoother Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class DICSmoother
60 :
61  public lduMatrix::smoother
62 {
63  // Private data
64 
65  //- The reciprocal preconditioned diagonal
66  solveScalarField rD_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("DIC");
73 
74 
75  // Constructors
76 
77  //- Construct from matrix components
79  (
80  const word& fieldName,
81  const lduMatrix& matrix,
85  const dictionary& solverControls
86  );
87 
88 
89  // Member Functions
90 
91  //- Smooth the solution for a given number of sweeps
92  void smooth
93  (
95  const scalarField& source,
96  const direction cmpt,
97  const label nSweeps
98  ) const;
99 
100  //- Smooth the solution for a given number of sweeps
101  void scalarSmooth
102  (
104  const solveScalarField& source,
105  const direction cmpt,
106  const label nSweeps
107  ) const;
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition: lduMatrix.H:543
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition: lduMatrix.H:538
uint8_t direction
Definition: direction.H:46
const lduMatrix & matrix() const noexcept
Definition: lduMatrix.H:528
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("DIC")
Runtime type information.
Simplified diagonal-based incomplete Cholesky smoother for symmetric matrices.
Definition: DICSmoother.H:54
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:51
Abstract base-class for lduMatrix smoothers.
Definition: lduMatrix.H:409
A class for handling words, derived from Foam::string.
Definition: word.H:63
const word & fieldName() const noexcept
Definition: lduMatrix.H:523
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition: lduMatrix.H:533
DICSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Construct from matrix components.
Definition: DICSmoother.C:41
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Definition: lduMatrix.H:80
void smooth(solveScalarField &psi, const scalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Definition: DICSmoother.C:70
const volScalarField & psi
Namespace for OpenFOAM.
void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Definition: DICSmoother.C:125