walkPatch.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::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  //- 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
125  const DynamicList<label>& visitOrder() const
126  {
127  return visitOrder_;
128  }
130  const DynamicList<label>& indexInFace() const
131  {
132  return indexInFace_;
133  }
134 
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
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 topoSetSource to select faces based on usage in another faceSet.
Definition: faceToFace.H:48
const DynamicList< label > & indexInFace() const
Definition: walkPatch.H:129
A list of faces which address into the list of points.
const DynamicList< label > & visitOrder() const
Definition: walkPatch.H:124
void reverse(UList< T > &, const label n)
Definition: UListI.H:322
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.