Go to the documentation of this file.
35 vector(-GREAT, -GREAT, -GREAT),
36 vector(GREAT, GREAT, GREAT)
42 vector(GREAT, GREAT, GREAT),
43 vector(-GREAT, -GREAT, -GREAT)
62 initListList<face, label, 6, 4>(facesArray)
105 edges[edgeI][0] = edgesArray[edgeI][0];
106 edges[edgeI][1] = edgesArray[edgeI][1];
115 normals[LEFT] =
vector(-1, 0, 0);
116 normals[RIGHT] =
vector( 1, 0, 0);
117 normals[BOTTOM] =
vector( 0, -1, 0);
118 normals[TOP] =
vector( 0, 1, 0);
119 normals[BACK] =
vector( 0, 0, -1);
120 normals[FRONT] =
vector( 0, 0, 1);
134 <<
"cannot find bounding box for zero-sized pointField, "
135 <<
"returning zero" <<
endl;
153 <<
"cannot find bounding box for zero-sized pointField, "
154 <<
"returning zero" <<
endl;
171 points[octant] = corner(octant);
180 return subBbox(midpoint(), octant);
194 <<
"octant should be [0..7]"
254 const point& overallStart,
266 for (
label i = 0; i < 4; ++i)
273 ptOnFaces = faceBits(pt);
277 if ((ptBits & endBits) != 0)
280 ptOnFaces = faceBits(pt);
284 if (ptBits & LEFTBIT)
289 scalar
s = (
min().x() - overallStart.
x())/overallVec.
x();
291 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
292 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
301 else if (ptBits & RIGHTBIT)
306 scalar
s = (
max().x() - overallStart.
x())/overallVec.
x();
308 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
309 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
316 else if (ptBits & BOTTOMBIT)
321 scalar
s = (
min().y() - overallStart.
y())/overallVec.
y();
322 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
324 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
331 else if (ptBits & TOPBIT)
336 scalar
s = (
max().y() - overallStart.
y())/overallVec.
y();
337 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
339 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
346 else if (ptBits & BACKBIT)
351 scalar
s = (
min().z() - overallStart.
z())/overallVec.
z();
352 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
353 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
361 else if (ptBits & FRONTBIT)
366 scalar
s = (
max().z() - overallStart.
z())/overallVec.
z();
367 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
368 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
391 return intersects(start, end-start, start, end, pt, ptBits);
402 if (pt[cmpt] <
min()[cmpt])
406 else if (pt[cmpt] ==
min()[cmpt])
415 if (pt[cmpt] >
max()[cmpt])
419 else if (pt[cmpt] ==
max()[cmpt])
438 if (pt.
x() ==
min().
x())
442 else if (pt.
x() ==
max().
x())
444 faceBits |= RIGHTBIT;
447 if (pt.
y() ==
min().
y())
449 faceBits |= BOTTOMBIT;
451 else if (pt.
y() ==
max().
y())
456 if (pt.
z() ==
min().z())
460 else if (pt.
z() ==
max().z())
462 faceBits |= FRONTBIT;
473 if (pt.
x() <
min().
x())
477 else if (pt.
x() >
max().
x())
482 if (pt.
y() <
min().
y())
484 posBits |= BOTTOMBIT;
486 else if (pt.
y() >
max().
y())
491 if (pt.
z() <
min().z())
495 else if (pt.
z() >
max().z())
512 scalar nearX, nearY, nearZ;
513 scalar farX, farY, farZ;
548 nearest =
point(nearX, nearY, nearZ);
549 furthest =
point(farX, farY, farZ);
556 calcExtremities(pt, near, far);
575 point nearThis, farThis;
578 calcExtremities(pt, nearThis, farThis);
580 const scalar minDistThis =
581 sqr(nearThis.
x() - pt.
x())
582 +
sqr(nearThis.
y() - pt.
y())
583 +
sqr(nearThis.
z() - pt.
z());
584 const scalar maxDistThis =
585 sqr(farThis.
x() - pt.
x())
586 +
sqr(farThis.
y() - pt.
y())
587 +
sqr(farThis.
z() - pt.
z());
593 point nearOther, farOther;
598 const scalar minDistOther =
599 sqr(nearOther.
x() - pt.
x())
600 +
sqr(nearOther.
y() - pt.
y())
601 +
sqr(nearOther.
z() - pt.
z());
602 const scalar maxDistOther =
603 sqr(farOther.
x() - pt.
x())
604 +
sqr(farOther.
y() - pt.
y())
605 +
sqr(farOther.
z() - pt.
z());
610 if (maxDistThis < minDistOther)
615 else if (minDistThis > maxDistOther)
650 return os << static_cast<const boundBox&>(bb);
656 return is >>
static_cast<boundBox&
>(bb);
vectorField pointField
pointField is a vectorField.
const point & max() const
Maximum describing the bounding box.
#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.
Standard boundBox + extra functionality for use in octree.
void calcExtremities(const point &pt, point &nearest, point &furthest) const
Calculate nearest and furthest (to point) vertex coords of.
direction posBits(const point &) const
Position of point relative to bounding box.
static const treeBoundBox greatBox
As per boundBox::greatBox, but with GREAT instead of VGREAT.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
treeBoundBox subBbox(const direction) const
Sub box given by octant number. Midpoint calculated.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const edgeList edges
Edge to point addressing.
treeBoundBox()
Construct null setting points to zero.
dimensioned< scalar > mag(const dimensioned< Type > &)
static const FixedList< vector, 6 > faceNormals
Per face the unit normal.
static FixedList< vector, 6 > calcFaceNormals()
To initialise faceNormals.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
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,.
static const faceList faces
Face to point addressing.
const point & min() const
Minimum describing the bounding box.
Ostream & operator<<(Ostream &, const edgeMesh &)
scalar maxDist(const point &) const
Returns distance point to furthest away corner.
bool operator!=(const particle &, const particle &)
static edgeList calcEdges(const label[12][2])
To initialise edges.
errorManip< error > abort(error &err)
Vector< scalar > vector
A scalar version of the templated Vector.
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))
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
static const treeBoundBox invertedBox
As per boundBox::invertedBox, but with GREAT instead of VGREAT.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
direction faceBits(const point &) const
Code position of point on bounding box faces.
A 1D vector of objects of type <T> with a fixed size <Size>.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Istream & operator>>(Istream &, edgeMesh &)
label distanceCmp(const point &, const treeBoundBox &other) const
Compare distance to point with other bounding box.
static const scalar great
The great value used for greatBox and invertedBox.
A bounding box defined in terms of the points at its extremities.
bool empty() const
Return true if the UList is empty (ie, size() is zero).
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
vector point
Point is a vector.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#define WarningInFunction
Report a warning using Foam::Warning.