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 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 "point.H"
42#include "word.H"
43#include "PtrList.H"
44#include "labelList.H"
45#include "boolList.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52class searchableSurface;
53class searchableSurfaces;
54class polyMesh;
55class dictionary;
56
57/*---------------------------------------------------------------------------*\
58 Class surfaceZonesInfo Declaration
59\*---------------------------------------------------------------------------*/
62{
63public:
64
65 //- Types of selection of area
67 {
72 };
75
76 //- How to generate faceZone name
78 {
80 SINGLE,
82 };
85
86 //- What to do with faceZone faces
87 enum faceZoneType
88 {
90 BAFFLE,
92 };
95
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 point zoneInsidePoint_;
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,
145 const point& zoneInsidePoints,
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 }
177 const areaSelectionAlgo& zoneInside() const
178 {
179 return zoneInside_;
180 }
181
182 //- Get specified inside locations for surfaces with a cellZone
183 const point& zoneInsidePoint() const
184 {
185 return zoneInsidePoint_;
186 }
187
188 //- How to handle face of surfaces with a faceZone
189 const faceZoneType& faceType() const
190 {
191 return faceType_;
192 }
193
194
195 // Query
196
197 //- Get indices of unnamed surfaces (surfaces without faceZoneName)
199 (
200 const PtrList<surfaceZonesInfo>& surfList
201 );
202
203 //- Get indices of named surfaces (surfaces with faceZoneName)
205 (
206 const PtrList<surfaceZonesInfo>& surfList
207 );
208
209 //- Get indices of named surfaces without a cellZone
211 (
212 const PtrList<surfaceZonesInfo>& surfList
213 );
214
215 //- Get indices of surfaces with a cellZone that are closed and
216 // have 'inside' or 'outside' selection.
218 (
219 const PtrList<surfaceZonesInfo>& surfList,
220 const searchableSurfaces& allGeometry,
221 const labelList& surfaces
222 );
223
224 //- Get indices of surfaces with a cellZone that are unclosed
226 (
227 const PtrList<surfaceZonesInfo>& surfList,
228 const searchableSurfaces& allGeometry,
229 const labelList& surfaces
230 );
231
232 //- Get indices of surfaces with a cellZone that are closed.
234 (
235 const PtrList<surfaceZonesInfo>& surfList,
236 const searchableSurfaces& allGeometry,
237 const labelList& surfaces
238 );
239
240 //- Get indices of surfaces with a cellZone that have 'insidePoint'
241 // section.
243 (
244 const PtrList<surfaceZonesInfo>& surfList
245 );
246
247 static label addCellZone
248 (
249 const word& name,
250 const labelList& addressing,
252 );
253
255 (
256 const PtrList<surfaceZonesInfo>& surfList,
257 const labelList& namedSurfaces,
259 );
260
261 static label addFaceZone
262 (
263 const word& name,
264 const labelList& addressing,
265 const boolList& flipMap,
267 );
268
270 (
271 const PtrList<surfaceZonesInfo>& surfList,
272 const labelList& namedSurfaces,
274 );
275};
276
277
278// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
279
280} // End namespace Foam
281
282// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
283
284#endif
285
286// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
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 consisting of general polyhedral cells.
Definition: polyMesh.H:81
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 point & zoneInsidePoint() 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.
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)
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:68
dynamicFvMesh & mesh
wordList regionNames
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59