1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
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.
34 - For every face on the surface: whether the owner was visited
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.
42 \*---------------------------------------------------------------------------*/
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
58 /*---------------------------------------------------------------------------*\
59 Class regionSide Declaration
60 \*---------------------------------------------------------------------------*/
66 //- For every face on region tells whether the owner is on the
68 labelHashSet sideOwner_;
70 //- Contains the faces using an internal point and visited face
71 labelHashSet insidePointFaces_;
74 // Private Member Functions
76 //- Step across point to other edge on face
77 static label otherEdge
79 const primitiveMesh& mesh,
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
89 const primitiveMesh& mesh,
90 const labelHashSet& region,
91 const labelHashSet& fenceEdges,
94 labelHashSet& visitedFace
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
102 const primitiveMesh& mesh,
103 const labelHashSet& regionEdges,
104 const label regionPointI,
105 const label startFaceI,
106 const label startEdgeI,
107 labelHashSet& visitedEdges
110 //- Visits all internal points on region and marks edges reachable
111 // from sideOwner side (using walkPointConnectedFaces)
112 void walkAllPointConnectedFaces
114 const primitiveMesh& mesh,
115 const labelHashSet& regionFaces,
116 const labelHashSet& fenceEdges
121 //- Runtime type information
122 ClassName("regionSide");
126 //- Step across edge onto other face on cell
127 static label otherFace
129 const primitiveMesh& mesh,
131 const label excludeFaceI,
138 //- Construct from components
141 const primitiveMesh& mesh,
142 const labelHashSet& region,
143 const labelHashSet& fenceEdges, // labels of fence edges
144 const label startCell,
145 const label startFace
153 const labelHashSet& sideOwner() const
158 const labelHashSet& insidePointFaces() const
160 return insidePointFaces_;
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 // ************************************************************************* //