GaussSeidelSmoother.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::GaussSeidelSmoother
29 
30 Group
31  grpLduMatrixSmoothers
32 
33 Description
34  A lduMatrix::smoother for Gauss-Seidel
35 
36 SourceFiles
37  GaussSeidelSmoother.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef GaussSeidelSmoother_H
42 #define GaussSeidelSmoother_H
43 
44 #include "lduMatrix.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class GaussSeidelSmoother Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public lduMatrix::smoother
58 {
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("GaussSeidel");
64 
65 
66  // Constructors
67 
68  //- Construct from components
70  (
71  const word& fieldName,
72  const lduMatrix& matrix,
76  );
77 
78 
79  // Member Functions
80 
81  //- Smooth for the given number of sweeps
82  static void smooth
83  (
84  const word& fieldName,
86  const lduMatrix& matrix,
87  const solveScalarField& source,
90  const direction cmpt,
91  const label nSweeps
92  );
93 
94 
95  //- Smooth the solution for a given number of sweeps
96  virtual void smooth
97  (
99  const scalarField& Source,
100  const direction cmpt,
101  const label nSweeps
102  ) const;
103 
104  //- Smooth the solution for a given number of sweeps
105  virtual void scalarSmooth
106  (
108  const solveScalarField& Source,
109  const direction cmpt,
110  const label nSweeps
111  ) const;
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
Foam::GaussSeidelSmoother::smooth
static void smooth(const word &fieldName, solveScalarField &psi, const lduMatrix &matrix, const solveScalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
Definition: GaussSeidelSmoother.C:71
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::GaussSeidelSmoother::TypeName
TypeName("GaussSeidel")
Runtime type information.
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::lduMatrix::smoother::interfaces
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition: lduMatrix.H:406
lduMatrix.H
Foam::GaussSeidelSmoother
A lduMatrix::smoother for Gauss-Seidel.
Definition: GaussSeidelSmoother.H:54
Foam::Field< solveScalar >
Foam::UPtrList< const lduInterfaceField >
Foam::lduMatrix::smoother
Abstract base-class for lduMatrix smoothers.
Definition: lduMatrix.H:287
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::lduMatrix::smoother::fieldName
const word & fieldName() const noexcept
Definition: lduMatrix.H:386
Foam::GaussSeidelSmoother::scalarSmooth
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Definition: GaussSeidelSmoother.C:198
Foam::GaussSeidelSmoother::GaussSeidelSmoother
GaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
Definition: GaussSeidelSmoother.C:49
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::lduMatrix::smoother::interfaceIntCoeffs
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition: lduMatrix.H:401
Foam::lduMatrix::smoother::interfaceBouCoeffs
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition: lduMatrix.H:396
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::lduMatrix::smoother::matrix
const lduMatrix & matrix() const noexcept
Definition: lduMatrix.H:391