34 namespace searchableSurfaces
78 info.setPoint(start+t*l.vec());
92 if (normal()[dir] > 1 - small)
94 max[dir] = refPoint()[dir];
99 if (normal()[dir] < small - 1)
101 min[dir] = refPoint()[dir];
106 return boundBox(
min,
max);
115 const point& basePoint,
149 if (regions_.empty())
152 regions_[0] =
"region0";
165 centres[0] = refPoint();
183 info[i].setPoint(nearestPoint(
samples[i]));
185 if (
magSqr(
samples[i]-info[i].rawPoint()) > nearestDistSqr[i])
187 info[i].setIndex(-1);
199 void Foam::searchableSurfaces::plane::findLine
210 info[i] = findLine(start[i], end[i]);
222 findLine(start, end, info);
234 findLine(start, end, nearestInfo);
236 info.setSize(start.
size());
239 if (nearestInfo[pointi].hit())
241 info[pointi].setSize(1);
242 info[pointi][0] = nearestInfo[pointi];
246 info[pointi].
clear();
269 n.setSize(info.
size());
283 ((
points[pointi] - refPoint()) & normal()) < 0
#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.
addToRunTimeSelectionTable(searchableSurface, box, dictionary)
defineTypeNameAndDebug(box, 0)
addBackwardCompatibleToRunTimeSelectionTable(searchableSurface, box, dictionary, searchableBox, "searchableBox")
PointIndexHit< point > pointIndexHit
line< point, const point & > linePointRef
Line using referred points.
const fvMesh & region(const dictionary &dict)
Cast the give dictionary to the corresponding region fvMesh.
vector point
Point is a vector.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
scalarField samples(nIntervals, 0)