57 if (!faceSizeMatch(faces, myFaces))
63 label numVert = calcLocalFaces(faces, myFaces);
65 if (numVert != vertPerCell)
71 calcEdgeAddressing(numVert);
77 vertLabels_.setSize(vertPerCell);
78 faceLabels_.setSize(facePerCell);
88 if (faceSize_[facei] == 3)
95 const face& face0 = localFaces_[face0I];
98 for (label face0vert0 = 0; face0vert0 < faceSize_[face0I]; face0vert0++)
105 vertLabels_[0] = pointMap_[face0[face0vert0]];
106 faceLabels_[0] = faceMap_[face0I];
117 !(owner[faceMap_[face0I]] == celli)
119 vertLabels_[1] = pointMap_[face0[face0vert1]];
133 const face& face4 = localFaces_[face4I];
139 if (faceSize_[face4I] != 4)
152 faceLabels_[4] = faceMap_[face4I];
155 label face4vert0 = pointFaceIndex_[face0[face0vert0]][face4I];
167 !(owner[faceMap_[face4I]] == celli)
169 vertLabels_[3] = pointMap_[face4[face4vert3]];
184 const face& face2 = localFaces_[face2I];
190 if (faceSize_[face2I] != 3)
196 faceLabels_[2] = faceMap_[face2I];
207 label face2vert3 = pointFaceIndex_[face4[face4vert3]][face2I];
215 (owner[faceMap_[face2I]] == celli)
217 vertLabels_[6] = pointMap_[face2[face2vert6]];
228 faceLabels_[1] = faceMap_[face1I];
229 const face& face1 = localFaces_[face1I];
235 label face1vert6 = pointFaceIndex_[face2[face2vert6]][face1I];
243 !(owner[faceMap_[face1I]] == celli)
245 vertLabels_[5] = pointMap_[face1[face1vert5]];
253 !(owner[faceMap_[face1I]] == celli)
255 vertLabels_[4] = pointMap_[face1[face1vert4]];
263 !(owner[faceMap_[face0I]] == celli)
265 vertLabels_[2] = pointMap_[face0[face0vert2]];
279 faceLabels_[3] = faceMap_[face3I];
296 faceLabels_[5] = faceMap_[face5I];
323 if (myFaces.
size() != 6)
331 for (
const label facei : myFaces)
333 const label size = faces[facei].
size();
349 return (nTris == 2 && nQuads == 4);
399 shape.
reset(model(), vertLabels());
Various functions to operate on Lists.
void size(const label n)
Older name for setAddressableSize.
const cellModel & model() const
labelListList pointFaceIndex_
pointFaceIndex[localVertI][localFacei] is index in localFace
labelList faceMap_
Map from local to mesh face numbering.
label calcLocalFaces(const faceList &faces, const labelList &myFaces)
Calculates localFaces. Returns number of local vertices (or -1.
labelList pointMap_
Map from local to mesh vertex numbering.
labelList faceLabels_
After matching: holds mesh faces in cellmodel order.
static label nextVert(const label, const label, const bool)
Step along face either in righthand or lefthand direction.
labelList vertLabels_
After matching: holds mesh vertices in cellmodel order.
const labelList & vertLabels() const
labelList faceSize_
Number of vertices per face in localFaces_.
label otherFace(const label numVert, const label v0, const label v1, const label localFacei) const
Given start,end of edge lookup both faces sharing it and return.
void calcEdgeAddressing(const label numVert)
Fill edge (start, end) to face number.
faceList localFaces_
Faces using local vertex numbering.
cellMatcher(const cellMatcher &)=delete
No copy construct.
void calcPointFaceIndex()
Fill vertex/face to index in face data structure.
An analytical geometric cellShape.
void reset(const cellModel &model, const labelUList &labels, const bool doCollapse=false)
Reset from components.
A face is a list of labels corresponding to mesh vertices.
virtual const faceList & faces() const
Return raw faces.
Cell-face mesh analysis engine.
virtual bool faceSizeMatch(const faceList &, const labelList &) const
Check whether number of face sizes match the shape.
virtual bool matchShape(const bool checkOnly, const faceList &faces, const labelList &faceOwner, const label celli, const labelList &myFaces)
Low level shape recognition. Return true if matches.
virtual bool matches(const primitiveMesh &mesh, const label celli, cellShape &shape)
Like isA but also constructs a cellShape (if shape matches).
virtual bool isA(const primitiveMesh &mesh, const label celli)
Exact match. Uses faceSizeMatch.
virtual label faceHashValue() const
Hash value of all face sizes of this shape. Can be used for.
wedgeMatcher()
Default construct.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
static constexpr const zero Zero
Global zero (0).
#define forAll(list, i)
Loop across all elements in list.