36 const scalar distSqr =
magSqr(pt-origin_);
39 scalar levelSize = level0Size_/(1<<originLevel_);
43 for (
label level = originLevel_; level >= 0; --level)
61 template<
class TrackingData>
62 inline bool Foam::refinementDistanceData::update
72 if (!neighbourInfo.
valid(td))
77 operator=(neighbourInfo);
87 if (nbrLevel > cellLevel)
89 operator=(neighbourInfo);
92 else if (nbrLevel == cellLevel)
94 scalar myDistSqr =
magSqr(pos-origin_);
95 scalar nbrDistSqr =
magSqr(pos - neighbourInfo.
origin());
96 scalar
diff = myDistSqr - nbrDistSqr;
104 if ((diff < small) || ((myDistSqr > small) && (diff/myDistSqr < tol)))
112 operator=(neighbourInfo);
135 const scalar level0Size,
137 const label originLevel
140 level0Size_(level0Size),
142 originLevel_(originLevel)
148 template<
class TrackingData>
151 return level0Size_ != -1;
156 template<
class TrackingData>
169 template<
class TrackingData>
173 const label patchFacei,
182 template<
class TrackingData>
186 const label thisCelli,
187 const label neighbourFacei,
195 return update(pos, neighbourInfo, tol, td);
200 template<
class TrackingData>
204 const label thisFacei,
205 const label neighbourCelli,
213 return update(pos, neighbourInfo, tol, td);
218 template<
class TrackingData>
222 const label thisFacei,
230 return update(pos, neighbourInfo, tol, td);
234 template<
class TrackingData>
261 inline bool Foam::refinementDistanceData::operator==
268 level0Size_ == rhs.level0Size_
269 && origin_ == rhs.origin_
270 && originLevel_ == rhs.originLevel_;
274 inline bool Foam::refinementDistanceData::operator!=
280 return !(*
this == rhs);
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.
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
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)
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
Transfers refinement levels such that slow transition between levels is maintained. Used in FaceCellWave.