Loading...
Searching...
No Matches
DILUGaussSeidelSmoother.C
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-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
28
30#include "PrecisionAdaptor.H"
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34namespace Foam
35{
37
38 lduMatrix::smoother::
39 addasymMatrixConstructorToTable<DILUGaussSeidelSmoother>
41}
42
43
44// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45
47(
48 const word& fieldName,
49 const lduMatrix& matrix,
50 const FieldField<Field, scalar>& interfaceBouCoeffs,
51 const FieldField<Field, scalar>& interfaceIntCoeffs,
52 const lduInterfaceFieldPtrsList& interfaces,
53 const dictionary& solverControls
54)
55:
56 lduMatrix::smoother
57 (
58 fieldName,
59 matrix,
60 interfaceBouCoeffs,
61 interfaceIntCoeffs,
62 interfaces
63 ),
64 diluSmoother_
65 (
66 fieldName,
67 matrix,
68 interfaceBouCoeffs,
69 interfaceIntCoeffs,
70 interfaces,
71 solverControls
72 ),
73 gsSmoother_
74 (
75 fieldName,
76 matrix,
77 interfaceBouCoeffs,
78 interfaceIntCoeffs,
79 interfaces,
80 solverControls
81 )
82{}
83
84
85// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
86
88(
90 const solveScalarField& source,
91 const direction cmpt,
92 const label nSweeps
93) const
94{
95 diluSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
96 gsSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
97}
98
99
101(
103 const scalarField& source,
104 const direction cmpt,
105 const label nSweeps
106) const
107{
108 scalarSmooth
109 (
110 psi,
112 cmpt,
113 nSweeps
114 );
115}
116
117
118// ************************************************************************* //
A const Field/List wrapper with possible data conversion.
Combined DILU/GaussSeidel smoother for asymmetric matrices in which DILU smoothing is followed by Gau...
virtual void smooth(solveScalarField &psi, const scalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
DILUGaussSeidelSmoother(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.
void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
A field of fields is a PtrList of fields with reference counting.
Definition FieldField.H:77
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition lduMatrix.H:538
smoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct for given field name, matrix etc.
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition lduMatrix.H:543
const lduMatrix & matrix() const noexcept
Definition lduMatrix.H:528
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition lduMatrix.H:533
const word & fieldName() const noexcept
Definition lduMatrix.H:523
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition lduMatrix.H:81
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
const volScalarField & psi
Namespace for OpenFOAM.
lduMatrix::smoother::addasymMatrixConstructorToTable< DILUGaussSeidelSmoother > addDILUGaussSeidelSmootherAsymMatrixConstructorToTable_
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< solveScalar > solveScalarField
uint8_t direction
Definition direction.H:49
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.