regionSide.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) 2011 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'.
69 
70  //- Contains the faces using an internal point and visited face
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_.
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
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)
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
152 
153  const labelHashSet& sideOwner() const
154  {
155  return sideOwner_;
156  }
157 
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 // ************************************************************************* //
Foam::regionSide::regionSide
regionSide(const primitiveMesh &mesh, const labelHashSet &region, const labelHashSet &fenceEdges, const label startCell, const label startFace)
Construct from components.
Foam::regionSide::sideOwner
const labelHashSet & sideOwner() const
Definition: regionSide.H:152
typeInfo.H
Foam::regionSide::ClassName
ClassName("regionSide")
Runtime type information.
Foam::regionSide::otherFace
static label otherFace(const primitiveMesh &mesh, const label cellI, const label excludeFaceI, const label edgeI)
Step across edge onto other face on cell.
Foam::regionSide::visitConnectedFaces
void visitConnectedFaces(const primitiveMesh &mesh, const labelHashSet &region, const labelHashSet &fenceEdges, const label cellI, const label faceI, labelHashSet &visitedFace)
From faceI, side cellI, cross to other faces/cells by.
Foam::HashSet< label, Hash< label > >
Foam::regionSide
Determines the 'side' for every face and connected to a singly-connected (through edges) region of fa...
Definition: regionSide.H:61
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::regionSide::walkPointConnectedFaces
void walkPointConnectedFaces(const primitiveMesh &mesh, const labelHashSet &regionEdges, const label regionPointI, const label startFaceI, const label startEdgeI, labelHashSet &visitedEdges)
From edge on face connected to point on region (regionPointI) cross.
Foam::regionSide::walkAllPointConnectedFaces
void walkAllPointConnectedFaces(const primitiveMesh &mesh, const labelHashSet &regionFaces, const labelHashSet &fenceEdges)
Visits all internal points on region and marks edges reachable.
HashSet.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::regionSide::otherEdge
static label otherEdge(const primitiveMesh &mesh, const label faceI, const label edgeI, const label pointI)
Step across point to other edge on face.
Foam::regionSide::insidePointFaces_
labelHashSet insidePointFaces_
Contains the faces using an internal point and visited face.
Definition: regionSide.H:70
Foam::regionSide::insidePointFaces
const labelHashSet & insidePointFaces() const
Definition: regionSide.H:157
Foam::regionSide::sideOwner_
labelHashSet sideOwner_
For every face on region tells whether the owner is on the.
Definition: regionSide.H:67
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79