32 template<
class FaceList,
class Po
intField>
51 const labelList& faceNbs = edgeFaces[edgeI];
53 if (faceNbs.
size() > 2)
57 const edge&
e = edges[edgeI];
59 const point& edgePt = localPoints[
e.start()];
62 e2 /=
mag(e2) + vSmall;
66 const FaceType& f0 = localFaces[faceNbs[0]];
68 scalar maxAngle = great;
73 if (f0[fpI] !=
e.start())
75 vector faceEdgeDir = localPoints[f0[fpI]] - edgePt;
76 faceEdgeDir /=
mag(faceEdgeDir) + vSmall;
78 const scalar angle = e2 & faceEdgeDir;
80 if (
mag(angle) < maxAngle)
83 maxAngleEdgeDir = faceEdgeDir;
90 vector e0 = e2 ^ maxAngleEdgeDir;
91 e0 /=
mag(e0) + vSmall;
101 for (
label nbI = 1; nbI < faceNbs.size(); nbI++)
105 const FaceType&
f = localFaces[faceNbs[nbI]];
112 if (
f[fpI] !=
e.start())
114 vector faceEdgeDir = localPoints[
f[fpI]] - edgePt;
115 faceEdgeDir /=
mag(faceEdgeDir) + vSmall;
117 const scalar angle = e2 & faceEdgeDir;
119 if (
mag(angle) < maxAngle)
122 maxAngleEdgeDir = faceEdgeDir;
127 vector vec = e2 ^ maxAngleEdgeDir;
128 vec /=
mag(vec) + vSmall;
#define forAll(list, i)
Loop across all elements in list.
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< PointField >::type::value_type PointType
std::remove_reference< FaceList >::type::value_type FaceType
A list that is sorted upon construction or when explicitly requested with the sort() method.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
void sort()
(stable) sort the list (if changed after construction time)
A List with indirect addressing.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar pseudoAngle(const vector &e0, const vector &e1, const vector &vec)
Estimate angle of vec in coordinate system (e0, e1, e0^e1).