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 -------------------------------------------------------------------------------
11 License
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 
29 #include "DICGaussSeidelSmoother.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(DICGaussSeidelSmoother, 0);
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 )
52 :
54  (
55  fieldName,
56  matrix,
57  interfaceBouCoeffs,
58  interfaceIntCoeffs,
59  interfaces
60  ),
61  dicSmoother_
62  (
63  fieldName,
64  matrix,
65  interfaceBouCoeffs,
66  interfaceIntCoeffs,
67  interfaces
68  ),
69  gsSmoother_
70  (
71  fieldName,
72  matrix,
73  interfaceBouCoeffs,
74  interfaceIntCoeffs,
75  interfaces
76  )
77 {}
78 
79 
80 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
81 
83 (
85  const scalarField& source,
86  const direction cmpt,
87  const label nSweeps
88 ) const
89 {
90  dicSmoother_.smooth(psi, source, cmpt, nSweeps);
91  gsSmoother_.smooth(psi, source, cmpt, nSweeps);
92 }
93 
94 
96 (
98  const solveScalarField& source,
99  const direction cmpt,
100  const label nSweeps
101 ) const
102 {
103  dicSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
104  gsSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
105 }
106 
107 
108 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::DICGaussSeidelSmoother::DICGaussSeidelSmoother
DICGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from matrix components.
Definition: DICGaussSeidelSmoother.C:45
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::addDICGaussSeidelSmootherSymMatrixConstructorToTable_
lduMatrix::smoother::addsymMatrixConstructorToTable< DICGaussSeidelSmoother > addDICGaussSeidelSmootherSymMatrixConstructorToTable_
Definition: DICGaussSeidelSmoother.C:38
Foam::DICGaussSeidelSmoother::scalarSmooth
virtual void scalarSmooth(solveScalarField &psi, const solveScalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Definition: DICGaussSeidelSmoother.C:96
Foam::Field< solveScalar >
Foam::DICGaussSeidelSmoother::smooth
virtual void smooth(solveScalarField &psi, const scalarField &Source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Definition: DICGaussSeidelSmoother.C:83
Foam::UPtrList< const lduInterfaceField >
Foam::lduMatrix::smoother
Abstract base-class for lduMatrix smoothers.
Definition: lduMatrix.H:287
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::direction
uint8_t direction
Definition: direction.H:52
DICGaussSeidelSmoother.H
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)