surfaceZonesInfo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
6  \\/ M anipulation |
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 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class searchableSurface;
49 class searchableSurfaces;
50 class polyMesh;
51 class dictionary;
52 
53 /*---------------------------------------------------------------------------*\
54  Class surfaceZonesInfo Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class surfaceZonesInfo
58 {
59 public:
60 
61  //- Types of selection of area
63  {
67  NONE
68  };
69 
71 
72  //- What to do with faceZone faces
73  enum faceZoneType
74  {
77  BOUNDARY
78  };
79 
81 
82 
83 private:
84 
85  // Private Data
86 
87  //- Per 'interface' surface : name of faceZone to put faces into
88  word faceZoneName_;
89 
90  //- Per 'interface' surface : name of cellZone to put cells into
91  word cellZoneName_;
92 
93  //- Per 'interface' surface : (only used if surface is closed)
94  // How to select zone cells : surface inside or outside or given
95  // inside location.
96  areaSelectionAlgo zoneInside_;
97 
98  //- If zoneInside=location gives the corresponding inside point
99  point zoneInsidePoint_;
100 
101  //- Per 'interface' surface :
102  // What to do with outside
103  faceZoneType faceType_;
104 
105 
106 public:
107 
108  // Constructors
109 
110  //- Construct from surfaces and dictionary
112  (
113  const searchableSurface& surface,
114  const dictionary& surfacesDict
115  );
116 
117  //- Construct from components
119  (
120  const word& faceZoneNames,
121  const word& cellZoneNames,
123  const point& zoneInsidePoints,
124  const faceZoneType& faceType
125  );
126 
127  //- Copy constructor
129 
130  //- Return clone
132  {
133  return autoPtr<surfaceZonesInfo>(new surfaceZonesInfo(*this));
134  }
135 
136 
137  // Member Functions
138 
139  // Access
140 
141  //- Per 'interface' surface : empty or name of faceZone to put
142  // faces into
143  const word& faceZoneName() const
144  {
145  return faceZoneName_;
146  }
147 
148  //- Per 'interface' surface : empty or name of cellZone to put
149  // cells into
150  const word& cellZoneName() const
151  {
152  return cellZoneName_;
153  }
155  const areaSelectionAlgo& zoneInside() const
156  {
157  return zoneInside_;
158  }
159 
160  //- Get specified inside locations for surfaces with a cellZone
161  const point& zoneInsidePoint() const
162  {
163  return zoneInsidePoint_;
164  }
165 
166  //- How to handle face of surfaces with a faceZone
167  const faceZoneType& faceType() const
168  {
169  return faceType_;
170  }
171 
172 
173  // Query
174 
175  //- Get indices of unnamed surfaces (surfaces without faceZoneName)
177  (
178  const PtrList<surfaceZonesInfo>& surfList
179  );
180 
181  //- Get indices of named surfaces (surfaces with faceZoneName)
183  (
184  const PtrList<surfaceZonesInfo>& surfList
185  );
186 
187  //- Get indices of surfaces with a cellZone that are closed and
188  // have 'inside' or 'outside' selection.
190  (
191  const PtrList<surfaceZonesInfo>& surfList,
192  const searchableSurfaces& allGeometry,
193  const labelList& surfaces
194  );
195 
196  //- Get indices of surfaces with a cellZone that are unclosed
198  (
199  const PtrList<surfaceZonesInfo>& surfList,
200  const searchableSurfaces& allGeometry,
201  const labelList& surfaces
202  );
203 
204  //- Get indices of surfaces with a cellZone that are closed.
206  (
207  const PtrList<surfaceZonesInfo>& surfList,
208  const searchableSurfaces& allGeometry,
209  const labelList& surfaces
210  );
211 
212  //- Get indices of surfaces with a cellZone that have 'insidePoint'
213  // section.
215  (
216  const PtrList<surfaceZonesInfo>& surfList
217  );
218 
220  (
221  const PtrList<surfaceZonesInfo>& surfList,
222  const labelList& namedSurfaces,
223  polyMesh& mesh
224  );
225 
227  (
228  const PtrList<surfaceZonesInfo>& surfList,
229  const labelList& namedSurfaces,
230  polyMesh& mesh
231  );
232 
233 
234  // Member Operators
235 
236  //- Disallow default bitwise assignment
237  void operator=(const surfaceZonesInfo&) = delete;
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace Foam
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
static const NamedEnum< faceZoneType, 3 > faceZoneTypeNames
const areaSelectionAlgo & zoneInside() const
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const word & cellZoneName() const
Per &#39;interface&#39; surface : empty or name of cellZone to put.
autoPtr< surfaceZonesInfo > clone() const
Return clone.
static labelList addCellZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, polyMesh &mesh)
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
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
const faceZoneType & faceType() const
How to handle face of surfaces with a faceZone.
A class for handling words, derived from string.
Definition: word.H:59
Container for searchableSurfaces.
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 point & zoneInsidePoint() const
Get specified inside locations for surfaces with a cellZone.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
static labelList addFaceZonesToMesh(const PtrList< surfaceZonesInfo > &surfList, const labelList &namedSurfaces, 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.
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
static const NamedEnum< areaSelectionAlgo, 4 > areaSelectionAlgoNames
faceZoneType
What to do with faceZone faces.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict)
Construct from surfaces and dictionary.
const word & faceZoneName() const
Per &#39;interface&#39; surface : empty or name of faceZone to put.
areaSelectionAlgo
Types of selection of area.
void operator=(const surfaceZonesInfo &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.