32 template<
class FaceList,
class Po
intField>
51 const labelList& faceNbs = edgeFaces[edgeI];
53 if (faceNbs.
size() > 2)
57 const edge&
e = edges[edgeI];
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;
149 sortedEdgeFaces[edgeI] = faceNbs;
153 return sortedEdgeFaces;
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sort()
(stable) sort the list (if changed after construction time)
scalar pseudoAngle(const vector &e0, const vector &e1, const vector &vec)
Estimate angle of vec in coordinate system (e0, e1, e0^e1).
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 Field< PointType > & localPoints() const
Return pointField of points in patch.
A list of faces which address into the list of points.
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.
vector vec(const pointField &) const
Return the vector (end - start)
std::remove_reference< FaceList >::type::value_type FaceType
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
A List with indirect addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
std::remove_reference< PointField >::type::value_type PointType
const dimensionedScalar e
Elementary charge.
label start() const
Return start vertex label.