Go to the documentation of this file.
45 const scalar nearestDistSqr
50 const vector n(sample - centre_);
53 if (nearestDistSqr >=
sqr(magN - radius_))
55 if (magN < ROOTVSMALL)
61 info.
rawPoint() = centre_ +
n/magN*radius_;
84 scalar magSqrDir =
magSqr(dir);
86 if (magSqrDir > ROOTVSMALL)
88 const vector toCentre(centre_-start);
89 scalar magSqrToCentre =
magSqr(toCentre);
93 scalar v = (toCentre & dir);
95 scalar disc =
sqr(radius_) - (magSqrToCentre -
sqr(v));
101 scalar nearParam = v-d;
103 if (nearParam >= 0 &&
sqr(nearParam) <= magSqrDir)
106 near.
setPoint(start + nearParam*dir);
110 scalar farParam = v+d;
112 if (farParam >= 0 &&
sqr(farParam) <= magSqrDir)
138 centre_ - radius_*vector::one,
139 centre_ + radius_*vector::one
151 centre_(
dict.lookup(
"centre")),
156 centre_ - radius_*vector::one,
157 centre_ + radius_*vector::one
178 if (regions_.empty())
181 regions_[0] =
"region0";
195 centres[0] = centre_;
197 radiusSqr.setSize(1);
216 info[i] = findNearest(
samples[i], nearestDistSqr[i]);
235 findLineAll(start[i], end[i], info[i],
b);
236 if (!info[i].hit() &&
b.hit())
258 findLineAll(start[i], end[i], info[i],
b);
259 if (!info[i].hit() &&
b.hit())
279 findLineAll(start[i], end[i], near, far);
335 normal[i] = info[i].hitPoint() - centre_;
360 if (
magSqr(pt - centre_) <=
sqr(radius_))
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
void setIndex(const label index)
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
#define forAll(list, i)
Loop across all elements in list.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
bool hit() const
Is there a hit.
virtual const wordList & regions() const
Names of regions.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalarField samples(nIntervals, 0)
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & rawPoint() const
Return point with no checking.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
void findLineAll(const point &start, const point &end, pointIndexHit &near, pointIndexHit &far) const
Find intersection with sphere.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
void setPoint(const Point &p)
Vector< scalar > vector
A scalar version of the templated Vector.
void setSize(const label)
Reset size of List.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
void clear()
Clear the list, i.e. set size to zero.
A bounding box defined in terms of the points at its extremities.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual ~searchableSphere()
Destructor.
searchableSphere(const searchableSphere &)
Disallow default bitwise copy construct.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
A normal distribution model.
pointIndexHit findNearest(const point &sample, const scalar nearestDistSqr) const
Find nearest point on sphere.