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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::TGaussSeidelSmoother
28
29Description
30 Foam::TGaussSeidelSmoother
31
32SourceFiles
33 TGaussSeidelSmoother.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef TGaussSeidelSmoother_H
38#define TGaussSeidelSmoother_H
39
40#include "LduMatrix.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class TGaussSeidelSmoother Declaration
49\*---------------------------------------------------------------------------*/
50
51template<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
62public:
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// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
Definition: LduMatrix.H:346
const word & fieldName() const noexcept
Definition: LduMatrix.H:341
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: LduMatrix.H:88
Foam::TGaussSeidelSmoother.
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.
TypeName("GaussSeidel")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & psi
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73