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)
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,
178 origin_ =
transform.transformPosition(origin_);
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);
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....
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.
label wantedLevel(const point &pt) const
Calculates the wanted level at a given point. Walks out from.
bool valid(TrackingData &) const
Check whether origin has been changed at all or.
refinementDistanceData()
Construct null.
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
const point & origin() const
bool equal(const refinementDistanceData &, TrackingData &) const
Same (like operator==)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(const PtrList< ModelType > &l)
dimensionedScalar pos(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
errorManip< error > abort(error &err)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
dimensionSet transform(const dimensionSet &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)