TGaussSeidelSmoother.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::TGaussSeidelSmoother
26 
27 Description
28  Foam::TGaussSeidelSmoother
29 
30 SourceFiles
31  TGaussSeidelSmoother.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef TGaussSeidelSmoother_H
36 #define TGaussSeidelSmoother_H
37 
38 #include "LduMatrix.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class TGaussSeidelSmoother Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type, class DType, class LUType>
51 :
52  public LduMatrix<Type, DType, LUType>::smoother
53 {
54  // Private Data
55 
56  //- The inverse (reciprocal for scalars) diagonal
57  Field<DType> rD_;
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,
73  );
74 
75 
76  // Member Functions
77 
78  //- Smooth for the given number of sweeps
79  static void smooth
80  (
81  const word& fieldName,
83  const LduMatrix<Type, DType, LUType>& matrix,
84  const Field<DType>& rD,
85  const label nSweeps
86  );
87 
88 
89  //- Smooth the solution for a given number of sweeps
90  virtual void smooth
91  (
92  Field<Type>& psi,
93  const label nSweeps
94  ) const;
95 };
96 
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace Foam
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #ifdef NoRepository
105  #include "TGaussSeidelSmoother.C"
106 #endif
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
const word & fieldName() const
Definition: LduMatrix.H:340
TypeName("GaussSeidel")
Runtime type information.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static void smooth(const word &fieldName, Field< Type > &psi, const LduMatrix< Type, DType, LUType > &matrix, const Field< DType > &rD, const label nSweeps)
Smooth for the given number of sweeps.
TGaussSeidelSmoother(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:59
LduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Definition: LduMatrix.H:69
const volScalarField & psi
const LduMatrix< Type, DType, LUType > & matrix() const
Definition: LduMatrix.H:345
Namespace for OpenFOAM.
Foam::TGaussSeidelSmoother.