patchDistMethod.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) 2015-2016 OpenFOAM Foundation
9 Copyright (C) 2017-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::patchDistMethod
29
30Description
31 Specialisation of patchDist for wall distance calculation
32
33SourceFiles
34 patchDistMethod.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef patchDistMethod_H
39#define patchDistMethod_H
40
41#include "dictionary.H"
42#include "HashSet.H"
43#include "volFieldsFwd.H"
44#include "mapPolyMesh.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54class fvMesh;
55
56/*---------------------------------------------------------------------------*\
57 Class patchDistMethod Declaration
58\*---------------------------------------------------------------------------*/
61{
62protected:
63
64 // Protected Member Data
65
66 //- Reference to the mesh
67 const fvMesh& mesh_;
68
69 //- Set of patch IDs
71
72
73 // Protected Member Functions
74
75 //- No copy construct
76 patchDistMethod(const patchDistMethod&) = delete;
77
78 //- No copy assignment
79 void operator=(const patchDistMethod&) = delete;
80
81public:
82
83 //- Runtime type information
84 TypeName("patchDistMethod");
85
86
87 // Declare runtime construction
90 (
91 autoPtr,
94 (
95 const dictionary& dict,
96 const fvMesh& mesh,
98 ),
100 );
101
102
103 // Constructors
104
105 //- Construct from mesh and patch ID set
107 (
108 const fvMesh& mesh,
110 );
111
112
113 // Selectors
114
115 // Use "method" from dictionary, or defaultPatchDistMethod
117 (
118 const dictionary& dict,
119 const fvMesh& mesh,
120 const labelHashSet& patchIDs,
121 const word& defaultPatchDistMethod = word::null
122 );
123
124
125 //- Destructor
126 virtual ~patchDistMethod();
127
128
129 // Static Functions
130
131 //- Return the patch types for y and n
132 // These are fixedValue for the set provided otherwise zero-gradient
133 template<class Type>
134 static wordList patchTypes
135 (
136 const fvMesh& mesh,
138 );
139
140
141 // Member Functions
142
143 //- Return the patchIDs
144 const labelHashSet& patchIDs() const
145 {
146 return patchIDs_;
147 }
148
149 //- Update cached geometry when the mesh moves
150 virtual bool movePoints()
151 {
152 return true;
153 }
154
155 //- Update cached topology and geometry when the mesh changes
156 virtual void updateMesh(const mapPolyMesh&)
157 {}
158
159 //- Correct the given distance-to-patch field
160 virtual bool correct(volScalarField& y) = 0;
161
162 //- Correct the given distance-to-patch and normal-to-patch fields
163 virtual bool correct(volScalarField& y, volVectorField& n) = 0;
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#ifdef NoRepository
175#endif
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179#endif
180
181// ************************************************************************* //
scalar y
label n
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
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 word &defaultPatchDistMethod=word::null)
const fvMesh & mesh_
Reference to the mesh.
virtual ~patchDistMethod()
Destructor.
patchDistMethod(const patchDistMethod &)=delete
No copy construct.
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, volVectorField &n)=0
Correct the given distance-to-patch and normal-to-patch fields.
virtual bool correct(volScalarField &y)=0
Correct the given distance-to-patch field.
static wordList patchTypes(const fvMesh &mesh, const labelHashSet &patchIDs)
Return the patch types for y and n.
const labelHashSet & patchIDs() const
Return the patchIDs.
void operator=(const patchDistMethod &)=delete
No copy assignment.
virtual void updateMesh(const mapPolyMesh &)
Update cached topology and geometry when the mesh changes.
A class for handling words, derived from Foam::string.
Definition: word.H:68
thermo correct()
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73