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 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
65 
66 
67  // Faces visited
69 
70  // Index in face of vertex it was visited through
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 DynamicList<label>& visitOrder() const
126  {
127  return visitOrder_;
128  }
129 
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 // ************************************************************************* //
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::labelList
List< label > labelList
A List of labels.
Definition: labelList.H:56
Foam::walkPatch::walkPatch
walkPatch(const walkPatch &)
Disallow default bitwise copy construct.
Foam::DynamicList< label >
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::primitivePatch
PrimitivePatch< face, SubList, const pointField & > primitivePatch
Foam::primitivePatch.
Definition: primitivePatch.H:45
Foam::walkPatch::faceZone_
const labelList & faceZone_
Reference to zones.
Definition: walkPatch.H:57
Foam::walkPatch::visitOrder
const DynamicList< label > & visitOrder() const
Definition: walkPatch.H:124
Foam::walkPatch::ClassName
ClassName("walkPatch")
Foam::walkPatch::operator=
void operator=(const walkPatch &)
Disallow default bitwise assignment.
primitivePatch.H
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::indexInFace
const DynamicList< label > & indexInFace() const
Definition: walkPatch.H:129
Foam::walkPatch::indexInFace_
DynamicList< label > indexInFace_
Definition: walkPatch.H:70
Foam::walkPatch::visitOrder_
dynamicLabelList visitOrder_
Definition: walkPatch.H:67
Foam::walkPatch::visitOrder_
DynamicList< label > visitOrder_
Definition: walkPatch.H:67
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::boolList
List< bool > boolList
Bool container classes.
Definition: boolList.H:50
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
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