41Foam::label Foam::walkPatch::getNeighbour
58 const edge&
e = edges[fEdges[fp]];
60 if ((
e[0] == v0 &&
e[1] == v1) || (
e[0] == v1 &&
e[1] == v0))
63 nbrEdgeI = fEdges[fp];
70 label edgeI = fEdges[i];
72 const edge&
e = edges[edgeI];
76 (
e[0] == v0 &&
e[1] == v1)
77 || (
e[0] == v1 &&
e[1] == v0)
92 <<
"Did not find edge on face " << facei <<
" that uses vertices"
99 const labelList& eFaces = pp_.edgeFaces()[nbrEdgeI];
101 if (eFaces.size() == 1)
105 else if (eFaces.size() == 2)
107 label nbrFacei = eFaces[0];
109 if (nbrFacei == facei)
111 nbrFacei = eFaces[1];
119 <<
"Illegal surface on patch. Face " << facei
120 <<
" at vertices " << v0 <<
',' << v1
121 <<
" has fewer than 1 or more than 2 neighbours"
128void Foam::walkPatch::faceToFace
137 nbrFaces.setSize(pp_.size());
138 nbrEnterVerts.setSize(pp_.size());
143 label facei = changedFaces[i];
144 label enterVertI = enterVerts[i];
146 if (!visited_[facei])
149 visited_[facei] =
true;
150 visitOrder_.append(facei);
152 const face&
f = pp_.localFaces()[facei];
154 label fp =
f.
find(enterVertI);
156 indexInFace_.append(fp);
162 label nbr = getNeighbour(facei, fp,
f[fp],
f[fp1]);
168 && faceZone_[nbr] == faceZone_[facei]
171 nbrFaces[changedI] = nbr;
172 nbrEnterVerts[changedI] =
f[fp];
181 nbrFaces.setSize(changedI);
182 nbrEnterVerts.setSize(changedI);
188Foam::walkPatch::walkPatch
194 const label enterVertI,
202 visitOrder_(
pp.size()),
203 indexInFace_(
pp.size())
225 if (nbrFaces.
empty())
230 changedFaces = nbrFaces;
231 enterVerts = nbrEnterVerts;
Various functions to operate on Lists.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
DynamicList< T, SizeMin > & shrink()
Calls shrink_to_fit() and returns a reference to the DynamicList.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelListList & faceEdges() const
Return face-edge addressing.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
label rcIndex(const label i) const noexcept
The reverse circular index. The previous index in the list which returns to the last at the beginning...
label find(const T &val) const
Find index of the first occurrence of the value.
label fcIndex(const label i) const noexcept
The forward circular index. The next index in the list which returns to the first at the end of the l...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A topoSetFaceSource to select faces based on usage in another faceSet.
A subset of mesh faces organised as a primitive patch.
A face is a list of labels corresponding to mesh vertices.
Collection of static functions to do various simple patch related things.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< edge > edgeList
List of edge.
List< label > labelList
A List of labels.
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field.
errorManip< error > abort(error &err)
List< bool > boolList
A List of bools.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define forAll(list, i)
Loop across all elements in list.