34 namespace searchableSurfaces
78 info.setPoint(start+t*l.vec());
91 if (
mag(normal()[dir]) - 1 < small)
101 return boundBox(
min,
max);
110 const point& basePoint,
144 if (regions_.empty())
147 regions_[0] =
"region0";
160 centres[0] = refPoint();
178 info[i].setPoint(nearestPoint(
samples[i]));
180 if (
magSqr(
samples[i]-info[i].rawPoint()) > nearestDistSqr[i])
182 info[i].setIndex(-1);
194 void Foam::searchableSurfaces::plane::findLine
205 info[i] = findLine(start[i], end[i]);
217 findLine(start, end, info);
229 findLine(start, end, nearestInfo);
231 info.setSize(start.
size());
234 if (nearestInfo[pointi].hit())
236 info[pointi].setSize(1);
237 info[pointi][0] = nearestInfo[pointi];
241 info[pointi].
clear();
264 n.setSize(info.
size());
276 <<
"Volume type not supported for plane."
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
InfoProxy< IOobject > info() const
Return info proxy.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label)
Reset size of List.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
static const direction nComponents
Number of components in this vector space.
A bounding box defined in terms of the points at its extremities.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
scalar lineIntersect(const line< Point, PointRef > &l) const
Return the cutting point between the plane and.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
const boundBox & bounds() const
Return const reference to boundBox.
Surface geometry of an infinite plane, which can be used with snappyHexMesh.
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
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 ~plane()
Destructor.
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
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
plane(const IOobject &io, const point &basePoint, const vector &normal)
Construct from components.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
addToRunTimeSelectionTable(searchableSurface, box, dictionary)
defineTypeNameAndDebug(box, 0)
addBackwardCompatibleToRunTimeSelectionTable(searchableSurface, box, dictionary, searchableBox, "searchableBox")
errorManipArg< error, int > exit(error &err, const int errNo=1)
PointIndexHit< point > pointIndexHit
line< point, const point & > linePointRef
Line using referred points.
vector point
Point is a vector.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
scalarField samples(nIntervals, 0)