Go to the documentation of this file.
39 const scalar distSqr =
magSqr(pt-origin_);
42 scalar levelSize = level0Size_/(1<<originLevel_);
46 for (label level = originLevel_; level >= 0; --level)
64 template<
class TrackingData>
65 inline bool Foam::refinementDistanceData::update
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)
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,
229 template<
class TrackingData>
233 const label thisFacei,
234 const label neighbourCelli,
247 template<
class TrackingData>
251 const label thisFacei,
259 return update(
pos, neighbourInfo, tol, td);
263 template<
class TrackingData>
272 return (!rhs.
valid(td));
283 inline bool Foam::refinementDistanceData::operator==
285 const refinementDistanceData& rhs
289 level0Size_ == rhs.level0Size_
290 && origin_ == rhs.origin_
291 && originLevel_ == rhs.originLevel_;
295 inline bool Foam::refinementDistanceData::operator!=
300 return !(*
this == rhs);
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
bool sameGeometry(const polyMesh &, const refinementDistanceData &, const scalar, TrackingData &) const
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
bool valid(TrackingData &) const
dimensionSet transform(const dimensionSet &ds)
Mesh consisting of general polyhedral cells.
Transfers refinement levels such that slow transition between levels is maintained....
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
scalar diff(const triad &A, const triad &B)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
A patch is a list of labels that address the faces in the global face list.
errorManip< error > abort(error &err)
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
void transform(const polyMesh &, const tensor &, TrackingData &)
bool equal(const refinementDistanceData &, TrackingData &) const
const vectorField & cellCentres() const
#define FatalErrorInFunction
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const vectorField & faceCentres() const
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
const point & origin() const
label wantedLevel(const point &pt) const
dimensionedScalar pos(const dimensionedScalar &ds)