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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::surfaceZonesInfo
29 
30 Description
31 
32 SourceFiles
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 
49 namespace Foam
50 {
51 
52 class searchableSurface;
53 class searchableSurfaces;
54 class polyMesh;
55 class dictionary;
56 
57 /*---------------------------------------------------------------------------*\
58  Class surfaceZonesInfo Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class surfaceZonesInfo
62 {
63 public:
64 
65  //- Types of selection of area
67  {
69  OUTSIDE,
72  };
73 
75 
76  //- How to generate faceZone name
77  enum faceZoneNaming
78  {
81  REGION
82  };
83 
85 
86  //- What to do with faceZone faces
87  enum faceZoneType
88  {
89  INTERNAL,
92  };
93 
95 
96 
97 private:
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 
126 public:
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,
146  const faceZoneType& faceType
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 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  );
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  );
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,
251  polyMesh& mesh
252  );
253 
255  (
256  const PtrList<surfaceZonesInfo>& surfList,
257  const labelList& namedSurfaces,
258  polyMesh& mesh
259  );
260 
261  static label addFaceZone
262  (
263  const word& name,
264  const labelList& addressing,
265  const boolList& flipMap,
266  polyMesh& mesh
267  );
268 
270  (
271  const PtrList<surfaceZonesInfo>& surfList,
272  const labelList& namedSurfaces,
273  polyMesh& mesh
274  );
275 };
276 
277 
278 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
279 
280 } // End namespace Foam
281 
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
283 
284 #endif
285 
286 // ************************************************************************* //
static const Enum< areaSelectionAlgo > areaSelectionAlgoNames
const areaSelectionAlgo & zoneInside() const
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
static labelListList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
const word & cellZoneName() const
Per &#39;interface&#39; surface : empty or name of cellZone to put.
static const Enum< faceZoneNaming > faceZoneNamingNames
autoPtr< surfaceZonesInfo > clone() const
Return clone.
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
static const Enum< faceZoneType > faceZoneTypeNames
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
wordList regionNames
static labelList getStandaloneNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces without a cellZone.
static labelList getUnclosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are unclosed.
static labelList getAllClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed.
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:52
const faceZoneType & faceType() const
How to handle face of surfaces with a faceZone.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Container for searchableSurfaces. The collection is specified as a dictionary. For example...
static labelList getInsidePointNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of surfaces with a cellZone that have &#39;insidePoint&#39;.
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const wordList & faceZoneNames() const
Per &#39;interface&#39; surface : empty or names of faceZones to put.
const point & zoneInsidePoint() const
Get specified inside locations for surfaces with a cellZone.
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict, const wordList &regionNames)
Construct from surfaces and dictionary and fully resolved.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
faceZoneNaming
How to generate faceZone name.
static labelList getClosedNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList, const searchableSurfaces &allGeometry, const labelList &surfaces)
Get indices of surfaces with a cellZone that are closed and.
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
faceZoneType
What to do with faceZone faces.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition: autoPtr.H:178
areaSelectionAlgo
Types of selection of area.
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)
Namespace for OpenFOAM.
static label addCellZone(const word &name, const labelList &addressing, polyMesh &mesh)