Go to the documentation of this file.
51 if (planePt[dir] ==
min()[dir])
55 else if (planePt[dir] ==
max()[dir])
62 <<
"Point on plane " << planePt
63 <<
" is not on coordinate " <<
min()[dir]
74 const scalar nearestDistSqr
95 for (
direction dir = 0; dir < vector::nComponents; dir++)
99 projectOntoCoordPlane(dir,
min(), info);
104 projectOntoCoordPlane(dir,
max(), info);
107 else if (info.
rawPoint()[dir] > bbMid[dir])
109 near[dir] =
max()[dir];
113 near[dir] =
min()[dir];
124 if (dist.
x() < dist.
y())
126 if (dist.
x() < dist.
z())
129 projectOntoCoordPlane(vector::X, near, info);
133 projectOntoCoordPlane(vector::Z, near, info);
138 if (dist.
y() < dist.
z())
140 projectOntoCoordPlane(
vector::Y, near, info);
144 projectOntoCoordPlane(vector::Z, near, info);
173 if (!contains(midpoint()))
176 <<
"Illegal bounding box specification : "
180 bounds() =
static_cast<boundBox>(*this);
193 if (!contains(midpoint()))
196 <<
"Illegal bounding box specification : "
200 bounds() =
static_cast<boundBox>(*this);
214 if (regions_.empty())
217 regions_[0] =
"region0";
233 ctrs[i] = fcs[i].centre(pts);
246 centres.setSize(size());
247 radiusSqr.setSize(size());
255 const face&
f = fcs[i];
257 centres[i] =
f.centre(pts);
260 const point& pt = pts[
f[fp]];
284 const scalar nearestDistSqr
287 return findNearest(midpoint(), sample, nearestDistSqr);
294 const scalar nearestDistSqr
297 const point bbMid(midpoint());
301 bool outside =
false;
310 projectOntoCoordPlane(dir,
min(), info);
315 projectOntoCoordPlane(dir,
max(), info);
318 else if (info.
rawPoint()[dir] > bbMid[dir])
320 near[dir] =
max()[dir];
324 near[dir] =
min()[dir];
337 sortedDist[0] = dist[0];
338 sortedDist[1] = dist[1];
339 sortedDist[2] = dist[2];
343 projectOntoCoordPlane(sortedDist.
indices()[0], near, info);
345 projectOntoCoordPlane(sortedDist.
indices()[1], near, info);
383 if (posBits(start) == 0)
385 if (posBits(end) == 0)
393 foundInter = intersects(end, start, info.
rawPoint());
399 foundInter = intersects(start, end, info.
rawPoint());
422 if (info.
index() == -1)
426 <<
" on segment " << start << end
427 <<
" should be on face of " << *
this
442 return findLine(start, end);
455 const point bbMid(midpoint());
459 info[i] = findNearest(bbMid,
samples[i], nearestDistSqr[i]);
475 info[i] = findLine(start[i], end[i]);
491 info[i] = findLineAny(start[i], end[i]);
519 +
vector(ROOTVSMALL,ROOTVSMALL,ROOTVSMALL)
534 while (((pt-start[pointI])&dirVec[pointI]) <= magSqrDirVec[pointI])
544 || (inter.
index() == hits.last().index())
551 pt = inter.
hitPoint() + smallVec[pointI];
558 info[pointI].
clear();
613 if (pt[dir] <
min()[dir] || pt[dir] >
max()[dir])
vectorField pointField
pointField is a vectorField.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label index() const
Return index.
virtual ~searchableBox()
Destructor.
pointIndexHit findLine(const point &start, const point &end) const
Find nearest intersection of line between start and end.
void setIndex(const label index)
void sort()
(stable) sort the list (if changed after construction time)
#define forAll(list, i)
Loop across all elements in list.
tmp< pointField > points() const
Vertex coordinates. In octant coding.
A class for managing temporary objects.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
pointIndexHit findLineAny(const point &start, const point &end) const
Find any intersection of line between start and end.
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
Standard boundBox + extra functionality for use in octree.
bool hit() const
Is there a hit.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
@ nComponents
Number of components in this vector space.
static const FixedList< vector, 6 > faceNormals
Per face the unit normal.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const
Get all intersections in order from start to end.
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
scalarField samples(nIntervals, 0)
pointIndexHit findNearest(const point &bbMid, const point &sample, const scalar nearestDistSqr) const
Returns miss or hit with face (0..5)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & rawPoint() const
Return point with no checking.
pointIndexHit findNearestOnEdge(const point &sample, const scalar nearestDistSqr) const
Calculate nearest point on edge.
Pre-declare SubField and related Field type.
const Point & hitPoint() const
Return hit point.
static const faceList faces
Face to point addressing.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
void clear()
Clear the addressed list, i.e. set the size to zero.
searchableBox(const searchableBox &)
Disallow default bitwise copy construct.
virtual tmp< pointField > points() const
Get the points that define the surface.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A list that is sorted upon construction or when explicitly requested with the sort() method.
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
Vector< scalar > vector
A scalar version of the templated Vector.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual const wordList & regions() const
Names of regions.
void clear()
Clear the list, i.e. set size to zero.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
A bounding box defined in terms of the points at its extremities.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
void projectOntoCoordPlane(const direction dir, const point &planePt, pointIndexHit &info) const
Project onto component dir of planePt and update index() (=face)
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
PtrList< volScalarField > & Y
A normal distribution model.