58 const scalar nearestDistSqr
66 const scalar parallel = (v &
normal());
71 const scalar magV =
mag(v);
78 if (
info.point().distSqr(
sample) < nearestDistSqr)
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))
127Foam::searchableDisk::searchableDisk
130 const point& originPoint,
131 const vector& normalVector,
132 const scalar outerRadius,
133 const scalar innerRadius
136 searchableSurface(
io),
137 plane(originPoint, normalVector),
138 radialLimits_(innerRadius, outerRadius)
156Foam::searchableDisk::searchableDisk
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
223 List<pointIndexHit>& info
226 info.resize(start.size());
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);
279 region.resize(
info.size());
290 normals.resize(
info.size());
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 noexcept
Return info proxy, for printing information to a stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label len)
Adjust allocated size of list.
T clamp(const T &val) const
Return value clamped component-wise.
bool hit() const noexcept
Is there a hit?
void size(const label n)
Older name for setAddressableSize.
const point & max() const noexcept
Maximum describing the bounding box.
const point & min() const noexcept
Minimum describing the bounding box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
plane()
Construct zero-initialised.
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 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 tmp< pointField > points() const
Get the points that define the surface.
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.
List< word > wordList
List of word.
dimensionedScalar sign(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.
scalarField samples(nIntervals, Zero)