regionSide.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) 2011-2020 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::regionSide
26 
27 Description
28  Determines the 'side' for every face and connected to a
29  singly-connected (through edges) region of faces. Gets set of faces and
30  a list of mesh edges ('fenceEdges') which should not be crossed.
31  Used in splitting a mesh region.
32 
33  Determines:
34  - For every face on the surface: whether the owner was visited
35  from starting face.
36  - List of faces using an internal point of the region visitable by
37  edge-face-edge walking from the correct side of the region.
38 
39 SourceFiles
40  regionSide.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef regionSide_H
45 #define regionSide_H
46 
47 #include "HashSet.H"
48 #include "typeInfo.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward declaration of classes
56 class primitiveMesh;
57 
58 /*---------------------------------------------------------------------------*\
59  Class regionSide Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class regionSide
63 {
64  // Private Data
65 
66  //- For every face on region tells whether the owner is on the
67  // 'regionside'.
68  labelHashSet sideOwner_;
69 
70  //- Contains the faces using an internal point and visited face
71  labelHashSet insidePointFaces_;
72 
73 
74  // Private Member Functions
75 
76  //- Step across point to other edge on face
77  static label otherEdge
78  (
79  const primitiveMesh& mesh,
80  const label facei,
81  const label edgeI,
82  const label pointi
83  );
84 
85  //- From facei, side celli, cross to other faces/cells by
86  // face-cell walking and store visited faces and update sideOwner_.
87  void visitConnectedFaces
88  (
89  const primitiveMesh& mesh,
90  const labelHashSet& region,
91  const labelHashSet& fenceEdges,
92  const label celli,
93  const label facei,
94  labelHashSet& visitedFace
95  );
96 
97  //- From edge on face connected to point on region (regionPointi) cross
98  // to all other edges using this point by walking across faces
99  // Does not cross regionEdges so stays on one side of region
100  void walkPointConnectedFaces
101  (
102  const primitiveMesh& mesh,
103  const labelHashSet& regionEdges,
104  const label regionPointi,
105  const label startFacei,
106  const label startEdgeI,
107  labelHashSet& visitedEdges
108  );
109 
110  //- Visits all internal points on region and marks edges reachable
111  // from sideOwner side (using walkPointConnectedFaces)
112  void walkAllPointConnectedFaces
113  (
114  const primitiveMesh& mesh,
115  const labelHashSet& regionFaces,
116  const labelHashSet& fenceEdges
117  );
118 
119 public:
120 
121  //- Runtime type information
122  ClassName("regionSide");
123 
124  // Static Functions
125 
126  //- Step across edge onto other face on cell
127  static label otherFace
128  (
129  const primitiveMesh& mesh,
130  const label celli,
131  const label excludeFacei,
132  const label edgeI
133  );
134 
135 
136  // Constructors
137 
138  //- Construct from components
139  regionSide
140  (
141  const primitiveMesh& mesh,
142  const labelHashSet& region,
143  const labelHashSet& fenceEdges, // labels of fence edges
144  const label startCell,
145  const label startFace
146  );
147 
148 
149  // Member Functions
150 
151  // Access
153  const labelHashSet& sideOwner() const
154  {
155  return sideOwner_;
156  }
158  const labelHashSet& insidePointFaces() const
159  {
160  return insidePointFaces_;
161  }
162 
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
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
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
static label otherFace(const primitiveMesh &mesh, const label celli, const label excludeFacei, const label edgeI)
Step across edge onto other face on cell.
const labelHashSet & insidePointFaces() const
Definition: regionSide.H:157
Determines the &#39;side&#39; for every face and connected to a singly-connected (through edges) region of fa...
Definition: regionSide.H:61
dynamicFvMesh & mesh
const labelHashSet & sideOwner() const
Definition: regionSide.H:152
regionSide(const primitiveMesh &mesh, const labelHashSet &region, const labelHashSet &fenceEdges, const label startCell, const label startFace)
Construct from components.
ClassName("regionSide")
Runtime type information.
Namespace for OpenFOAM.