39 const scalar distSqr =
magSqr(pt-origin_);
42 scalar levelSize = level0Size_/(1<<originLevel_);
46 for (label level = originLevel_; level >= 0; --level)
64template<
class TrackingData>
65inline bool Foam::refinementDistanceData::update
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),
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,
229template<
class TrackingData>
233 const label thisFacei,
234 const label neighbourCelli,
247template<
class TrackingData>
251 const label thisFacei,
263template<
class TrackingData>
272 return (!
rhs.valid(
td));
281template<
class TrackingData>
287 const refinementDistanceData& f0,
289 const refinementDistanceData& f1,
312inline bool Foam::refinementDistanceData::operator==
314 const refinementDistanceData&
rhs
318 level0Size_ ==
rhs.level0Size_
319 && origin_ ==
rhs.origin_
320 && originLevel_ ==
rhs.originLevel_;
324inline bool Foam::refinementDistanceData::operator!=
329 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.
Transfers refinement levels such that slow transition between levels is maintained....
const point & origin() const
bool interpolate(const polyMesh &, const point &pt, const label i0, const refinementDistanceData &f0, const label i1, const refinementDistanceData &f1, const scalar weight, const scalar tol, TrackingData &td)
Interpolate between two values (lerp). Returns true if causes changes. Not sure if needs to be specia...
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const refinementDistanceData &neighbourInfo, const scalar tol, TrackingData &)
Influence of neighbouring face.
scalar level0Size() const
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Convert any absolute coordinates into relative to (patch)face.
label originLevel() const
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.
void transform(const polyMesh &, const tensor &, TrackingData &)
Apply rotation matrix to any coordinates.
bool equal(const refinementDistanceData &, TrackingData &) const
Test for equality, with TrackingData.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
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)
vector point
Point is a vector.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)