35 const scalar distSqr =
magSqr(pt-origin_);
38 scalar levelSize = level0Size_/(1<<originLevel_);
42 for (
label level = originLevel_; level >= 0; --level)
60 template<
class TrackingData>
61 inline bool Foam::refinementDistanceData::update
71 if (!neighbourInfo.
valid(td))
76 operator=(neighbourInfo);
86 if (nbrLevel > cellLevel)
88 operator=(neighbourInfo);
91 else if (nbrLevel == cellLevel)
93 scalar myDistSqr =
magSqr(pos-origin_);
94 scalar nbrDistSqr =
magSqr(pos - neighbourInfo.
origin());
95 scalar
diff = myDistSqr - nbrDistSqr;
103 if ((diff < small) || ((myDistSqr > small) && (diff/myDistSqr < tol)))
111 operator=(neighbourInfo);
134 const scalar level0Size,
136 const label originLevel
139 level0Size_(level0Size),
141 originLevel_(originLevel)
147 template<
class TrackingData>
150 return level0Size_ != -1;
155 template<
class TrackingData>
168 template<
class TrackingData>
173 const label patchFacei,
174 const point& faceCentre,
178 origin_ -= faceCentre;
182 template<
class TrackingData>
195 template<
class TrackingData>
200 const label patchFacei,
201 const point& faceCentre,
206 origin_ += faceCentre;
211 template<
class TrackingData>
215 const label thisCelli,
216 const label neighbourFacei,
224 return update(pos, neighbourInfo, tol, td);
229 template<
class TrackingData>
233 const label thisFacei,
234 const label neighbourCelli,
242 return update(pos, neighbourInfo, tol, td);
247 template<
class TrackingData>
251 const label thisFacei,
259 return update(pos, neighbourInfo, tol, td);
263 template<
class TrackingData>
290 inline bool Foam::refinementDistanceData::operator==
297 level0Size_ == rhs.level0Size_
298 && origin_ == rhs.origin_
299 && originLevel_ == rhs.originLevel_;
303 inline bool Foam::refinementDistanceData::operator!=
309 return !(*
this == rhs);
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Reverse of leaveDomain.
label wantedLevel(const point &pt) const
Calculates the wanted level at a given point. Walks out from.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool equal(const refinementDistanceData &, TrackingData &) const
Same (like operator==)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(TrackingData &) const
Check whether origin has been changed at all or.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Convert any absolute coordinates into relative to (patch)face.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
bool operator==(const refinementDistanceData &) const
const vectorField & faceCentres() const
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring face.
bool sameGeometry(const polyMesh &, const refinementDistanceData &, const scalar, TrackingData &) const
Check for identical geometrical data. Used for cyclics checking.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring cell.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
refinementDistanceData()
Construct null.
const point & origin() const
void transform(const polyMesh &, const tensor &, TrackingData &)
Apply rotation matrix to any coordinates.
Transfers refinement levels such that slow transition between levels is maintained. Used in FaceCellWave.
dimensionSet transform(const dimensionSet &)