30 template<
class FaceList,
class Po
intField>
40 bool foundError =
false;
45 const labelList& edgeLabels =
p.faceEdges()[facei];
48 if (edgeLabels.
size() < 3)
52 Info<<
"Face[" << facei <<
"] " <<
p[facei]
53 <<
" has fewer than 3 edges. Edges: " << edgeLabels
62 if (edgeLabels[i] < 0 || edgeLabels[i] >=
p.nEdges())
66 Info<<
"edge number " << edgeLabels[i]
67 <<
" on face " << facei
69 <<
"This usually means the input surface has "
70 <<
"edges with more than 2 faces connected."
88 const FaceType&
f =
p[facei];
89 const point& p0 =
p.points()[
f[0]];
90 const point& p1 =
p.points()[
f[1]];
91 const point& p2 =
p.points()[
f.last()];
93 const vector pointNormal((p1 - p0) ^ (p2 - p0));
94 if ((pointNormal &
p.faceNormals()[facei]) < 0)
101 <<
"Normal calculated from points inconsistent"
102 <<
" with faceNormal" <<
nl
103 <<
"face: " <<
f <<
nl
104 <<
"points: " << p0 <<
' ' << p1 <<
' ' << p2 <<
nl
105 <<
"pointNormal:" << pointNormal <<
nl
106 <<
"faceNormal:" <<
p.faceNormals()[facei] <<
endl;
114 const edge&
e =
p.edges()[edgeI];
115 const labelList& neighbouringFaces =
p.edgeFaces()[edgeI];
117 if (neighbouringFaces.
size() == 2)
121 const FaceType& faceA =
p.localFaces()[neighbouringFaces[0]];
122 const FaceType& faceB =
p.localFaces()[neighbouringFaces[1]];
126 if (faceA.edgeDirection(
e) == faceB.edgeDirection(
e))
130 Info<<
"face orientation incorrect." <<
nl
131 <<
"localEdge[" << edgeI <<
"] " <<
e
132 <<
" between faces:" <<
nl
133 <<
" face[" << neighbouringFaces[0] <<
"] "
134 <<
p[neighbouringFaces[0]]
135 <<
" localFace: " << faceA
137 <<
" face[" << neighbouringFaces[1] <<
"] "
138 <<
p[neighbouringFaces[1]]
139 <<
" localFace: " << faceB
150 else if (neighbouringFaces.
size() != 1)
155 <<
"Wrong number of edge neighbours." <<
nl
156 <<
"edge[" << edgeI <<
"] " <<
e
157 <<
" with points:" <<
p.localPoints()[
e.start()]
158 <<
' ' <<
p.localPoints()[
e.end()]
159 <<
" has neighbouringFaces:" << neighbouringFaces <<
endl;
#define forAll(list, i)
Loop across all elements in list.
bool insert(const Key &key)
Insert a new entry.
void size(const label)
Override size to be inconsistent with allocated storage.
A list of faces which address into the list of points.
std::remove_reference< FaceList >::type::value_type FaceType
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool valid(const PtrList< ModelType > &l)
Ostream & endl(Ostream &os)
Add newline and flush stream.