35 vector(-GREAT, -GREAT, -GREAT),
36 vector(GREAT, GREAT, GREAT)
42 vector(GREAT, GREAT, GREAT),
43 vector(-GREAT, -GREAT, -GREAT)
63 initListList<face, label, 6, 4>(facesArray)
107 edges[edgeI][0] = edgesArray[edgeI][0];
108 edges[edgeI][1] = edgesArray[edgeI][1];
116 FixedList<vector, 6> normals;
136 <<
"cannot find bounding box for zero-sized pointField, " 137 <<
"returning zero" <<
endl;
155 <<
"cannot find bounding box for zero-sized pointField, " 156 <<
"returning zero" <<
endl;
172 points[octant] =
corner(octant);
194 <<
"octant should be [0..7]" 236 const point& overallStart,
264 for (
label i = 0; i < 4; ++i)
275 if ((ptBits & endBits) != 0)
287 scalar
s = (
min().
x() - overallStart.
x())/overallVec.
x();
289 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
290 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
304 scalar
s = (
max().
x() - overallStart.
x())/overallVec.
x();
306 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
307 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
319 scalar
s = (
min().
y() - overallStart.
y())/overallVec.
y();
320 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
322 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
334 scalar
s = (
max().
y() - overallStart.
y())/overallVec.
y();
335 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
337 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
349 scalar
s = (
min().
z() - overallStart.
z())/overallVec.
z();
350 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
351 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
364 scalar
s = (
max().
z() - overallStart.
z())/overallVec.
z();
365 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
366 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
389 return intersects(start, end-start, start, end, pt, ptBits);
399 if (pt[cmpt] <
min()[cmpt])
403 else if (pt[cmpt] ==
min()[cmpt])
412 if (pt[cmpt] >
max()[cmpt])
416 else if (pt[cmpt] ==
max()[cmpt])
434 if (pt.
x() ==
min().
x())
438 else if (pt.
x() ==
max().
x())
443 if (pt.
y() ==
min().
y())
447 else if (pt.
y() ==
max().
y())
452 if (pt.
z() ==
min().
z())
456 else if (pt.
z() ==
max().
z())
468 if (pt.
x() <
min().
x())
472 else if (pt.
x() >
max().
x())
477 if (pt.
y() <
min().
y())
481 else if (pt.
y() >
max().
y())
486 if (pt.
z() <
min().
z())
490 else if (pt.
z() >
max().
z())
505 scalar nearX, nearY, nearZ;
506 scalar farX, farY, farZ;
541 nearest =
point(nearX, nearY, nearZ);
542 furthest =
point(farX, farY, farZ);
565 point nearThis, farThis;
570 const scalar minDistThis =
571 sqr(nearThis.
x() - pt.
x())
572 +
sqr(nearThis.
y() - pt.
y())
573 +
sqr(nearThis.
z() - pt.
z());
574 const scalar maxDistThis =
575 sqr(farThis.
x() - pt.
x())
576 +
sqr(farThis.
y() - pt.
y())
577 +
sqr(farThis.
z() - pt.
z());
583 point nearOther, farOther;
588 const scalar minDistOther =
589 sqr(nearOther.x() - pt.
x())
590 +
sqr(nearOther.y() - pt.
y())
591 +
sqr(nearOther.z() - pt.
z());
592 const scalar maxDistOther =
593 sqr(farOther.x() - pt.
x())
594 +
sqr(farOther.y() - pt.
y())
595 +
sqr(farOther.z() - pt.
z());
600 if (maxDistThis < minDistOther)
605 else if (minDistThis > maxDistOther)
625 static_cast<const boundBox&>(b)
640 return os << static_cast<const boundBox&>(bb);
646 return is >>
static_cast<boundBox&
>(bb);
static const FixedList< vector, 6 > faceNormals
Per face the unit normal.
boundBox()
Construct null, setting points to zero.
scalar maxDist(const point &) const
Returns distance point to furthest away corner.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void calcExtremities(const point &pt, point &nearest, point &furthest) const
Calculate nearest and furthest (to point) vertex coords of.
A 1D vector of objects of type <T> with a fixed size <Size>.
const point & min() const
Minimum describing the bounding box.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static const treeBoundBox greatBox
As per boundBox::greatBox, but with GREAT instead of VGREAT.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
static faceList faces()
Return faces with correct point order.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const point & max() const
Maximum describing the bounding box.
point midpoint() const
The midpoint of the bounding box.
A bounding box defined in terms of the points at its extremities.
Vector< scalar > vector
A scalar version of the templated Vector.
Various functions to operate on Lists.
direction faceBits(const point &) const
Code position of point on bounding box faces.
bool intersects(const point &overallStart, const vector &overallVec, const point &start, const point &end, point &pt, direction &ptBits) const
Intersects segment; set point to intersection position and face,.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
direction posBits(const point &) const
Position of point relative to bounding box.
vectorField pointField
pointField is a vectorField.
treeBoundBox()
Construct null setting points to zero.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Istream & operator>>(Istream &, directionInfo &)
static const edgeList edges
Edge to point addressing.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label distanceCmp(const point &, const treeBoundBox &other) const
Compare distance to point with other bounding box.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
point corner(const direction) const
Corner point given octant.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
tmp< pointField > points() const
Vertex coordinates. In octant coding.
Ostream & operator<<(Ostream &, const ensightPart &)
static const treeBoundBox invertedBox
As per boundBox::invertedBox, but with GREAT instead of VGREAT.
Standard boundBox + extra functionality for use in octree.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
treeBoundBox subBbox(const direction) const
Sub box given by octant number. Midpoint calculated.
T & ref() const
Return non-const reference or generate a fatal error.
bool operator!=(const particle &, const particle &)
static const scalar great
The great value used for greatBox and invertedBox.