35 #ifndef Foam_MinMaxOps_H 36 #define Foam_MinMaxOps_H 40 #include <type_traits> 61 return range.clamp(val);
131 inline MinMax<T>
minMax(
const MinMax<T>&
x,
const MinMax<T>&
y)
148 return MinMax<T>(
x).
add(
y);
177 MinMax<T>&
operator()(MinMax<T>&
x,
const MinMax<T>&
y)
const 192 template<
class Form,
class Cmpt, direction nCmpt>
204 for (
const T& val : vals)
247 template<
class T1,
class T2>
268 template<
class T1,
class T2>
302 for (
const T& val :
y)
340 template<
class T,
class U>
341 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 342 operator<(const MinMax<T>&
range,
const U& val)
344 return (
range.compare(val) < 0);
347 template<
class T,
class U>
348 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 349 operator<=(const MinMax<T>&
range,
const U& val)
351 return (
range.compare(val) <= 0);
354 template<
class T,
class U>
355 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 358 return (
range.compare(val) > 0);
361 template<
class T,
class U>
362 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 365 return (
range.compare(val) >= 0);
369 template<
class T,
class U>
370 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 371 operator<(const U& val, const MinMax<T>&
range)
373 return (
range.compare(val) > 0);
376 template<
class T,
class U>
377 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 378 operator<=(const U& val, const MinMax<T>&
range)
380 return (
range.compare(val) >= 0);
383 template<
class T,
class U>
384 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 387 return (
range.compare(val) < 0);
390 template<
class T,
class U>
391 inline typename std::enable_if<std::is_convertible<U, T>::value,
bool>
::type 394 return (
range.compare(val) <= 0);
MinMax< scalar > scalarMinMax
A scalar min/max range.
clampOp(const T &min, const T &max)
Construct from min/max limits. No validity checks.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A min/max value pair with additional methods. In addition to conveniently storing values...
bool operator>(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A newer than B.
void clip(Field< Type > &result, const UList< Type > &f1, const MinMax< Type > &s2)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
bool operator>=(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A same or newer than B.
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Unary function for applying component-wise clamping.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
scalarMinMax operator()(const scalarMinMax &x, const T &y) const
MinMax< T > & operator()(MinMax< T > &x, const T &y) const
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
MinMax< T > & add(const MinMax &other)
Extend the range to include the other min/max range.
MinMax< T > operator()(const T &x, const T &y) const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Combine assignment for MinMax range.
scalarMinMax & operator()(scalarMinMax &x, const T &y) const
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &f1)
T operator()(const T &val) const
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))
Combine assignment for MinMax range.