76 #ifndef Foam_UPstreamTraits_H 77 #define Foam_UPstreamTraits_H 82 #include <type_traits> 94 template<
class T>
class Vector;
95 template<
class T>
class SymmTensor;
96 template<
class T>
class Tensor;
113 template<
class T>
struct UPstream_basic_dataType;
114 template<
class T>
struct UPstream_dataType;
153 #undef defineUPstreamDataTraits 154 #define defineUPstreamDataTraits(TypeId, Type) \ 157 template<> struct UPstream_mpi_dataType<Type> : std::true_type \ 159 static constexpr auto datatype_id = UPstream::dataTypes::TypeId; \ 162 template<> struct UPstream_mpi_dataType<const Type> : std::true_type \ 164 static constexpr auto datatype_id = UPstream::dataTypes::TypeId; \ 185 #undef defineUPstreamDataTraits 189 #undef defineUPstreamDataTraits 190 #define defineUPstreamDataTraits(TypeId, Type) \ 193 template<> struct UPstream_user_dataType<Type> : std::true_type \ 195 static constexpr auto datatype_id = UPstream::dataTypes::TypeId; \ 198 template<> struct UPstream_user_dataType<const Type> : std::true_type \ 200 static constexpr auto datatype_id = UPstream::dataTypes::TypeId; \ 212 #undef defineUPstreamDataTraits 229 UPstream_mpi_dataType<std::remove_cv_t<T>>::value ||
232 std::is_integral_v<T>
233 && (sizeof(T) == sizeof(int32_t) || sizeof(T) == sizeof(int64_t))
237 using base = std::conditional_t
244 std::is_integral_v<T>
245 && (
sizeof(
T) ==
sizeof(int32_t) ||
sizeof(
T) ==
sizeof(int64_t))
249 (
sizeof(
T) ==
sizeof(int32_t)),
250 std::conditional_t<std::is_signed_v<T>, int32_t, uint32_t>,
251 std::conditional_t<std::is_signed_v<T>, int64_t, uint64_t>
290 UPstream_user_dataType<std::remove_cv_t<T>>::value
291 || UPstream_alias_dataType<T>::value
294 using base = std::conditional_t
333 struct UPstream_basic_dataType
338 UPstream_alias_dataType<T>::value
340 || UPstream_alias_dataType<typename pTraits_cmptType<T>::type>::value
344 using base = std::conditional_t
346 UPstream_alias_dataType<T>::value,
348 typename UPstream_alias_dataType
357 static constexpr std::streamsize
size(std::streamsize
n)
noexcept 367 return n*(
sizeof(
T)/
sizeof(
base));
376 static constexpr std::streamsize
size(std::streamsize
n)
noexcept 394 struct UPstream_dataType
398 UPstream_any_dataType<T>::value
399 || UPstream_any_dataType<typename pTraits_cmptType<T>::type>::value
403 using base = std::conditional_t
416 static constexpr std::streamsize
size(std::streamsize
n)
noexcept 426 return n*(
sizeof(
T)/
sizeof(
base));
432 template<>
struct UPstream_dataType<void> : UPstream_basic_dataType<void> {};
440 template<
class BinaryOp>
461 struct UPstream_opType<
Foam::maxOp<T>> : std::true_type
502 std::bool_constant<std::is_integral_v<T> || std::is_void_v<T>>
506 if constexpr (std::is_integral_v<T> || std::is_void_v<T>)
518 std::bool_constant<std::is_integral_v<T> || std::is_void_v<T>>
522 if constexpr (std::is_integral_v<T> || std::is_void_v<T>)
534 std::bool_constant<std::is_integral_v<T> || std::is_void_v<T>>
538 if constexpr (std::is_integral_v<T> || std::is_void_v<T>)
548 template<
class BinaryOp,
class T>
553 UPstream_opType<BinaryOp>::value
554 && UPstream_basic_dataType<T>::value
UPstream fundamental/aliased (excludes user-defined) data type or a component aggregate of the same...
static constexpr auto datatype_id
The corresponding UPstream::dataTypes enumeration.
Explicit handling of data type aliases. This is necessary since different systems map things like 'un...
static constexpr std::streamsize size(std::streamsize n) noexcept
The size in terms of the number of base data elements.
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements, derived from VectorSpace.
Combined query of opType and the underlying basic data type.
static constexpr auto datatype_id
The corresponding UPstream::dataTypes enumeration.
Bit-wise xor for (unsigned) integral types.
UPstream data type (fundamental or user-defined), after resolving any aliases.
static constexpr auto datatype_id
std::conditional_t< UPstream_alias_dataType< T >::value, typename UPstream_alias_dataType< T >::base, typename UPstream_alias_dataType< typename pTraits_cmptType< T >::type >::base > base
The underlying data type (if supported) or byte.
static constexpr auto datatype_id
UPstream data type corresponding to user-defined type.
A supported UPstream (MPI) reduce/window operation type.
static constexpr auto datatype_id
The corresponding UPstream::dataTypes enumeration.
byte, char, unsigned char, ...
static constexpr auto datatype_id
std::conditional_t< UPstream_any_dataType< T >::value, typename UPstream_any_dataType< T >::base, typename UPstream_any_dataType< typename pTraits_cmptType< T >::type >::base > base
The underlying data type (if supported) or byte.
static constexpr auto opcode_id
static constexpr auto opcode_id
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static constexpr std::streamsize size(std::streamsize n) noexcept
The size in terms of the number of underlying data elements.
std::conditional_t< UPstream_mpi_dataType< std::remove_cv_t< T > >::value, std::remove_cv_t< T >, std::conditional_t<(std::is_integral_v< T > &&(sizeof(T)==sizeof(int32_t)||sizeof(T)==sizeof(int64_t))), std::conditional_t<(sizeof(T)==sizeof(int32_t)), std::conditional_t< std::is_signed_v< T >, int32_t, uint32_t >, std::conditional_t< std::is_signed_v< T >, int64_t, uint64_t > >, char > > base
Bit-wise or for (unsigned) integral types.
UPstream data type corresponding to a fundamental (MPI) type.
std::conditional_t< UPstream_user_dataType< std::remove_cv_t< T > >::value, std::remove_cv_t< T >, typename UPstream_alias_dataType< T >::base > base
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
#define defineUPstreamDataTraits(TypeId, Type)
Bit-wise and for (unsigned) integral types.