patchZones.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-2016 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::patchZones
26 
27 Description
28  Calculates zone number for every face of patch.
29 
30  Gets constructed from patch and is a labeList with zone number for
31  every patch face.
32 
33 SourceFiles
34  patchZones.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef patchZones_H
39 #define patchZones_H
40 
41 #include "labelList.H"
42 #include "pointField.H"
43 #include "polyPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class patchZones Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class patchZones
55 :
56  public labelList
57 {
58  // Private data
59 
60  //- Reference to patch
61  const primitivePatch& pp_;
62 
63  //- Reference to protected edges
64  const boolList& borderEdge_;
65 
66  //- Max number of zones
67  label nZones_;
68 
69 
70  // Private Member Functions
71 
72  //- Gets labels of changed faces and propagates them to the edges.
73  // Returns labels of edges changed. Does not cross edges marked in
74  // regionEdge
75  labelList faceToEdge
76  (
77  const labelList& changedFaces,
78  labelList& edgeRegion
79  );
80 
81  //- Reverse of faceToEdge: gets edges and returns faces
82  labelList edgeToFace(const labelList& changedEdges);
83 
84  //- Fill *this with current zone for every face reachable
85  // from facei without crossing edge marked in borderEdge.
86  void markZone(label facei);
87 
88 public:
89 
90  ClassName("patchZones");
91 
92 
93  // Constructors
94 
95  //- Fills *this with zone of face. Zone is area
96  // reachable by edge crossing without crossing borderEdge
97  // (bool for every edge in patch).
98  patchZones(const primitivePatch& pp, const boolList& borderEdge);
99 
100 
101  // Member Functions
102 
103  //- Number of zones
104  label nZones() const
105  {
106  return nZones_;
107  }
108 
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
Calculates zone number for every face of patch.
Definition: patchZones.H:53
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
ClassName("patchZones")
A list of faces which address into the list of points.
patchZones(const primitivePatch &pp, const boolList &borderEdge)
Fills *this with zone of face. Zone is area.
Definition: patchZones.C:148
label nZones() const
Number of zones.
Definition: patchZones.H:103
Namespace for OpenFOAM.