39 const scalar distSqr =
magSqr(pt-origin_);
42 scalar levelSize = level0Size_/(1<<originLevel_);
46 for (label level = originLevel_; level >= 0; --level)
64template<
class TrackingData>
75 if (!neighbourInfo.
valid(td))
80 operator=(neighbourInfo);
85 label cellLevel = wantedLevel(
pos);
90 if (nbrLevel > cellLevel)
92 operator=(neighbourInfo);
95 else if (nbrLevel == cellLevel)
99 scalar
diff = myDistSqr - nbrDistSqr;
107 if ((
diff < SMALL) || ((myDistSqr > SMALL) && (
diff/myDistSqr < tol)))
115 operator=(neighbourInfo);
134 const scalar level0Size,
136 const label originLevel
139 level0Size_(level0Size),
141 originLevel_(originLevel)
147template<
class TrackingData>
150 return level0Size_ != -1;
155template<
class TrackingData>
168template<
class TrackingData>
173 const label patchFacei,
174 const point& faceCentre,
178 origin_ -= faceCentre;
182template<
class TrackingData>
195template<
class TrackingData>
200 const label patchFacei,
201 const point& faceCentre,
206 origin_ += faceCentre;
211template<
class TrackingData>
215 const label thisCelli,
216 const label neighbourFacei,
224 return update(
pos, neighbourInfo, tol, td);
229template<
class TrackingData>
233 const label thisFacei,
234 const label neighbourCelli,
242 return update(
pos, neighbourInfo, tol, td);
247template<
class TrackingData>
251 const label thisFacei,
259 return update(
pos, neighbourInfo, tol, td);
263template<
class TrackingData>
272 return (!rhs.
valid(td));
289 level0Size_ == rhs.level0Size_
290 && origin_ == rhs.origin_
291 && originLevel_ == rhs.originLevel_;
300 return !(*
this == rhs);
bool valid() const
True if all internal ids are non-negative.
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
virtual bool update()
Update the mesh for both mesh motion and topology change.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
const vectorField & faceCentres() const
const vectorField & cellCentres() const
Transfers refinement levels such that slow transition between levels is maintained....
const point & origin() const
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring face.
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Convert any absolute coordinates into relative to (patch)face.
bool sameGeometry(const polyMesh &, const refinementDistanceData &, const scalar, TrackingData &) const
Check for identical geometrical data (eg, cyclics checking)
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring cell.
label wantedLevel(const point &pt) const
Calculates the wanted level at a given point.
bool valid(TrackingData &) const
Changed or contains original (invalid) value.
refinementDistanceData()
Default construct.
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Reverse of leaveDomain.
bool equal(const refinementDistanceData &, TrackingData &) const
Test for equality, with TrackingData.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
errorManip< error > abort(error &err)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)