74 info.setPoint(start+t*l.vec());
81Foam::boundBox Foam::searchablePlane::calcBounds()
const
87 if (
mag(normal()[dir]) - 1 < SMALL)
101Foam::searchablePlane::searchablePlane
104 const point& basePoint,
108 searchableSurface(
io),
115Foam::searchablePlane::searchablePlane
132 if (regions_.empty())
135 regions_[0] =
"region0";
166 info[i].setPoint(nearestPoint(
samples[i]));
168 if (info[i].
point().distSqr(
samples[i]) > nearestDistSqr[i])
170 info[i].setIndex(-1);
182void Foam::searchablePlane::findLine
189 info.setSize(start.size());
193 info[i] = findLine(start[i], end[i]);
205 findLine(start, end,
info);
217 findLine(start, end, nearestInfo);
222 if (nearestInfo[pointi].hit())
225 info[pointi][0] = nearestInfo[pointi];
229 info[pointi].clear();
241 region.setSize(
info.size());
252 n.setSize(
info.size());
264 <<
"Volume type not supported for plane."
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.
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 setSize(label n)
Alias for resize().
void resize(const label len)
Adjust allocated size of list.
void size(const label n)
Older name for setAddressableSize.
static constexpr direction nComponents
Number of components in this vector space.
A bounding box defined in terms of min/max extrema points.
static const boundBox greatBox
A large boundBox: min/max == -/+ ROOTVGREAT.
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 ...
plane()
Construct zero-initialised.
const point & origin() const noexcept
The plane base point.
scalar lineIntersect(const line< PointType, PointRef > &l) const
Return the cutting point between the plane and a line passing through the supplied points.
const vector & normal() const noexcept
The plane unit normal.
point nearestPoint(const point &p) const
Return nearest point in the plane for the given point.
Searching on (infinite) plane. The dictionary specifications are identical to the Foam::plane require...
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point.
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 tmp< pointField > points() const
Get the points that define the surface.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
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 findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual const boundBox & bounds() const
Return const reference to boundBox.
#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.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
line< point, const point & > linePointRef
A line using referred points.
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)