Go to the documentation of this file.
58 const scalar nearestDistSqr
66 const scalar parallel = (v &
normal());
71 const scalar magV =
mag(v);
78 if (
magSqr(sample -
info.rawPoint()) < nearestDistSqr)
88 void Foam::searchableDisk::findLine
97 vector v(start - origin());
100 const scalar parallel = (v & normal());
108 v -= parallel * normal();
110 const scalar magV =
mag(v);
115 info.setPoint(origin() + magV*v);
117 if (radialLimits_.contains(magV))
127 Foam::searchableDisk::searchableDisk
130 const point& originPoint,
131 const vector& normalVector,
132 const scalar outerRadius,
133 const scalar innerRadius
137 plane(originPoint, normalVector),
138 radialLimits_(innerRadius, outerRadius)
151 bounds().
min() = origin() - span;
152 bounds().
max() = origin() + span;
156 Foam::searchableDisk::searchableDisk
177 if (regions_.empty())
180 regions_.first() =
"region0";
195 centres[0] = origin();
196 radiusSqr[0] =
sqr(radialLimits_.max());
203 void Foam::searchableDisk::findNearest
214 info[i] = findNearest(
samples[i], nearestDistSqr[i]);
219 void Foam::searchableDisk::findLine
226 info.
resize(start.size());
242 findLine(start,
end, info);
258 findLine(start[i],
end[i], inter);
279 region.
resize(info.size());
290 normals.resize(info.size());
302 <<
"Volume type not supported for disk."
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const vector & normal() const
The plane unit normal.
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
static constexpr const zero Zero
Global zero (0)
virtual const wordList & regions() const
Names of regions.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
dimensionedScalar sign(const dimensionedScalar &ds)
InfoProxy< IOobject > info() const
Return info proxy.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
Searching on circular disk given as origin, normal (gets normalised) and radius. Optionally it can be...
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool hit() const noexcept
Is there a hit?
scalar signedDistance(const point &p) const
Return distance from the given point to the plane.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
scalarField samples(nIntervals, Zero)
const T & clip(const T &val) const
void resize(const label newSize)
Adjust allocated size of list.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Vector< scalar > vector
A scalar version of the templated Vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const point & origin() const
The plane base point.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual void getNormal(const List< pointIndexHit > &, vectorField &normals) const
From a set of points and indices get the normal.
void clear()
Clear the list, i.e. set size to zero.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
vector point
Point is a vector.
void setSize(const label newSize)
Alias for resize(const label)
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
defineTypeNameAndDebug(combustionModel, 0)