58 const scalar nearestDistSqr
66 const scalar parallel = (v &
normal());
71 const scalar magV =
mag(v);
78 if (
info.point().distSqr(sample) < 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
136 searchableSurface(
io),
137 plane(originPoint, normalVector),
138 radialLimits_(innerRadius, outerRadius)
156 Foam::searchableDisk::searchableDisk
168 dict.getOrDefault<scalar>(
"innerRadius", 0)
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
223 List<pointIndexHit>& info
226 info.resize(start.size());
230 findLine(start[i],
end[i], info[i]);
239 List<pointIndexHit>& info
242 findLine(start,
end, info);
253 info.setSize(start.
size());
258 findLine(start[i],
end[i], inter);
275 const List<pointIndexHit>& info,
279 region.resize(info.size());
302 <<
"Volume type not supported for disk." List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dimensionedScalar sign(const dimensionedScalar &ds)
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar signedDistance(const point &p) const
Return distance from the given point to the plane.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
scalarField samples(nIntervals, Zero)
dimensionedScalar sqrt(const dimensionedScalar &ds)
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normals) const
From a set of points and indices get the normal.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
const point & min() const noexcept
Minimum describing the bounding box.
virtual const boundBox & bounds() const
Return const reference to boundBox.
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
#define forAll(list, i)
Loop across all elements in list.
const point & max() const noexcept
Maximum describing the bounding box.
const point & origin() const noexcept
The plane base point.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
vectorField pointField
pointField is a vectorField.
T clamp(const T &val) const
Return value clamped component-wise.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
InfoProxy< IOobject > info() const noexcept
Return info proxy, for printing information to a stream.
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
defineTypeNameAndDebug(combustionModel, 0)
virtual const wordList & regions() const
Names of regions.
bool hit() const noexcept
Is there a hit?
vector point
Point is a vector.
Searching on circular disk given as origin, normal (gets normalised) and radius. Optionally it can be...
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
const vector & normal() const noexcept
The plane unit normal.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)