Loading...
Searching...
No Matches
DICGaussSeidelSmoother.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\*---------------------------------------------------------------------------*/
30
31// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33namespace Foam
34{
36
37 lduMatrix::smoother::addsymMatrixConstructorToTable<DICGaussSeidelSmoother>
39}
40
41
42// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43
45(
46 const word& fieldName,
47 const lduMatrix& matrix,
48 const FieldField<Field, scalar>& interfaceBouCoeffs,
49 const FieldField<Field, scalar>& interfaceIntCoeffs,
50 const lduInterfaceFieldPtrsList& interfaces,
51 const dictionary& solverControls
52)
53:
54 lduMatrix::smoother
55 (
56 fieldName,
57 matrix,
58 interfaceBouCoeffs,
59 interfaceIntCoeffs,
60 interfaces
61 ),
62 dicSmoother_
63 (
64 fieldName,
65 matrix,
66 interfaceBouCoeffs,
67 interfaceIntCoeffs,
68 interfaces,
69 solverControls
70 ),
71 gsSmoother_
72 (
73 fieldName,
74 matrix,
75 interfaceBouCoeffs,
76 interfaceIntCoeffs,
77 interfaces,
78 solverControls
79 )
80{}
81
82
83// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84
86(
88 const scalarField& source,
89 const direction cmpt,
90 const label nSweeps
91) const
92{
93 dicSmoother_.smooth(psi, source, cmpt, nSweeps);
94 gsSmoother_.smooth(psi, source, cmpt, nSweeps);
95}
96
97
99(
101 const solveScalarField& source,
102 const direction cmpt,
103 const label nSweeps
104) const
105{
106 dicSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
107 gsSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
108}
109
110
111// ************************************************************************* //
Combined DIC/GaussSeidel smoother for symmetric matrices in which DIC smoothing is followed by GaussS...
virtual void smooth(solveScalarField &psi, const scalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
DICGaussSeidelSmoother(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.
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.
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.
lduMatrix::smoother::addsymMatrixConstructorToTable< DICGaussSeidelSmoother > addDICGaussSeidelSmootherSymMatrixConstructorToTable_