34 template<
class TrackingData>
35 inline bool Foam::pointEdgeCollapse::update
37 const pointEdgeCollapse&
w2,
54 if (
w2.collapseIndex_ == -1 || collapseIndex_ == -1)
60 if (
w2.collapsePriority_ < collapsePriority_)
64 else if (
w2.collapsePriority_ > collapsePriority_)
71 if (
w2.collapseIndex_ < collapseIndex_)
76 else if (
w2.collapseIndex_ == collapseIndex_)
78 bool identicalPoint = samePoint(
w2.collapsePoint_);
80 bool nearer = (
magSqr(
w2.collapsePoint_) <
magSqr(collapsePoint_));
101 inline bool Foam::pointEdgeCollapse::samePoint(
const point& pt)
const 103 bool isLegal1 = (
cmptMin(collapsePoint_) < 0.5*GREAT);
104 bool isLegal2 = (
cmptMin(pt) < 0.5*GREAT);
106 if (isLegal1 && isLegal2)
108 return mag(collapsePoint_ - pt) < 1
e-9;
112 return isLegal1 == isLegal2;
121 collapsePoint_(GREAT, GREAT, GREAT),
123 collapsePriority_(-2)
129 const point& collapsePoint,
130 const label collapseIndex,
131 const label collapsePriority
134 collapsePoint_(collapsePoint),
135 collapseIndex_(collapseIndex),
136 collapsePriority_(collapsePriority)
142 template<
class TrackingData>
145 return collapseIndex_ != -2;
149 template<
class TrackingData>
153 const label patchPointi,
158 collapsePoint_ -= coord;
162 template<
class TrackingData>
175 template<
class TrackingData>
179 const label patchPointi,
185 collapsePoint_ += coord;
190 template<
class TrackingData>
206 template<
class TrackingData>
221 template<
class TrackingData>
234 template<
class TrackingData>
249 template<
class TrackingData>
262 inline bool Foam::pointEdgeCollapse::operator==
268 collapseIndex_ == rhs.collapseIndex_
269 && collapsePriority_ == rhs.collapsePriority_
270 && samePoint(rhs.collapsePoint_);
274 inline bool Foam::pointEdgeCollapse::operator!=
279 return !(*
this == rhs);
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
pointEdgeCollapse()
Default construct.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
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.
const dimensionedScalar e
Elementary charge.
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.
errorManip< error > abort(error &err)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
bool equal(const pointEdgeCollapse &, TrackingData &) const
Test for equality, with TrackingData.
vector point
Point is a vector.
const std::string patch
OpenFOAM patch number as a std::string.
Determines length of string of edges walked to point.
Mesh consisting of general polyhedral cells.
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.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Tensor of scalars, i.e. Tensor<scalar>.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeCollapse &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.