33 template<
class Tout,
class T1,
class UnaryOp>
45 <<
"Field sizes do not match: " << result.
size() <<
" (" 55 template<
class Tout,
class T1,
class T2,
class BinaryOp>
68 <<
"Field sizes do not match: " << result.
size() <<
" (" 69 << a.
size() <<
' ' <<
b.size() <<
')' <<
nl 78 template<
class T,
class BinaryOp>
91 <<
"Field sizes do not match: " << result.
size() <<
" (" 92 << a.
size() <<
' ' <<
b.size() <<
')' <<
nl 99 result[i] = bop(a[i],
b[i]) ? a[i] :
b[i];
104 template<
class T,
class BoolListType,
class FlipOp>
108 const BoolListType& cond,
115 if (result.size() != a.size() || result.size() !=
b.size())
118 <<
"Field sizes do not match: " << result.size() <<
" (" 119 << a.size() <<
' ' <<
b.size() <<
')' <<
nl 126 result[i] = flip(cond[i]) ? a[i] :
b[i];
131 template<
class T,
class FlipOp>
142 if (result.size() != a.size() || result.size() !=
b.size())
145 <<
"Field sizes do not match: " << result.size() <<
" (" 146 << a.size() <<
' ' <<
b.size() <<
')' <<
nl 153 result[i] = flip(cond[i]) ? a[i] :
b[i];
158 template<
class T1,
class T2>
161 const Field<T1>& vals,
162 const Field<T2>& data
170 result.
first() = vals[i];
171 result.second() = data[i];
179 template<
class T1,
class T2>
182 const Field<T1>& vals,
183 const Field<T2>& data
191 result.
first() = vals[i];
192 result.second() = data[i];
label findMax(const ListType &input, label start=0)
Linear search for the index of the max element, similar to std::max_element but for lists and returns...
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
void size(const label n)
Older name for setAddressableSize.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
void ternarySelect(Field< T > &result, const BoolListType &cond, const Field< T > &a, const Field< T > &b, const FlipOp &flip)
Emulate a ternary operation, selecting values from a or b depending on the conditional.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
void combineReduce(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Compatibility wrapper for Pstream::combineReduce.
Type & first()
Access first element of the list, position [0].
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
Tuple2< T1, T2 > findMaxData(const Field< T1 > &vals, const Field< T2 > &data)
Locate the max value in a field and return it and associated data.
#define forAll(list, i)
Loop across all elements in list.
label findMin(const ListType &input, label start=0)
Linear search for the index of the min element, similar to std::min_element but for lists and returns...
Generic templated field type.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Tuple2< T1, T2 > findMinData(const Field< T1 > &vals, const Field< T2 > &data)
Locate the min value in a field and return it and associated data.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void assign(Field< Tout > &result, const Field< T1 > &a, const UnaryOp &op)
Populate a field as the result of a unary operation on an input.
void ternary(Field< T > &result, const Field< T > &a, const Field< T > &b, const BinaryOp &bop)
Emulate a ternary operation, selecting values from a or b depending on the binary predicate...
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
static constexpr const zero Zero
Global zero (0)