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 patchFacei,
183 template<
class TrackingData>
194 return update(edgeInfo, tol, td);
199 template<
class TrackingData>
209 return update(newPointInfo, tol, td);
214 template<
class TrackingData>
222 return update(newPointInfo, tol, td);
227 template<
class TrackingData>
238 return update(pointInfo, tol, td);
242 template<
class TrackingData>
255 inline bool Foam::pointEdgeCollapse::operator==
261 collapseIndex_ == rhs.collapseIndex_
262 && collapsePriority_ == rhs.collapsePriority_
263 && samePoint(rhs.collapsePoint_);
267 inline bool Foam::pointEdgeCollapse::operator!=
272 return !(*
this == rhs);
label collapsePriority() const
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
const point & collapsePoint() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
pointEdgeCollapse()
Construct null.
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 transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
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
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeCollapse &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.