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 | Copyright (C) 2014 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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::surfaceZonesInfo
26 
27 Description
28 
29 SourceFiles
30  surfaceZonesInfo.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef surfaceZonesInfo_H
35 #define surfaceZonesInfo_H
36 
37 #include "NamedEnum.H"
38 #include "point.H"
39 #include "word.H"
40 #include "PtrList.H"
41 #include "labelList.H"
42 #include "boolList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class searchableSurface;
50 class searchableSurfaces;
51 class polyMesh;
52 class dictionary;
53 
54 /*---------------------------------------------------------------------------*\
55  Class surfaceZonesInfo Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class surfaceZonesInfo
59 {
60 public:
61 
62  //- Types of selection of area
64  {
68  NONE
69  };
70 
72 
73  //- What to do with faceZone faces
74  enum faceZoneType
75  {
78  BOUNDARY
79  };
80 
82 
83 
84 private:
85 
86  // Private data
87 
88  //- Per 'interface' surface : name of faceZone to put faces into
90 
91  //- Per 'interface' surface : name of cellZone to put cells into
93 
94  //- Per 'interface' surface : (only used if surface is closed)
95  // How to select zone cells : surface inside or outside or given
96  // inside location.
98 
99  //- If zoneInside=location gives the corresponding inside point
101 
102  //- Per 'interface' surface :
103  // What to do with outside
105 
106 
107  // Private Member Functions
108 
109  //- Disallow default bitwise assignment
110  void operator=(const surfaceZonesInfo&);
111 
112 
113 public:
114 
115  // Constructors
116 
117  //- Construct from surfaces and dictionary
119  (
120  const searchableSurface& surface,
121  const dictionary& surfacesDict
122  );
123 
124  //- Construct from components
126  (
127  const word& faceZoneNames,
128  const word& cellZoneNames,
130  const point& zoneInsidePoints,
131  const faceZoneType& faceType
132  );
133 
134  //- Copy constructor
136 
137  //- Return clone
139  {
140  return autoPtr<surfaceZonesInfo>(new surfaceZonesInfo(*this));
141  }
142 
143 
144  // Member Functions
145 
146  // Access
147 
148  //- Per 'interface' surface : empty or name of faceZone to put
149  // faces into
150  const word& faceZoneName() const
151  {
152  return faceZoneName_;
153  }
154 
155  //- Per 'interface' surface : empty or name of cellZone to put
156  // cells into
157  const word& cellZoneName() const
158  {
159  return cellZoneName_;
160  }
161 
162  const areaSelectionAlgo& zoneInside() const
163  {
164  return zoneInside_;
165  }
166 
167  //- Get specified inside locations for surfaces with a cellZone
168  const point& zoneInsidePoint() const
169  {
170  return zoneInsidePoint_;
171  }
172 
173  //- How to handle face of surfaces with a faceZone
174  const faceZoneType& faceType() const
175  {
176  return faceType_;
177  }
178 
179 
180  // Query
181 
182  //- Get indices of unnamed surfaces (surfaces without faceZoneName)
184  (
185  const PtrList<surfaceZonesInfo>& surfList
186  );
187 
188  //- Get indices of named surfaces (surfaces with faceZoneName)
190  (
191  const PtrList<surfaceZonesInfo>& surfList
192  );
193 
194  //- Get indices of named surfaces without a cellZone
196  (
197  const PtrList<surfaceZonesInfo>& surfList
198  );
199 
200  //- Get indices of surfaces with a cellZone that are closed and
201  // have 'inside' or 'outside' selection.
203  (
204  const PtrList<surfaceZonesInfo>& surfList,
205  const searchableSurfaces& allGeometry,
206  const labelList& surfaces
207  );
208 
209  //- Get indices of surfaces with a cellZone that are unclosed
211  (
212  const PtrList<surfaceZonesInfo>& surfList,
213  const searchableSurfaces& allGeometry,
214  const labelList& surfaces
215  );
216 
217  //- Get indices of surfaces with a cellZone that are closed.
219  (
220  const PtrList<surfaceZonesInfo>& surfList,
221  const searchableSurfaces& allGeometry,
222  const labelList& surfaces
223  );
224 
225  //- Get indices of surfaces with a cellZone that have 'insidePoint'
226  // section.
228  (
229  const PtrList<surfaceZonesInfo>& surfList
230  );
231 
232  static label addCellZone
233  (
234  const word& name,
235  const labelList& addressing,
236  polyMesh& mesh
237  );
238 
240  (
241  const PtrList<surfaceZonesInfo>& surfList,
242  const labelList& namedSurfaces,
243  polyMesh& mesh
244  );
245 
246  static label addFaceZone
247  (
248  const word& name,
249  const labelList& addressing,
250  const boolList& flipMap,
251  polyMesh& mesh
252  );
253 
255  (
256  const PtrList<surfaceZonesInfo>& surfList,
257  const labelList& namedSurfaces,
258  polyMesh& mesh
259  );
260 };
261 
262 
263 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 
265 } // End namespace Foam
266 
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268 
269 #endif
270 
271 // ************************************************************************* //
Foam::surfaceZonesInfo::areaSelectionAlgoNames
static const NamedEnum< areaSelectionAlgo, 4 > areaSelectionAlgoNames
Definition: surfaceZonesInfo.H:70
Foam::surfaceZonesInfo::faceZoneType
faceZoneType
What to do with faceZone faces.
Definition: surfaceZonesInfo.H:73
boolList.H
Foam::surfaceZonesInfo::surfaceZonesInfo
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict)
Construct from surfaces and dictionary.
Definition: surfaceZonesInfo.C:74
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::surfaceZonesInfo::faceType
const faceZoneType & faceType() const
How to handle face of surfaces with a faceZone.
Definition: surfaceZonesInfo.H:173
Foam::surfaceZonesInfo::getInsidePointNamedSurfaces
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have 'insidePoint'.
Definition: surfaceZonesInfo.C:343
Foam::surfaceZonesInfo::faceType_
faceZoneType faceType_
Per 'interface' surface :
Definition: surfaceZonesInfo.H:103
point.H
NamedEnum.H
Foam::surfaceZonesInfo::getNamedSurfaces
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
Definition: surfaceZonesInfo.C:205
Foam::surfaceZonesInfo::clone
autoPtr< surfaceZonesInfo > clone() const
Return clone.
Definition: surfaceZonesInfo.H:137
Foam::surfaceZonesInfo::INSIDE
@ INSIDE
Definition: surfaceZonesInfo.H:64
Foam::surfaceZonesInfo::getAllClosedNamedSurfaces
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
Definition: surfaceZonesInfo.C:315
Foam::surfaceZonesInfo::addFaceZonesToMesh
static labelList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
Definition: surfaceZonesInfo.C:485
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::surfaceZonesInfo::getStandaloneNamedSurfaces
static labelList getStandaloneNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces without a cellZone.
Definition: surfaceZonesInfo.C:230
Foam::surfaceZonesInfo::operator=
void operator=(const surfaceZonesInfo &)
Disallow default bitwise assignment.
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::surfaceZonesInfo::BOUNDARY
@ BOUNDARY
Definition: surfaceZonesInfo.H:77
labelList.H
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:66
Foam::surfaceZonesInfo::areaSelectionAlgo
areaSelectionAlgo
Types of selection of area.
Definition: surfaceZonesInfo.H:62
Foam::surfaceZonesInfo::OUTSIDE
@ OUTSIDE
Definition: surfaceZonesInfo.H:65
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::surfaceZonesInfo
Definition: surfaceZonesInfo.H:57
Foam::surfaceZonesInfo::faceZoneName_
word faceZoneName_
Per 'interface' surface : name of faceZone to put faces into.
Definition: surfaceZonesInfo.H:88
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::surfaceZonesInfo::INSIDEPOINT
@ INSIDEPOINT
Definition: surfaceZonesInfo.H:66
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::surfaceZonesInfo::faceZoneTypeNames
static const NamedEnum< faceZoneType, 3 > faceZoneTypeNames
Definition: surfaceZonesInfo.H:80
Foam::surfaceZonesInfo::getClosedNamedSurfaces
static labelList getClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed and.
Definition: surfaceZonesInfo.C:256
Foam::surfaceZonesInfo::getUnclosedNamedSurfaces
static labelList getUnclosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are unclosed.
Definition: surfaceZonesInfo.C:288
Foam::surfaceZonesInfo::getUnnamedSurfaces
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
Definition: surfaceZonesInfo.C:184
Foam::surfaceZonesInfo::zoneInside_
areaSelectionAlgo zoneInside_
Per 'interface' surface : (only used if surface is closed)
Definition: surfaceZonesInfo.H:96
Foam::surfaceZonesInfo::BAFFLE
@ BAFFLE
Definition: surfaceZonesInfo.H:76
Foam::surfaceZonesInfo::faceZoneName
const word & faceZoneName() const
Per 'interface' surface : empty or name of faceZone to put.
Definition: surfaceZonesInfo.H:149
Foam::surfaceZonesInfo::zoneInside
const areaSelectionAlgo & zoneInside() const
Definition: surfaceZonesInfo.H:161
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::surfaceZonesInfo::zoneInsidePoint
const point & zoneInsidePoint() const
Get specified inside locations for surfaces with a cellZone.
Definition: surfaceZonesInfo.H:167
Foam::surfaceZonesInfo::NONE
@ NONE
Definition: surfaceZonesInfo.H:67
Foam::searchableSurfaces
Container for searchableSurfaces.
Definition: searchableSurfaces.H:53
Foam::surface
Definition: surface.H:55
Foam::surfaceZonesInfo::zoneInsidePoint_
point zoneInsidePoint_
If zoneInside=location gives the corresponding inside point.
Definition: surfaceZonesInfo.H:99
PtrList.H
Foam::surfaceZonesInfo::cellZoneName_
word cellZoneName_
Per 'interface' surface : name of cellZone to put cells into.
Definition: surfaceZonesInfo.H:91
word.H
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::NamedEnum< areaSelectionAlgo, 4 >
Foam::surfaceZonesInfo::cellZoneName
const word & cellZoneName() const
Per 'interface' surface : empty or name of cellZone to put.
Definition: surfaceZonesInfo.H:156
Foam::surfaceZonesInfo::addCellZone
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)
Definition: surfaceZonesInfo.C:369
Foam::surfaceZonesInfo::addCellZonesToMesh
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
Definition: surfaceZonesInfo.C:400
Foam::surfaceZonesInfo::addFaceZone
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)
Definition: surfaceZonesInfo.C:452
Foam::surfaceZonesInfo::INTERNAL
@ INTERNAL
Definition: surfaceZonesInfo.H:75