All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2020 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 "mapPolyMesh.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 updateMesh(const mapPolyMesh&)
148  {}
149 
150  //- Correct the given distance-to-patch field
151  virtual bool correct(volScalarField& y) = 0;
152 
153  //- Correct the given distance-to-patch and normal-to-patch fields
154  virtual bool correct(volScalarField& y, volVectorField& n) = 0;
155 
156 
157  // Member Operators
158 
159  //- Disallow default bitwise assignment
160  void operator=(const patchDistMethod&) = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #ifdef NoRepository
171  #include "patchDistMethodTemplates.C"
172 #endif
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
dictionary dict
virtual ~patchDistMethod()
Destructor.
static autoPtr< patchDistMethod > New(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void updateMesh(const mapPolyMesh &)
Update cached topology and geometry when the mesh changes.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
const fvMesh & mesh_
Reference to the mesh.
scalar y
dynamicFvMesh & mesh
declareRunTimeSelectionTable(autoPtr, patchDistMethod, dictionary,(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs),(dict, mesh, patchIDs))
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.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual bool movePoints()
Update cached geometry when the mesh moves.
const labelHashSet patchIDs_
Set of patch IDs.
label n
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
virtual bool correct(volScalarField &y)=0
Correct the given distance-to-patch field.
Specialisation of patchDist for wall distance calculation.
TypeName("patchDistMethod")
Runtime type information.
Namespace for OpenFOAM.
patchDistMethod(const fvMesh &mesh, const labelHashSet &patchIDs)
Construct from mesh and patch ID set.