33template<
class FaceList,
class Po
intField>
44 bool foundError =
false;
49 const labelList& edgeLabels =
p.faceEdges()[facei];
52 if (edgeLabels.
size() < 3)
56 Info<<
"Face[" << facei <<
"] " <<
p[facei]
57 <<
" has fewer than 3 edges. Edges: " << edgeLabels
66 if (edgeLabels[i] < 0 || edgeLabels[i] >=
p.nEdges())
70 Info<<
"edge number " << edgeLabels[i]
71 <<
" on face " << facei
73 <<
"This usually means the input surface has "
74 <<
"edges with more than 2 faces connected."
92 const FaceType&
f =
p[facei];
94 const point& p1 =
p.points()[
f[1]];
97 const vector pointNormal((p1 -
p0) ^ (p2 -
p0));
98 if ((pointNormal &
p.faceNormals()[facei]) < 0)
105 <<
"Normal calculated from points inconsistent"
106 <<
" with faceNormal" <<
nl
107 <<
"face: " <<
f <<
nl
108 <<
"points: " <<
p0 <<
' ' << p1 <<
' ' << p2 <<
nl
109 <<
"pointNormal:" << pointNormal <<
nl
110 <<
"faceNormal:" <<
p.faceNormals()[facei] <<
endl;
118 const edge&
e =
p.edges()[edgeI];
119 const labelList& neighbouringFaces =
p.edgeFaces()[edgeI];
121 if (neighbouringFaces.
size() == 2)
125 const FaceType& faceA =
p.localFaces()[neighbouringFaces[0]];
126 const FaceType& faceB =
p.localFaces()[neighbouringFaces[1]];
130 if (faceA.edgeDirection(
e) == faceB.edgeDirection(
e))
134 Info<<
"face orientation incorrect." <<
nl
135 <<
"localEdge[" << edgeI <<
"] " <<
e
136 <<
" between faces:" <<
nl
137 <<
" face[" << neighbouringFaces[0] <<
"] "
138 <<
p[neighbouringFaces[0]]
139 <<
" localFace: " << faceA
141 <<
" face[" << neighbouringFaces[1] <<
"] "
142 <<
p[neighbouringFaces[1]]
143 <<
" localFace: " << faceB
154 else if (neighbouringFaces.
size() != 1)
159 <<
"Wrong number of edge neighbours." <<
nl
160 <<
"edge[" << edgeI <<
"] " <<
e
161 <<
" with points:" <<
p.localPoints()[
e.start()]
162 <<
' ' <<
p.localPoints()[
e.
end()]
163 <<
" has neighbouringFaces:" << neighbouringFaces <<
endl;
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A list of faces which address into the list of points.
std::remove_reference< FaceList >::type::value_type face_type
The face type.
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const volScalarField & p0
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.