109 return this->first();
116 return this->first();
123 return this->second();
130 return this->second();
138 return (0.5 *
min()) + (0.5 *
max());
152 return ::Foam::mag(span());
218 return (valid() && !compare(val));
231 else if (
max() < val)
251 else if (
max() < val)
283 for (
const T& val : vals)
296 return contains(val);
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
void min(const dimensioned< Type > &dt)
Use the minimum of the field and specified value.
A min/max value pair with additional methods. In addition to conveniently storing values,...
MinMax< T > & operator*=(const scalar &s)
Multiply range by scalar factor.
bool valid() const
Range is valid if it is not inverted.
bool contains(const T &val) const
True if the value is within the range.
bool empty() const
Range is empty if it is inverted.
const T & clip(const T &val) const
MinMax< T > & operator/=(const scalar &s)
Divide range by scalar factor.
bool inplaceClip(T &val) const
Inplace clip value by the min/max limits.
const T & max() const noexcept
The max value (second)
scalar mag() const
The magnitude of the min to max span. Zero if the range is invalid.
static MinMax< T > le(const T &maxVal)
A semi-infinite range from type min to maxVal.
const T & min() const noexcept
The min value (first)
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
T centre() const
The min/max average value.
void clear()
Reset to an invalid, inverted range.
MinMax< T > & operator+=(const MinMax< T > &b)
Extend min/max range to include other range.
T span() const
The min to max span. Zero if the range is invalid.
bool intersect(const MinMax< T > &b)
Intersect (union) with the second range.
int compare(const T &val) const
Compares the min/max range with the specified value.
MinMax()
Construct inverted range.
MinMax< T > & add(const MinMax &other)
Extend the range to include the other min/max range.
static MinMax< T > zero_one()
A 0-1 range corresponding to the pTraits zero, one.
int overlaps
Flag to control which overlap calculations are performed.
An ordered pair of two objects of type <T> with first() and second() elements.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Ostream & operator()() const
Output stream (master only).
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A traits class, which is primarily used for primitives.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0)
A non-counting (dummy) refCount.