patchDistMethod.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) 2015-2022 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::patchDistMethod
26 
27 Description
28  Specialisation of patchDist for wall distance calculation
29 
30 SourceFiles
31  patchDistMethod.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef patchDistMethod_H
36 #define patchDistMethod_H
37 
38 #include "dictionary.H"
39 #include "HashSet.H"
40 #include "volFieldsFwd.H"
41 #include "polyTopoChangeMap.H"
44 #include "runTimeSelectionTables.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class fvMesh;
52 
53 /*---------------------------------------------------------------------------*\
54  Class patchDistMethod Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class patchDistMethod
58 {
59 
60 protected:
61 
62  // Protected Member Data
63 
64  //- Reference to the mesh
65  const fvMesh& mesh_;
66 
67  //- Set of patch IDs
68  const labelHashSet patchIDs_;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("patchDistMethod");
75 
76 
77  // Declare runtime construction
78 
80  (
81  autoPtr,
83  dictionary,
84  (
85  const dictionary& dict,
86  const fvMesh& mesh,
87  const labelHashSet& patchIDs
88  ),
89  (dict, mesh, patchIDs)
90  );
91 
92 
93  // Constructors
94 
95  //- Construct from mesh and patch ID set
97  (
98  const fvMesh& mesh,
99  const labelHashSet& patchIDs
100  );
101 
102  //- Disallow default bitwise copy construction
103  patchDistMethod(const patchDistMethod&) = delete;
104 
105 
106  // Selectors
107 
109  (
110  const dictionary& dict,
111  const fvMesh& mesh,
112  const labelHashSet& patchIDs
113  );
114 
115 
116  //- Destructor
117  virtual ~patchDistMethod();
118 
119 
120  // Static Functions
121 
122  //- Return the patch types for y and n
123  // These are fixedValue for the set provided otherwise zero-gradient
124  template<class Type>
125  static wordList patchTypes
126  (
127  const fvMesh& mesh,
128  const labelHashSet& patchIDs
129  );
130 
131 
132  // Member Functions
133 
134  //- Return the patchIDs
135  const labelHashSet& patchIDs() const
136  {
137  return patchIDs_;
138  }
139 
140  //- Update cached geometry when the mesh moves
141  virtual bool movePoints()
142  {
143  return true;
144  }
145 
146  //- Update cached topology and geometry when the mesh changes
147  virtual void topoChange(const polyTopoChangeMap&)
148  {}
149 
150  //- Update from another mesh using the given map
151  virtual void mapMesh(const polyMeshMap&)
152  {}
153 
154  //- Redistribute or update using the given distribution map
155  virtual void distribute(const polyDistributionMap&)
156  {}
157 
158  //- Correct the given distance-to-patch field
159  virtual bool correct(volScalarField& y) = 0;
160 
161  //- Correct the given distance-to-patch and normal-to-patch fields
162  virtual bool correct(volScalarField& y, volVectorField& n) = 0;
163 
164 
165  // Member Operators
166 
167  //- Disallow default bitwise assignment
168  void operator=(const patchDistMethod&) = delete;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
179  #include "patchDistMethodTemplates.C"
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
scalar y
label n
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Specialisation of patchDist for wall distance calculation.
declareRunTimeSelectionTable(autoPtr, patchDistMethod, dictionary,(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs),(dict, mesh, patchIDs))
static autoPtr< patchDistMethod > New(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs)
const fvMesh & mesh_
Reference to the mesh.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual ~patchDistMethod()
Destructor.
virtual void topoChange(const polyTopoChangeMap &)
Update cached topology and geometry when the mesh changes.
const labelHashSet patchIDs_
Set of patch IDs.
TypeName("patchDistMethod")
Runtime type information.
virtual bool movePoints()
Update cached geometry when the mesh moves.
virtual bool correct(volScalarField &y)=0
Correct the given distance-to-patch field.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
patchDistMethod(const fvMesh &mesh, const labelHashSet &patchIDs)
Construct from mesh and patch ID set.
static wordList patchTypes(const fvMesh &mesh, const labelHashSet &patchIDs)
Return the patch types for y and n.
void operator=(const patchDistMethod &)=delete
Disallow default bitwise assignment.
const labelHashSet & patchIDs() const
Return the patchIDs.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
dictionary dict