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 -------------------------------------------------------------------------------
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 
30 #include "PrecisionAdaptor.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(DILUGaussSeidelSmoother, 0);
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 )
54 :
56  (
57  fieldName,
58  matrix,
59  interfaceBouCoeffs,
60  interfaceIntCoeffs,
61  interfaces
62  ),
63  diluSmoother_
64  (
65  fieldName,
66  matrix,
67  interfaceBouCoeffs,
68  interfaceIntCoeffs,
69  interfaces
70  ),
71  gsSmoother_
72  (
73  fieldName,
74  matrix,
75  interfaceBouCoeffs,
76  interfaceIntCoeffs,
77  interfaces
78  )
79 {}
80 
81 
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 
85 (
87  const solveScalarField& source,
88  const direction cmpt,
89  const label nSweeps
90 ) const
91 {
92  diluSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
93  gsSmoother_.scalarSmooth(psi, source, cmpt, nSweeps);
94 }
95 
96 
98 (
100  const scalarField& source,
101  const direction cmpt,
102  const label nSweeps
103 ) const
104 {
105  scalarSmooth
106  (
107  psi,
109  cmpt,
110  nSweeps
111  );
112 }
113 
114 
115 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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
PrecisionAdaptor.H
Foam::DILUGaussSeidelSmoother::scalarSmooth
void scalarSmooth(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const label nSweeps) const
Smooth the solution for a given number of sweeps.
Definition: DILUGaussSeidelSmoother.C:85
Foam::Field< solveScalar >
Foam::DILUGaussSeidelSmoother::DILUGaussSeidelSmoother
DILUGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from matrix components.
Definition: DILUGaussSeidelSmoother.C:47
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::addDILUGaussSeidelSmootherAsymMatrixConstructorToTable_
lduMatrix::smoother::addasymMatrixConstructorToTable< DILUGaussSeidelSmoother > addDILUGaussSeidelSmootherAsymMatrixConstructorToTable_
Definition: DILUGaussSeidelSmoother.C:40
Foam::DILUGaussSeidelSmoother::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: DILUGaussSeidelSmoother.C:98
DILUGaussSeidelSmoother.H
Foam::ConstPrecisionAdaptor
A const Field/List wrapper with possible data conversion.
Definition: PrecisionAdaptor.H:57
Foam::direction
uint8_t direction
Definition: direction.H:52
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)