Go to the documentation of this file.
35 template<
class TrackingData>
36 inline bool Foam::pointEdgeCollapse::update
38 const pointEdgeCollapse&
w2,
55 if (
w2.collapseIndex_ == -1 || collapseIndex_ == -1)
61 if (
w2.collapsePriority_ < collapsePriority_)
65 else if (
w2.collapsePriority_ > collapsePriority_)
72 if (
w2.collapseIndex_ < collapseIndex_)
77 else if (
w2.collapseIndex_ == collapseIndex_)
79 bool identicalPoint = samePoint(
w2.collapsePoint_);
81 bool nearer = (
magSqr(
w2.collapsePoint_) <
magSqr(collapsePoint_));
107 collapsePoint_(GREAT, GREAT, GREAT),
109 collapsePriority_(-2)
116 const point& collapsePoint,
117 const label collapseIndex,
118 const label collapsePriority
121 collapsePoint_(collapsePoint),
122 collapseIndex_(collapseIndex),
123 collapsePriority_(collapsePriority)
131 return collapsePoint_;
137 return collapseIndex_;
143 return collapsePriority_;
147 inline bool Foam::pointEdgeCollapse::samePoint(
const point& pt)
const
149 bool isLegal1 = (
cmptMin(collapsePoint_) < 0.5*GREAT);
150 bool isLegal2 = (
cmptMin(pt) < 0.5*GREAT);
152 if (isLegal1 && isLegal2)
154 return mag(collapsePoint_ - pt) < 1
e-9;
158 return isLegal1 == isLegal2;
163 template<
class TrackingData>
166 return collapseIndex_ != -2;
170 template<
class TrackingData>
174 const label patchPointi,
179 collapsePoint_ -= coord;
183 template<
class TrackingData>
196 template<
class TrackingData>
200 const label patchPointi,
206 collapsePoint_ += coord;
211 template<
class TrackingData>
222 return update(edgeInfo, tol, td);
227 template<
class TrackingData>
237 return update(newPointInfo, tol, td);
242 template<
class TrackingData>
250 return update(newPointInfo, tol, td);
255 template<
class TrackingData>
266 return update(pointInfo, tol, td);
270 template<
class TrackingData>
283 inline bool Foam::pointEdgeCollapse::operator==
289 collapseIndex_ == rhs.collapseIndex_
290 && collapsePriority_ == rhs.collapsePriority_
291 && samePoint(rhs.collapsePoint_);
295 inline bool Foam::pointEdgeCollapse::operator!=
300 return !(*
this == rhs);
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 collapseIndex() const
bool equal(const pointEdgeCollapse &, TrackingData &) const
Same (like operator==)
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
const point & collapsePoint() const
void enterDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Mesh consisting of general polyhedral cells.
Determines length of string of edges walked to point.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
label collapsePriority() const
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< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
A patch is a list of labels that address the faces in the global face list.
pointEdgeCollapse()
Construct null.
errorManip< error > abort(error &err)
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void leaveDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert origin to relative vector to leaving point.
const std::string patch
OpenFOAM patch number as a std::string.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeCollapse &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.