Go to the documentation of this file.
58 const scalar nearestDistSqr
66 const scalar parallel = (v &
normal());
71 const scalar magV =
mag(v);
79 if (
magSqr(sample -
info.rawPoint()) < nearestDistSqr)
89 void Foam::searchableDisk::findLine
98 vector v(start - origin());
101 const scalar parallel = (v & normal());
109 v -= parallel * normal();
111 const scalar magV =
mag(v);
117 info.setPoint(origin() + magV*v);
129 Foam::searchableDisk::searchableDisk
132 const point& originPoint,
133 const vector& normalVector,
138 plane(originPoint, normalVector),
153 bounds().
min() = origin() - span;
154 bounds().
max() = origin() + span;
158 Foam::searchableDisk::searchableDisk
178 if (regions_.empty())
181 regions_[0] =
"region0";
194 centres[0] = origin();
196 radiusSqr.setSize(1);
197 radiusSqr[0] =
sqr(radius_);
204 void Foam::searchableDisk::findNearest
215 info[i] = findNearest(
samples[i], nearestDistSqr[i]);
220 void Foam::searchableDisk::findLine
231 findLine(start[i],
end[i], info[i]);
243 findLine(start,
end, info);
259 findLine(start[i],
end[i], inter);
280 region.
resize(info.size());
291 normals.resize(info.size());
303 <<
"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)
bool hit() const
Is there a hit.
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.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#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.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
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)
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
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)
defineTypeNameAndDebug(combustionModel, 0)