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,
178 collapsePoint_ =
transform.transformPosition(collapsePoint_);
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);
Determines length of string of edges walked to point.
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointEdgeCollapse &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
label collapsePriority() const
pointEdgeCollapse()
Construct null.
bool equal(const pointEdgeCollapse &, TrackingData &) const
Same (like operator==)
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
label collapseIndex() const
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeCollapse &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
const point & collapsePoint() const
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
errorManip< error > abort(error &err)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensionSet transform(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)