35 template<
class>
class FaceList,
56 const labelList& faceNbs = edgeFaces[edgeI];
58 if (faceNbs.
size() > 2)
62 const edge&
e = edges[edgeI];
67 e2 /=
mag(e2) + vSmall;
71 const Face& f0 = localFaces[faceNbs[0]];
73 scalar maxAngle = great;
78 if (f0[fpI] != e.
start())
80 vector faceEdgeDir = localPoints[f0[fpI]] - edgePt;
81 faceEdgeDir /=
mag(faceEdgeDir) + vSmall;
83 const scalar angle = e2 & faceEdgeDir;
85 if (
mag(angle) < maxAngle)
88 maxAngleEdgeDir = faceEdgeDir;
95 vector e0 = e2 ^ maxAngleEdgeDir;
96 e0 /=
mag(e0) + vSmall;
106 for (
label nbI = 1; nbI < faceNbs.size(); nbI++)
110 const Face&
f = localFaces[faceNbs[nbI]];
117 if (f[fpI] != e.
start())
119 vector faceEdgeDir = localPoints[f[fpI]] - edgePt;
120 faceEdgeDir /=
mag(faceEdgeDir) + vSmall;
122 const scalar angle = e2 & faceEdgeDir;
124 if (
mag(angle) < maxAngle)
127 maxAngleEdgeDir = faceEdgeDir;
132 vector vec = e2 ^ maxAngleEdgeDir;
133 vec /=
mag(vec) + vSmall;
154 sortedEdgeFaces[edgeI] = faceNbs;
158 return sortedEdgeFaces;
#define forAll(list, i)
Loop across all elements in list.
void sort()
(stable) sort the list (if changed after construction time)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar pseudoAngle(const vector &e0, const vector &e1, const vector &vec)
Estimate angle of vec in coordinate system (e0, e1, e0^e1).
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list that is sorted upon construction or when explicitly requested with the sort() method...
void size(const label)
Override size to be inconsistent with allocated storage.
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
A list of faces which address into the list of points.
const dimensionedScalar e
Elementary charge.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
vector vec(const pointField &) const
Return the vector (end - start)
A List with indirect addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
label start() const
Return start vertex label.