TGaussSeidelSmoother.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-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::TGaussSeidelSmoother
28 
29 Description
30  Foam::TGaussSeidelSmoother
31 
32 SourceFiles
33  TGaussSeidelSmoother.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef TGaussSeidelSmoother_H
38 #define TGaussSeidelSmoother_H
39 
40 #include "LduMatrix.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class TGaussSeidelSmoother Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type, class DType, class LUType>
53 :
54  public LduMatrix<Type, DType, LUType>::smoother
55 {
56  // Private data
57 
58  //- The inverse (reciprocal for scalars) diagonal
59  Field<DType> rD_;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("GaussSeidel");
66 
67 
68  // Constructors
69 
70  //- Construct from components
72  (
73  const word& fieldName,
75  );
76 
77 
78  // Member Functions
79 
80  //- Smooth for the given number of sweeps
81  static void smooth
82  (
83  const word& fieldName,
86  const Field<DType>& rD,
87  const label nSweeps
88  );
89 
90 
91  //- Smooth the solution for a given number of sweeps
92  virtual void smooth
93  (
95  const label nSweeps
96  ) const;
97 };
98 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 } // End namespace Foam
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #ifdef NoRepository
107  #include "TGaussSeidelSmoother.C"
108 #endif
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::LduMatrix
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: LduMatrix.H:72
Foam::TGaussSeidelSmoother::TGaussSeidelSmoother
TGaussSeidelSmoother(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix)
Construct from components.
Definition: TGaussSeidelSmoother.C:35
LduMatrix.H
Foam::LduMatrix::smoother::matrix
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
Definition: LduMatrix.H:346
Foam::Field< DType >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
TGaussSeidelSmoother.C
Foam::LduMatrix::smoother::fieldName
const word & fieldName() const noexcept
Definition: LduMatrix.H:341
Foam::TGaussSeidelSmoother::smooth
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.
Definition: TGaussSeidelSmoother.C:62
Foam::TGaussSeidelSmoother
Foam::TGaussSeidelSmoother.
Definition: TGaussSeidelSmoother.H:51
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::TGaussSeidelSmoother::TypeName
TypeName("GaussSeidel")
Runtime type information.