walkPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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::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
64  boolList& visited_;
65 
66 
67  // Faces visited
68  DynamicList<label> visitOrder_;
69 
70  // Index in face of vertex it was visited through
71  DynamicList<label> indexInFace_;
72 
73 
74  // Private Member Functions
75 
76  //- Get other face using v0, v1. Returns -1 if none.
77  label getNeighbour
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 public:
98 
99  ClassName("walkPatch");
100 
101 
102  // Constructors
103 
104  //- Construct from components
105  walkPatch
106  (
107  const primitivePatch& pp,
108  const labelList& faceZone, // Per face which zone it belongs to
109  const bool reverse, // Reverse walk
110  const label facei, // Current face
111  const label enterVertI, // Vertex across which this face
112  // is visited.
113  boolList& visited
114  );
115 
116  //- Disallow default bitwise copy construction
117  walkPatch(const walkPatch&) = delete;
118 
119 
120  // Member Functions
122  const DynamicList<label>& visitOrder() const
123  {
124  return visitOrder_;
125  }
127  const DynamicList<label>& indexInFace() const
128  {
129  return indexInFace_;
130  }
131 
132 
133  // Member Operators
134 
135  //- Disallow default bitwise assignment
136  void operator=(const walkPatch&) = delete;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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("walkPatch")
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
A topoSetSource to select faces based on usage in another faceSet.
Definition: faceToFace.H:48
walkPatch(const primitivePatch &pp, const labelList &faceZone, const bool reverse, const label facei, const label enterVertI, boolList &visited)
Construct from components.
Definition: walkPatch.C:187
const DynamicList< label > & indexInFace() const
Definition: walkPatch.H:126
A list of faces which address into the list of points.
const DynamicList< label > & visitOrder() const
Definition: walkPatch.H:121
void operator=(const walkPatch &)=delete
Disallow default bitwise assignment.
void reverse(UList< T > &, const label n)
Definition: UListI.H:334
Collection of static functions to do various simple patch related things.
Definition: walkPatch.H:49
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:64
Namespace for OpenFOAM.