39 static inline void printFace
46 Info<<
"face " << faceI <<
':';
50 if (
f[fpI] == currEdge[0] ||
f[fpI] == currEdge[1])
71 label nFailedEdges = 0;
72 const bool fullCheck =
true;
74 Info<<
"Checking edges according to AVL/FIRE on-the-fly methodology..." 82 const face& faceA = faces[faceI];
86 const edge currEdge = faceA.
edge(edgei);
89 const labelList& otherFaceIds = pointFaces[currEdge[0]];
91 forAll(otherFaceIds, otherI)
93 const int otherFaceI = otherFaceIds[otherI];
94 const face& faceB = faces[otherFaceI];
97 if (otherFaceI <= faceI && !fullCheck)
105 int size_m1 = faceB.
size() - 1;
109 if (faceB[ptI] == currEdge[0])
114 if (faceB[ptI] == currEdge[1])
126 || abs(other_p0 - other_p1) == 1
128 || (other_p0 == 0 && other_p1 == size_m1)
129 || (other_p1 == 0 && other_p0 == size_m1)
137 if (abs(other_p0 - other_p1) == 2)
140 stray = (other_p0 + other_p1) / 2;
144 (other_p0 == 0 && other_p1+1 == size_m1)
145 || (other_p1 == 0 && other_p0+1 == size_m1)
153 strayPoints.
set(faceB[stray]);
156 failedEdges.
set(currEdge);
161 <<
"Broken edge calculated between points " 162 << currEdge[0] <<
" " << currEdge[1] <<
endl;
164 printFace(faceA, faceI, currEdge);
165 printFace(faceB, otherFaceI, currEdge);
174 Info<<
"detected " << nFailedEdges <<
" edge failures";
177 nFailedEdges = failedEdges.
size();
182 Info<<
" over " << nFailedEdges <<
" edges" <<
endl;
185 <<
"edge points" <<
nl 186 <<
"~~~~~~~~~~~" <<
endl;
188 for (
edge thisEdge : failedEdges)
190 if (thisEdge.start() > thisEdge.end())
199 const label ptI = thisEdge[keyI];
207 const label ptI = thisEdge[keyI];
215 <<
"stray points" <<
nl 216 <<
"~~~~~~~~~~~~" <<
endl;
225 const label ptI = keys[keyI];
233 const label ptI = keys[keyI];
253 const UList<point>&
points 265 for (
const face&
f : faces)
bool set(const Key &key)
Same as insert (no value to overwrite)
void size(const label n)
Older name for setAddressableSize.
A face is a list of labels corresponding to mesh vertices.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label checkFireEdges(const faceList &faces, const labelListList &pointFaces, const UList< point > &points=UList< point >::null())
check edge connectivity
List< labelList > labelListList
List of labelList.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
label size() const noexcept
The number of elements in table.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Checks the mesh for edge connectivity as expected by the AVL/FIRE on-the-fly calculations. Errors flagged here are not necessarily topological errors at all.
Foam::edge edge(const label edgei) const
Return i-th face edge (forward walk order).
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void invertManyToMany(const label len, const UList< InputIntListType > &input, List< OutputIntListType > &output)
Invert many-to-many.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.