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-2018 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 private:
71 
72  // Private Member Functions
73 
74  //- Disallow default bitwise copy construct
76 
77  //- Disallow default bitwise assignment
78  void operator=(const patchDistMethod&);
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("patchDistMethod");
84 
85 
86  // Declare runtime construction
87 
89  (
90  autoPtr,
92  dictionary,
93  (
94  const dictionary& dict,
95  const fvMesh& mesh,
96  const labelHashSet& patchIDs
97  ),
98  (dict, mesh, patchIDs)
99  );
100 
101 
102  // Constructors
103 
104  //- Construct from mesh and patch ID set
106  (
107  const fvMesh& mesh,
108  const labelHashSet& patchIDs
109  );
110 
111 
112  // Selectors
113 
115  (
116  const dictionary& dict,
117  const fvMesh& mesh,
118  const labelHashSet& patchIDs
119  );
120 
121 
122  //- Destructor
123  virtual ~patchDistMethod();
124 
125 
126  // Static Functions
127 
128  //- Return the patch types for y and n
129  // These are fixedValue for the set provided otherwise zero-gradient
130  template<class Type>
131  static wordList patchTypes
132  (
133  const fvMesh& mesh,
134  const labelHashSet& patchIDs
135  );
136 
137 
138  // Member Functions
139 
140  //- Return the patchIDs
141  const labelHashSet& patchIDs() const
142  {
143  return patchIDs_;
144  }
145 
146  //- Update cached geometry when the mesh moves
147  virtual bool movePoints()
148  {
149  return true;
150  }
151 
152  //- Update cached topology and geometry when the mesh changes
153  virtual void updateMesh(const mapPolyMesh&)
154  {}
155 
156  //- Correct the given distance-to-patch field
157  virtual bool correct(volScalarField& y) = 0;
158 
159  //- Correct the given distance-to-patch and normal-to-patch fields
160  virtual bool correct(volScalarField& y, volVectorField& n) = 0;
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:137
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.
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.