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);
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Reverse of leaveDomain.
label wantedLevel(const point &pt) const
Calculates the wanted level at a given point.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
bool equal(const refinementDistanceData &, TrackingData &) const
Test for equality, with TrackingData.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(TrackingData &) const
Changed or contains original (invalid) value.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pos(const dimensionedScalar &ds)
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &)
Convert any absolute coordinates into relative to (patch)face.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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 (eg, cyclics checking)
const std::string patch
OpenFOAM patch number as a std::string.
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.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
A patch is a list of labels that address the faces in the global face list.
refinementDistanceData()
Default construct.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Tensor of scalars, i.e. Tensor<scalar>.
const point & origin() const
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void transform(const polyMesh &, const tensor &, TrackingData &)
Apply rotation matrix to any coordinates.
Transfers refinement levels such that slow transition between levels is maintained. Used in FaceCellWave.