34template<
class Tout,
class T1,
class UnaryOp>
46 <<
"Field sizes do not match: " << result.
size() <<
" ("
56template<
class Tout,
class T1,
class T2,
class BinaryOp>
69 <<
"Field sizes do not match: " << result.
size() <<
" ("
70 << a.
size() <<
' ' <<
b.size() <<
')' <<
nl
79template<
class T,
class BinaryOp>
92 <<
"Field sizes do not match: " << result.
size() <<
" ("
93 << a.
size() <<
' ' <<
b.size() <<
')' <<
nl
100 result[i] = bop(a[i],
b[i]) ? a[i] :
b[i];
105template<
class T,
class BoolListType,
class FlipOp>
109 const BoolListType& cond,
119 <<
"Field sizes do not match: " << result.
size() <<
" ("
120 << a.
size() <<
' ' <<
b.size() <<
')' <<
nl
127 result[i] = flip(cond[i]) ? a[i] :
b[i];
132template<
class T,
class FlipOp>
146 <<
"Field sizes do not match: " << result.
size() <<
" ("
147 << a.
size() <<
' ' <<
b.size() <<
')' <<
nl
154 result[i] = flip(cond[i]) ? a[i] :
b[i];
159template<
class T1,
class T2>
171 result.first() = vals[i];
172 result.second() =
data[i];
175 Pstream::combineAllGather(result, minFirstEqOp<T1>());
180template<
class T1,
class T2>
183 const Field<T1>& vals,
184 const Field<T2>& data
187 Tuple2<T1,T2> result(pTraits<T1>::min, Zero);
192 result.first() = vals[i];
193 result.second() = data[i];
196 Pstream::combineAllGather(result, maxFirstEqOp<T1>());
Generic templated field type.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Database for solution data, solver performance and other reduced data.
A traits class, which is primarily used for primitives.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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 ternarySelect(Field< T > &result, const BoolListType &cond, const Field< T > &a, const Field< T > &b, const FlipOp &flip)
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.
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.
void ternary(Field< T > &result, const Field< T > &a, const Field< T > &b, const BinaryOp &bop)
label findMin(const ListType &input, label start=0)
errorManip< error > abort(error &err)
label findMax(const ListType &input, label start=0)
constexpr char nl
The newline '\n' character (0x0a)
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
#define forAll(list, i)
Loop across all elements in list.