patchZones.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend 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 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. 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
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 // ************************************************************************* //
polyPatch.H
Foam::patchZones::markZone
void markZone(label faceI)
Fill *this with current zone for every face reachable.
Definition: patchZones.C:106
Foam::patchZones::patchZones
patchZones(const primitivePatch &pp, const boolList &borderEdge)
Fills *this with zone of face. Zone is area.
Definition: patchZones.C:153
Foam::patchZones::pp_
const primitivePatch & pp_
Reference to patch.
Definition: patchZones.H:60
Foam::patchZones
Calculates zone number for every face of patch.
Definition: patchZones.H:53
Foam::patchZones::nZones_
label nZones_
Max number of zones.
Definition: patchZones.H:66
Foam::patchZones::nZones
label nZones() const
Number of zones.
Definition: patchZones.H:103
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
labelList.H
Foam::patchZones::ClassName
ClassName("patchZones")
Foam::patchZones::borderEdge_
const boolList & borderEdge_
Reference to protected edges.
Definition: patchZones.H:63
Foam::patchZones::faceToEdge
labelList faceToEdge(const labelList &changedFaces, labelList &edgeRegion)
Gets labels of changed faces and propagates them to the edges.
Definition: patchZones.C:41
Foam::patchZones::edgeToFace
labelList edgeToFace(const labelList &changedEdges)
Reverse of faceToEdge: gets edges and returns faces.
Definition: patchZones.C:75
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
pointField.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88