48 void Foam::boundBox::calculate(
const UList<point>&
points,
const bool doReduce)
77 reduce(min_, minOp<point>());
78 reduce(max_, maxOp<point>());
90 calculate(
points, doReduce);
99 calculate(
points(), doReduce);
125 min_ =
points[indices[0]];
126 max_ =
points[indices[0]];
128 for (
label i=1; i < indices.size(); ++i)
152 pt[1] =
point(max_.x(), min_.y(), min_.z());
153 pt[2] =
point(max_.x(), max_.y(), min_.z());
154 pt[3] =
point(min_.x(), max_.y(), min_.z());
155 pt[4] =
point(min_.x(), min_.y(), max_.z());
156 pt[5] =
point(max_.x(), min_.y(), max_.z());
158 pt[7] =
point(min_.x(), max_.y(), max_.z());
248 if (!contains(
points[indices[i]]))
290 if (contains(
points[indices[i]]))
307 return point(surfPtx, surfPty, surfPtz);
323 reinterpret_cast<const char*
>(&bb.min_),
329 os.
check(
"Ostream& operator<<(Ostream&, const boundBox&)");
338 is >> bb.min_ >> bb.max_;
344 reinterpret_cast<char*
>(&bb.min_),
350 is.
check(
"Istream& operator>>(Istream&, boundBox&)");
Inter-processor communication reduction functions.
#define forAll(list, i)
Loop across all elements in list.
streamFormat format() const
Return current stream format.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
void setSize(const label)
Reset size of List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const token &)
Write token.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static bool & parRun()
Is this a parallel run?
static const Form rootMax
static const Form rootMin
A bounding box defined in terms of the points at its extremities.
point nearest(const point &) const
Return the nearest point on the boundBox to the supplied point.
static const boundBox invertedBox
A very large inverted boundBox: min/max == +/- vGreat.
static const boundBox greatBox
A very large boundBox: min/max == -/+ vGreat.
static faceList faces()
Return faces with correct point order.
void inflate(const scalar s)
Inflate box by factor*mag(span) in all dimensions.
bool contains(const point &) const
Contains point? (inside or on edge)
bool containsAny(const UList< point > &) const
Contains any of the points? (inside or on edge)
boundBox()
Construct null, setting points to zero.
tmp< pointField > points() const
Return corner points in an order corresponding to a 'hex' cell.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Istream & operator>>(Istream &, pointEdgeDist &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)