58 const scalar nearestDistSqr
66 const scalar parallel = (v &
normal());
71 const scalar magV =
mag(v);
88void 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))
130 const point& originPoint,
131 const vector& normalVector,
132 const scalar outerRadius,
133 const scalar innerRadius
137 plane(originPoint, normalVector),
138 radialLimits_(innerRadius, outerRadius)
167 dict.get<scalar>(
"radius"),
168 dict.getOrDefault<scalar>(
"innerRadius", 0)
177 if (regions_.empty())
180 regions_.first() =
"region0";
195 centres[0] = origin();
196 radiusSqr[0] =
sqr(radialLimits_.max());
203void Foam::searchableDisk::findNearest
214 info[i] = findNearest(
samples[i], nearestDistSqr[i]);
219void Foam::searchableDisk::findLine
230 findLine(start[i], end[i], info[i]);
242 findLine(start, end, info);
253 info.setSize(start.
size());
258 findLine(start[i], end[i], inter);
302 <<
"Volume type not supported for disk."
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Minimal example by using system/controlDict.functions:
Defines the attributes of an object for which implicit objectRegistry management is supported,...
InfoProxy< IOobject > info() const
Return info proxy, for printing information to a stream.
void resize(const label len)
Adjust allocated size of list.
const T & clip(const T &val) const
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?
void size(const label n)
Older name for setAddressableSize.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
const point & origin() const noexcept
The plane base point.
const vector & normal() const noexcept
The plane unit normal.
scalar signedDistance(const point &p) const
Return distance from the given point to the plane.
Searching on circular disk given as origin, normal (gets normalised) and radius. Optionally it can be...
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first 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.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
virtual const wordList & regions() const
Names of regions.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normals) const
From a set of points and indices get the normal.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual const boundBox & bounds() const
Return const reference to boundBox.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
vector point
Point is a vector.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.
scalarField samples(nIntervals, Zero)