32 template<
class TrackingData>
33 inline bool Foam::pointEdgeCollapse::update
35 const pointEdgeCollapse& w2,
52 if (w2.collapseIndex_ == -1 || collapseIndex_ == -1)
58 if (w2.collapsePriority_ < collapsePriority_)
62 else if (w2.collapsePriority_ > collapsePriority_)
69 if (w2.collapseIndex_ < collapseIndex_)
74 else if (w2.collapseIndex_ == collapseIndex_)
76 bool identicalPoint = samePoint(w2.collapsePoint_);
78 bool nearer = (
magSqr(w2.collapsePoint_) <
magSqr(collapsePoint_));
106 collapsePoint_(great, great, great),
108 collapsePriority_(-2)
115 const point& collapsePoint,
116 const label collapseIndex,
117 const label collapsePriority
120 collapsePoint_(collapsePoint),
121 collapseIndex_(collapseIndex),
122 collapsePriority_(collapsePriority)
130 return collapsePoint_;
136 return collapseIndex_;
142 return collapsePriority_;
146 inline bool Foam::pointEdgeCollapse::samePoint(
const point& pt)
const 148 bool isLegal1 = (
cmptMin(collapsePoint_) < 0.5*great);
149 bool isLegal2 = (
cmptMin(pt) < 0.5*great);
151 if (isLegal1 && isLegal2)
153 return mag(collapsePoint_ - pt) < 1
e-9;
157 return isLegal1 == isLegal2;
162 template<
class TrackingData>
165 return collapseIndex_ != -2;
169 template<
class TrackingData>
173 const label patchPointi,
178 collapsePoint_ -= coord;
182 template<
class TrackingData>
195 template<
class TrackingData>
199 const label patchPointi,
205 collapsePoint_ += coord;
210 template<
class TrackingData>
221 return update(edgeInfo, tol, td);
226 template<
class TrackingData>
236 return update(newPointInfo, tol, td);
241 template<
class TrackingData>
249 return update(newPointInfo, tol, td);
254 template<
class TrackingData>
265 return update(pointInfo, tol, td);
269 template<
class TrackingData>
282 inline bool Foam::pointEdgeCollapse::operator==
288 collapseIndex_ == rhs.collapseIndex_
289 && collapsePriority_ == rhs.collapsePriority_
290 && samePoint(rhs.collapsePoint_);
294 inline bool Foam::pointEdgeCollapse::operator!=
299 return !(*
this == rhs);
label collapsePriority() const
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const point & collapsePoint() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
pointEdgeCollapse()
Construct null.
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointEdgeCollapse &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
void enterDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
void leaveDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert origin to relative vector to leaving point.
label collapseIndex() const
errorManip< error > abort(error &err)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
bool equal(const pointEdgeCollapse &, TrackingData &) const
Same (like operator==)
dimensioned< scalar > mag(const dimensioned< Type > &)
Determines length of string of edges walked to point.
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
bool operator==(const pointEdgeCollapse &) const
dimensionSet transform(const dimensionSet &)
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeCollapse &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.