48#ifndef Foam_scalarRange_H
49#define Foam_scalarRange_H
60template<
class T>
class MinMax;
72 enum rangeTypes :
unsigned char
94 enum rangeTypes type_;
99 const rangeTypes
type,
116 static const scalarRange
always;
125 inline explicit constexpr scalarRange(const scalar val)
noexcept;
129 inline scalarRange(const scalar minVal, const scalar maxVal)
noexcept;
150 static
bool parse(const std::
string& str, scalarRange&
range);
156 static scalarRange
parse(const std::
string& str);
160 inline static constexpr scalarRange
ge(const scalar minVal)
noexcept;
163 inline static constexpr scalarRange
gt(const scalar minVal)
noexcept;
166 inline static constexpr scalarRange
ge0()
noexcept;
169 inline static constexpr scalarRange
gt0()
noexcept;
172 inline static constexpr scalarRange
le(const scalar maxVal)
noexcept;
175 inline static constexpr scalarRange
lt(const scalar maxVal)
noexcept;
207 inline scalar
value()
const;
210 inline bool contains(
const scalar val)
const;
221 inline constexpr bool operator==(
const scalarRange&
rhs)
const noexcept;
222 inline constexpr bool operator!=(
const scalarRange&
rhs)
const noexcept;
A min/max value pair with additional methods. In addition to conveniently storing values,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Scalar bounds to be used as a unary predicate.
void clear() noexcept
Same as reset() - reset to an empty (inverse, NONE) range.
bool single() const noexcept
True if the range bounds represent a single value.
void reset() noexcept
Reset to an empty (inverse, NONE) range.
scalar min() const noexcept
The min value of the range.
bool operator()(const scalar value) const
For use as a predicate, same as contains(), match().
static constexpr scalarRange ge0() noexcept
A greater-equals zero bound.
scalar value() const
A representative (average) value for the range.
static constexpr scalarRange le(const scalar maxVal) noexcept
A less-equals bound.
bool empty() const noexcept
True if range is empty (eg, inverted, NONE).
bool good() const noexcept
True if range is non-empty.
bool contains(const scalar val) const
True if the value is matched by the condition.
void print(Ostream &os) const
Print information about the range.
static bool parse(const std::string &str, scalarRange &range)
Construct by parsing string content.
scalar value_type
Type of values the range contains.
constexpr bool operator!=(const scalarRange &rhs) const noexcept
static constexpr scalarRange ge(const scalar minVal) noexcept
A greater-equals bound.
bool valid() const noexcept
Same as good() or !empty().
static constexpr scalarRange gt0() noexcept
A greater-than zero bound.
static constexpr scalarRange lt(const scalar maxVal) noexcept
A less-than bound.
friend Ostream & operator<<(Ostream &os, const scalarRange &range)
Print information about the range.
scalar max() const noexcept
The max value of the range.
bool match(const scalar value) const
True if the value is matched by the condition.
constexpr scalarRange() noexcept
Construct an empty (inverse, NONE) range - never matches.
static const scalarRange always
A range that always matches.
static constexpr scalarRange gt(const scalar minVal) noexcept
A greater-than bound.
constexpr bool operator==(const scalarRange &rhs) const noexcept
static constexpr scalarRange zero_one() noexcept
A greater-equals 0, less-equals 1 bound.
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)