1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Determines the 'side' for every face and connected to a
30 singly-connected (through edges) region of faces. Gets set of faces and
31 a list of mesh edges ('fenceEdges') which should not be crossed.
32 Used in splitting a mesh region.
35 - For every face on the surface: whether the owner was visited
37 - List of faces using an internal point of the region visitable by
38 edge-face-edge walking from the correct side of the region.
43 \*---------------------------------------------------------------------------*/
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Forward declaration of classes
59 /*---------------------------------------------------------------------------*\
60 Class regionSide Declaration
61 \*---------------------------------------------------------------------------*/
67 //- For every face on region tells whether the owner is on the
69 labelHashSet sideOwner_;
71 //- Contains the faces using an internal point and visited face
72 labelHashSet insidePointFaces_;
75 // Private Member Functions
77 //- Step across point to other edge on face
78 static label otherEdge
80 const primitiveMesh& mesh,
86 //- From faceI, side cellI, cross to other faces/cells by
87 // face-cell walking and store visited faces and update sideOwner_.
88 void visitConnectedFaces
90 const primitiveMesh& mesh,
91 const labelHashSet& region,
92 const labelHashSet& fenceEdges,
95 labelHashSet& visitedFace
98 //- From edge on face connected to point on region (regionPointI) cross
99 // to all other edges using this point by walking across faces
100 // Does not cross regionEdges so stays on one side of region
101 void walkPointConnectedFaces
103 const primitiveMesh& mesh,
104 const labelHashSet& regionEdges,
105 const label regionPointI,
106 const label startFaceI,
107 const label startEdgeI,
108 labelHashSet& visitedEdges
111 //- Visits all internal points on region and marks edges reachable
112 // from sideOwner side (using walkPointConnectedFaces)
113 void walkAllPointConnectedFaces
115 const primitiveMesh& mesh,
116 const labelHashSet& regionFaces,
117 const labelHashSet& fenceEdges
122 //- Runtime type information
123 ClassName("regionSide");
127 //- Step across edge onto other face on cell
128 static label otherFace
130 const primitiveMesh& mesh,
132 const label excludeFaceI,
139 //- Construct from components
142 const primitiveMesh& mesh,
143 const labelHashSet& region,
144 const labelHashSet& fenceEdges, // labels of fence edges
145 const label startCell,
146 const label startFace
154 const labelHashSet& sideOwner() const
159 const labelHashSet& insidePointFaces() const
161 return insidePointFaces_;
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 // ************************************************************************* //