Loading...
Searching...
No Matches
surfaceZonesInfo.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) 2014 OpenFOAM Foundation
9 Copyright (C) 2015,2023 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::surfaceZonesInfo
29
30Description
31
32SourceFiles
33 surfaceZonesInfo.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef surfaceZonesInfo_H
38#define surfaceZonesInfo_H
39
40#include "Enum.H"
41#include "pointField.H"
42#include "word.H"
43#include "PtrList.H"
44#include "labelList.H"
45#include "boolList.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
54class polyMesh;
55class dictionary;
57/*---------------------------------------------------------------------------*\
58 Class surfaceZonesInfo Declaration
59\*---------------------------------------------------------------------------*/
60
62{
63public:
64
65 //- Types of selection of area
67 {
69 OUTSIDE,
72 };
73
75
76 //- How to generate faceZone name
78 {
81 REGION
82 };
85
86 //- What to do with faceZone faces
87 enum faceZoneType
96
97private:
98
99 // Private data
100
101 //- Per 'interface' surface : names of faceZones to put faces into
102 wordList faceZoneNames_;
103
104 //- Per 'interface' surface : name of cellZone to put cells into
105 word cellZoneName_;
106
107 //- Per 'interface' surface : (only used if surface is closed)
108 // How to select zone cells : surface inside or outside or given
109 // inside location.
110 areaSelectionAlgo zoneInside_;
111
112 //- If zoneInside=location gives the corresponding inside point
113 pointField zoneInsidePoints_;
114
115 //- Per 'interface' surface :
116 // What to do with outside
117 faceZoneType faceType_;
118
119
120 // Private Member Functions
121
122 //- No copy assignment
123 void operator=(const surfaceZonesInfo&) = delete;
124
125
126public:
127
128 // Constructors
129
130 //- Construct from surfaces and dictionary and fully resolved
131 // region names (for optional automatic faceZone naming)
133 (
134 const searchableSurface& surface,
135 const dictionary& surfacesDict,
136 const wordList& regionNames
137 );
138
139 //- Construct from components
141 (
142 const wordList& faceZoneNames,
143 const word& cellZoneNames,
147 );
148
149 //- Copy constructor
151
152 //- Return clone
154 {
155 return autoPtr<surfaceZonesInfo>::New(*this);
156 }
157
158
159 // Member Functions
160
161 // Access
162
163 //- Per 'interface' surface : empty or names of faceZones to put
164 // faces into (according to region)
165 const wordList& faceZoneNames() const
166 {
167 return faceZoneNames_;
168 }
169
170 //- Per 'interface' surface : empty or name of cellZone to put
171 // cells into
172 const word& cellZoneName() const
173 {
174 return cellZoneName_;
175 }
176
178 {
179 return zoneInside_;
180 }
181
182 //- Get specified inside location for surfaces with a cellZone
183 const point zoneInsidePoint() const
184 {
185 return zoneInsidePoints_[0];
186 }
187
188 //- Get specified inside locations for surfaces with a cellZone
189 const pointField& zoneInsidePoints() const
190 {
191 return zoneInsidePoints_;
193
194 //- How to handle face of surfaces with a faceZone
195 const faceZoneType& faceType() const
196 {
197 return faceType_;
198 }
199
200
201 // Query
203 //- Get indices of unnamed surfaces (surfaces without faceZoneName)
205 (
206 const PtrList<surfaceZonesInfo>& surfList
207 );
208
209 //- Get indices of named surfaces (surfaces with faceZoneName)
211 (
212 const PtrList<surfaceZonesInfo>& surfList
213 );
214
215 //- Get indices of named surfaces without a cellZone
217 (
218 const PtrList<surfaceZonesInfo>& surfList
219 );
220
221 //- Get indices of surfaces with a cellZone that are closed and
222 // have 'inside' or 'outside' selection.
224 (
225 const PtrList<surfaceZonesInfo>& surfList,
226 const searchableSurfaces& allGeometry,
227 const labelList& surfaces
228 );
229
230 //- Get indices of surfaces with a cellZone that are unclosed
232 (
233 const PtrList<surfaceZonesInfo>& surfList,
234 const searchableSurfaces& allGeometry,
235 const labelList& surfaces
236 );
237
238 //- Get indices of surfaces with a cellZone that are closed.
240 (
241 const PtrList<surfaceZonesInfo>& surfList,
242 const searchableSurfaces& allGeometry,
243 const labelList& surfaces
244 );
245
246 //- Get indices of surfaces with a cellZone that have 'insidePoint'
247 // section.
249 (
250 const PtrList<surfaceZonesInfo>& surfList
251 );
252
253 static label addCellZone
254 (
255 const word& name,
256 const labelList& addressing,
258 );
259
261 (
262 const PtrList<surfaceZonesInfo>& surfList,
263 const labelList& namedSurfaces,
265 );
266
267 static label addFaceZone
268 (
269 const word& name,
270 const labelList& addressing,
271 const boolList& flipMap,
273 );
274
276 (
277 const PtrList<surfaceZonesInfo>& surfList,
278 const labelList& namedSurfaces,
280 );
281};
282
283
284// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285
286} // End namespace Foam
287
288// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289
290#endif
291
292// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition Enum.H:57
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
faceZoneNaming
How to generate faceZone name.
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have 'insidePoint'.
areaSelectionAlgo
Types of selection of area.
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName).
static labelList getStandaloneNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces without a cellZone.
faceZoneType
What to do with faceZone faces.
autoPtr< surfaceZonesInfo > clone() const
Return clone.
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)
const pointField & zoneInsidePoints() const
Get specified inside locations for surfaces with a cellZone.
static const Enum< faceZoneType > faceZoneTypeNames
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName).
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
const areaSelectionAlgo & zoneInside() const
const word & cellZoneName() const
Per 'interface' surface : empty or name of cellZone to put.
static const Enum< faceZoneNaming > faceZoneNamingNames
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static labelList getUnclosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are unclosed.
static labelListList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static const Enum< areaSelectionAlgo > areaSelectionAlgoNames
const faceZoneType & faceType() const
How to handle face of surfaces with a faceZone.
const point zoneInsidePoint() const
Get specified inside location for surfaces with a cellZone.
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict, const wordList &regionNames)
Construct from surfaces and dictionary and fully resolved.
static labelList getClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed and.
const wordList & faceZoneNames() const
Per 'interface' surface : empty or names of faceZones to put.
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
wordList regionNames
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
vector point
Point is a vector.
Definition point.H:37
List< bool > boolList
A List of bools.
Definition List.H:60
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
vectorField pointField
pointField is a vectorField.