walkPatch.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::walkPatch
26 
27 Description
28  Collection of static functions to do various simple patch related things.
29 
30 SourceFiles
31  walkPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef walkPatch_H
36 #define walkPatch_H
37 
38 #include "labelList.H"
39 #include "primitivePatch.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class walkPatch Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class walkPatch
51 {
52  // Private data
53 
54  //- Reference to patch to walk on
55  const primitivePatch& pp_;
56 
57  //- Reference to zones
58  const labelList& faceZone_;
59 
60  //- How to walk through faces
61  const bool reverse_;
62 
63  //- Reference to list to mark off visited faces
65 
66 
67  // Faces visited
68  dynamicLabelList visitOrder_;
69 
70  // Index in face of vertex it was visited through
71  dynamicLabelList indexInFace_;
72 
73 
74  // Private Member Functions
75 
76  //- Get other face using v0, v1. Returns -1 if none.
78  (
79  const label faceI,
80  const label fp,
81  const label v0,
82  const label v1
83  ) const;
84 
85  //- Gets labels of changed faces and enterVertices on faces.
86  // Returns labels of faces changed and enterVertices on them.
87  void faceToFace
88  (
89  const labelList& changedFaces,
90  const labelList& enterVerts,
91 
92  labelList& nbrFaces,
93  labelList& nbrEnterVerts
94  );
95 
96 
97  //- Disallow default bitwise copy construct
98  walkPatch(const walkPatch&);
99 
100  //- Disallow default bitwise assignment
101  void operator=(const walkPatch&);
102 
103 public:
104 
105  ClassName("walkPatch");
106 
107 
108  // Constructors
109 
110  //- Construct from components
111  walkPatch
112  (
113  const primitivePatch& pp,
114  const labelList& faceZone, // Per face which zone it belongs to
115  const bool reverse, // Reverse walk
116  const label faceI, // Current face
117  const label enterVertI, // Vertex across which this face
118  // is visited.
119  boolList& visited
120  );
121 
122 
123  // Member Functions
124 
125  const dynamicLabelList& visitOrder() const
126  {
127  return visitOrder_;
128  }
129 
130  const dynamicLabelList& indexInFace() const
131  {
132  return indexInFace_;
133  }
134 
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Foam::walkPatch::pp_
const primitivePatch & pp_
Reference to patch to walk on.
Definition: walkPatch.H:54
Foam::walkPatch::visitOrder
const dynamicLabelList & visitOrder() const
Definition: walkPatch.H:124
Foam::walkPatch::walkPatch
walkPatch(const walkPatch &)
Disallow default bitwise copy construct.
Foam::walkPatch::visited_
boolList & visited_
Reference to list to mark off visited faces.
Definition: walkPatch.H:63
Foam::walkPatch::faceToFace
void faceToFace(const labelList &changedFaces, const labelList &enterVerts, labelList &nbrFaces, labelList &nbrEnterVerts)
Gets labels of changed faces and enterVertices on faces.
Definition: walkPatch.C:128
Foam::walkPatch::faceZone_
const labelList & faceZone_
Reference to zones.
Definition: walkPatch.H:57
Foam::walkPatch::ClassName
ClassName("walkPatch")
Foam::walkPatch::operator=
void operator=(const walkPatch &)
Disallow default bitwise assignment.
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::faceZone
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:64
Foam::walkPatch::visitOrder_
dynamicLabelList visitOrder_
Definition: walkPatch.H:67
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::walkPatch::reverse_
const bool reverse_
How to walk through faces.
Definition: walkPatch.H:60
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::walkPatch::getNeighbour
label getNeighbour(const label faceI, const label fp, const label v0, const label v1) const
Get other face using v0, v1. Returns -1 if none.
Definition: walkPatch.C:39
primitivePatch.H
Foam::walkPatch
Collection of static functions to do various simple patch related things.
Definition: walkPatch.H:49
Foam::walkPatch::indexInFace_
dynamicLabelList indexInFace_
Definition: walkPatch.H:70
Foam::walkPatch::indexInFace
const dynamicLabelList & indexInFace() const
Definition: walkPatch.H:129
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88
Foam::reverse
void reverse(UList< T > &, const label n)
Definition: UListI.H:322