33 template<
class>
class FaceList,
41 const PrimitivePatch<Face, FaceList, PointField, PointType>&
p,
46 bool foundError =
false;
51 const labelList& edgeLabels =
p.faceEdges()[faceI];
54 if (edgeLabels.size() < 3)
58 Info<<
"Face[" << faceI <<
"] " <<
p[faceI]
59 <<
" has fewer than 3 edges. Edges: " << edgeLabels
68 if (edgeLabels[i] < 0 || edgeLabels[i] >=
p.nEdges())
72 Info<<
"edge number " << edgeLabels[i]
73 <<
" on face " << faceI
75 <<
"This usually means the input surface has "
76 <<
"edges with more than 2 faces connected."
94 const Face&
f =
p[faceI];
95 const point& p0 =
p.points()[
f[0]];
96 const point& p1 =
p.points()[
f[1]];
97 const point& p2 =
p.points()[
f.last()];
99 const vector pointNormal((p1 - p0) ^ (p2 - p0));
100 if ((pointNormal &
p.faceNormals()[faceI]) < 0)
107 <<
"Normal calculated from points inconsistent"
108 <<
" with faceNormal" <<
nl
109 <<
"face: " <<
f <<
nl
110 <<
"points: " << p0 <<
' ' << p1 <<
' ' << p2 <<
nl
111 <<
"pointNormal:" << pointNormal <<
nl
112 <<
"faceNormal:" <<
p.faceNormals()[faceI] <<
endl;
120 const edge&
e =
p.edges()[edgeI];
121 const labelList& neighbouringFaces =
p.edgeFaces()[edgeI];
123 if (neighbouringFaces.size() == 2)
127 const Face& faceA =
p.localFaces()[neighbouringFaces[0]];
128 const Face& faceB =
p.localFaces()[neighbouringFaces[1]];
132 if (faceA.edgeDirection(
e) == faceB.edgeDirection(
e))
136 Info<<
"face orientation incorrect." <<
nl
137 <<
"localEdge[" << edgeI <<
"] " <<
e
138 <<
" between faces:" <<
nl
139 <<
" face[" << neighbouringFaces[0] <<
"] "
140 <<
p[neighbouringFaces[0]]
141 <<
" localFace: " << faceA
143 <<
" face[" << neighbouringFaces[1] <<
"] "
144 <<
p[neighbouringFaces[1]]
145 <<
" localFace: " << faceB
150 setPtr->insert(edgeI);
156 else if (neighbouringFaces.size() != 1)
161 <<
"Wrong number of edge neighbours." <<
nl
162 <<
"edge[" << edgeI <<
"] " <<
e
163 <<
" with points:" <<
p.localPoints()[
e.start()]
164 <<
' ' <<
p.localPoints()[
e.end()]
165 <<
" has neighbouringFaces:" << neighbouringFaces <<
endl;
170 setPtr->insert(edgeI);