initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / primitiveMesh / primitivePatch / patchZones.H
blob785ca0a3e8c8170f220748a2bb58148bb828b18f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::patchZones
28 Description
29     Calculates zone number for every face of patch.
31     Gets constructed from patch and is a labeList with zone number for
32     every patch face.
34 SourceFiles
35     patchZones.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef patchZones_H
40 #define patchZones_H
42 #include "labelList.H"
43 #include "pointField.H"
44 #include "polyPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                            Class patchZones Declaration
53 \*---------------------------------------------------------------------------*/
55 class patchZones
57     public labelList
59     // Private data
61         //- Reference to patch
62         const primitivePatch& pp_;
64         //- Reference to protected edges
65         const boolList& borderEdge_;
67         //- Max number of zones
68         label nZones_;
71     // Private Member Functions
73         //- Gets labels of changed faces and propagates them to the edges.
74         //  Returns labels of edges changed. Does not cross edges marked in
75         //  regionEdge
76         labelList faceToEdge
77         (
78             const labelList& changedFaces,
79             labelList& edgeRegion
80         );
82         //- Reverse of faceToEdge: gets edges and returns faces
83         labelList edgeToFace(const labelList& changedEdges);
85         //- Fill *this with current zone for every face reachable
86         //  from faceI without crossing edge marked in borderEdge.
87         void markZone(label faceI);
89 public:
91     ClassName("patchZones");
94     // Constructors
96         //- Fills *this with zone of face. Zone is area
97         //  reachable by edge crossing without crossing borderEdge
98         //  (bool for every edge in patch).
99         patchZones(const primitivePatch& pp, const boolList& borderEdge);
102     // Member Functions
104         //- Number of zones
105         label nZones() const
106         {
107             return nZones_;
108         }
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 } // End namespace Foam
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 #endif
121 // ************************************************************************* //