nonBlockingGaussSeidelSmoother.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::nonBlockingGaussSeidelSmoother
26 
27 Description
28  Variant of gaussSeidelSmoother that expects processor boundary
29  cells to be sorted last and so can block later. Only when the
30  cells are actually visited does it need the results to be present.
31  It is expected that there is little benefit to be gained from doing
32  this on a patch by patch basis since the number of processor interfaces
33  is quite small and the overhead of checking whether a processor interface
34  is finished might be quite high (call into mpi). Also this would
35  require a dynamic memory allocation to store the state of the outstanding
36  requests.
37 
38 SourceFiles
39  nonBlockingGaussSeidelSmoother.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef nonBlockingGaussSeidelSmoother_H
44 #define nonBlockingGaussSeidelSmoother_H
45 
46 #include "lduMatrix.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class nonBlockingGaussSeidelSmoother Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public lduMatrix::smoother
60 {
61  // Private Data
62 
63  //- Starting cell when to block
64  label blockStart_;
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("nonBlockingGaussSeidel");
70 
71 
72  // Constructors
73 
74  //- Construct from components
76  (
77  const word& fieldName,
78  const lduMatrix& matrix,
82  );
83 
84 
85  // Member Functions
86 
87  //- Smooth for the given number of sweeps
88  static void smooth
89  (
90  const word& fieldName,
92  const lduMatrix& matrix,
93  const label blockStart,
94  const scalarField& source,
95  const FieldField<Field, scalar>& interfaceBouCoeffs,
96  const lduInterfaceFieldPtrsList& interfaces,
97  const direction cmpt,
98  const label nSweeps
99  );
100 
101  //- Smooth the solution for a given number of sweeps
102  virtual void smooth
103  (
104  scalarField& psi,
105  const scalarField& Source,
106  const direction cmpt,
107  const label nSweeps
108  ) const;
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
nonBlockingGaussSeidelSmoother(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces)
Construct from components.
const FieldField< Field, scalar > & interfaceIntCoeffs() const
Definition: lduMatrix.H:387
Variant of gaussSeidelSmoother that expects processor boundary cells to be sorted last and so can blo...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const word & fieldName() const
Definition: lduMatrix.H:372
uint8_t direction
Definition: direction.H:45
const lduMatrix & matrix() const
Definition: lduMatrix.H:377
const FieldField< Field, scalar > & interfaceBouCoeffs() const
Definition: lduMatrix.H:382
Generic field type.
Definition: FieldField.H:51
Abstract base-class for lduMatrix smoothers.
Definition: lduMatrix.H:270
A class for handling words, derived from string.
Definition: word.H:59
TypeName("nonBlockingGaussSeidel")
Runtime type information.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Definition: lduMatrix.H:79
const volScalarField & psi
const lduInterfaceFieldPtrsList & interfaces() const
Definition: lduMatrix.H:392
static void smooth(const word &fieldName, scalarField &psi, const lduMatrix &matrix, const label blockStart, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt, const label nSweeps)
Smooth for the given number of sweeps.
Namespace for OpenFOAM.