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) 2013-2016 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  // Private Member Functions
107 
108  //- Disallow default bitwise assignment
109  void operator=(const surfaceZonesInfo&);
110 
111 
112 public:
113 
114  // Constructors
115 
116  //- Construct from surfaces and dictionary
118  (
119  const searchableSurface& surface,
120  const dictionary& surfacesDict
121  );
122 
123  //- Construct from components
125  (
126  const word& faceZoneNames,
127  const word& cellZoneNames,
129  const point& zoneInsidePoints,
130  const faceZoneType& faceType
131  );
132 
133  //- Copy constructor
135 
136  //- Return clone
138  {
139  return autoPtr<surfaceZonesInfo>(new surfaceZonesInfo(*this));
140  }
141 
142 
143  // Member Functions
144 
145  // Access
146 
147  //- Per 'interface' surface : empty or name of faceZone to put
148  // faces into
149  const word& faceZoneName() const
150  {
151  return faceZoneName_;
152  }
153 
154  //- Per 'interface' surface : empty or name of cellZone to put
155  // cells into
156  const word& cellZoneName() const
157  {
158  return cellZoneName_;
159  }
161  const areaSelectionAlgo& zoneInside() const
162  {
163  return zoneInside_;
164  }
165 
166  //- Get specified inside locations for surfaces with a cellZone
167  const point& zoneInsidePoint() const
168  {
169  return zoneInsidePoint_;
170  }
171 
172  //- How to handle face of surfaces with a faceZone
173  const faceZoneType& faceType() const
174  {
175  return faceType_;
176  }
177 
178 
179  // Query
180 
181  //- Get indices of unnamed surfaces (surfaces without faceZoneName)
183  (
184  const PtrList<surfaceZonesInfo>& surfList
185  );
186 
187  //- Get indices of named surfaces (surfaces with faceZoneName)
189  (
190  const PtrList<surfaceZonesInfo>& surfList
191  );
192 
193  //- Get indices of surfaces with a cellZone that are closed and
194  // have 'inside' or 'outside' selection.
196  (
197  const PtrList<surfaceZonesInfo>& surfList,
198  const searchableSurfaces& allGeometry,
199  const labelList& surfaces
200  );
201 
202  //- Get indices of surfaces with a cellZone that are unclosed
204  (
205  const PtrList<surfaceZonesInfo>& surfList,
206  const searchableSurfaces& allGeometry,
207  const labelList& surfaces
208  );
209 
210  //- Get indices of surfaces with a cellZone that are closed.
212  (
213  const PtrList<surfaceZonesInfo>& surfList,
214  const searchableSurfaces& allGeometry,
215  const labelList& surfaces
216  );
217 
218  //- Get indices of surfaces with a cellZone that have 'insidePoint'
219  // section.
221  (
222  const PtrList<surfaceZonesInfo>& surfList
223  );
224 
226  (
227  const PtrList<surfaceZonesInfo>& surfList,
228  const labelList& namedSurfaces,
229  polyMesh& mesh
230  );
231 
233  (
234  const PtrList<surfaceZonesInfo>& surfList,
235  const labelList& namedSurfaces,
236  polyMesh& mesh
237  );
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace Foam
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
static const NamedEnum< faceZoneType, 3 > faceZoneTypeNames
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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
A class for handling words, derived from string.
Definition: word.H:59
Container for searchableSurfaces.
const faceZoneType & faceType() const
How to handle face of surfaces with a faceZone.
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.
const word & cellZoneName() const
Per &#39;interface&#39; surface : empty or name of cellZone to put.
const word & faceZoneName() const
Per &#39;interface&#39; surface : empty or name of faceZone to put.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:62
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:53
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
surfaceZonesInfo(const searchableSurface &surface, const dictionary &surfacesDict)
Construct from surfaces and dictionary.
const areaSelectionAlgo & zoneInside() const
areaSelectionAlgo
Types of selection of area.
Namespace for OpenFOAM.