nonBlockingGaussSeidelSmoother.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 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 Class
28  Foam::nonBlockingGaussSeidelSmoother
29 
30 Group
31  grpLduMatrixSmoothers
32 
33 Description
34  Variant of gaussSeidelSmoother that expects processor boundary
35  cells to be sorted last and so can block later. Only when the
36  cells are actually visited does it need the results to be present.
37  It is expected that there is little benefit to be gained from doing
38  this on a patch by patch basis since the number of processor interfaces
39  is quite small and the overhead of checking whether a processor interface
40  is finished might be quite high (call into mpi). Also this would
41  require a dynamic memory allocation to store the state of the outstanding
42  requests.
43 
44 SourceFiles
45  nonBlockingGaussSeidelSmoother.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef nonBlockingGaussSeidelSmoother_H
50 #define nonBlockingGaussSeidelSmoother_H
51 
52 #include "lduMatrix.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class nonBlockingGaussSeidelSmoother Declaration
61 \*---------------------------------------------------------------------------*/
62 
64 :
65  public lduMatrix::smoother
66 {
67  // Private data
68 
69  //- Starting cell when to block
70  label blockStart_;
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("nonBlockingGaussSeidel");
76 
77 
78  // Constructors
79 
80  //- Construct from components
82  (
83  const word& fieldName,
84  const lduMatrix& matrix,
88  );
89 
90 
91  // Member Functions
92 
93  //- Smooth for the given number of sweeps
94  static void smooth
95  (
96  const word& fieldName,
98  const lduMatrix& matrix,
99  const label blockStart,
100  const solveScalarField& source,
103  const direction cmpt,
104  const label nSweeps
105  );
106 
107  //- Smooth the solution for a given number of sweeps
108  virtual void smooth
109  (
111  const scalarField& Source,
112  const direction cmpt,
113  const label nSweeps
114  ) const;
115 
116  //- Smooth the solution for a given number of sweeps
117  virtual void scalarSmooth
118  (
120  const solveScalarField& source,
121  const direction cmpt,
122  const label nSweeps
123  ) const;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
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::nonBlockingGaussSeidelSmoother::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: nonBlockingGaussSeidelSmoother.C:231
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::lduMatrix::smoother::interfaces
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition: lduMatrix.H:406
Foam::nonBlockingGaussSeidelSmoother::nonBlockingGaussSeidelSmoother
nonBlockingGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
Definition: nonBlockingGaussSeidelSmoother.C:51
lduMatrix.H
Foam::Field< solveScalar >
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::lduMatrix::smoother::fieldName
const word & fieldName() const noexcept
Definition: lduMatrix.H:386
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::nonBlockingGaussSeidelSmoother::TypeName
TypeName("nonBlockingGaussSeidel")
Runtime type information.
Foam::lduMatrix::smoother::interfaceIntCoeffs
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition: lduMatrix.H:401
Foam::lduMatrix::smoother::interfaceBouCoeffs
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition: lduMatrix.H:396
Foam::nonBlockingGaussSeidelSmoother
Variant of gaussSeidelSmoother that expects processor boundary cells to be sorted last and so can blo...
Definition: nonBlockingGaussSeidelSmoother.H:62
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::nonBlockingGaussSeidelSmoother::smooth
static void smooth(const word &fieldName, solveScalarField &psi, const lduMatrix &matrix, const label blockStart, const solveScalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
Definition: nonBlockingGaussSeidelSmoother.C:98
Foam::lduMatrix::smoother::matrix
const lduMatrix & matrix() const noexcept
Definition: lduMatrix.H:391