28 #include <type_traits> 36 const word& fieldName,
45 std::is_same_v<label, cmptType>
46 || std::is_floating_point_v<cmptType>
48 "Label and Floating-point vector space only" 55 if constexpr (std::is_same_v<label, cmptType>)
59 legacy::intField<nCmpt>(
format(), fieldName, nValues);
63 const uint64_t payLoad =
64 vtk::sizeofData<label, nCmpt>(nValues);
74 legacy::floatField<nCmpt>(
format(), fieldName, nValues);
78 const uint64_t payLoad =
79 vtk::sizeofData<float, nCmpt>(nValues);
92 const word& fieldName,
94 const label nLocalValues
97 label nTotal = nLocalValues;
101 reduce(nTotal, sumOp<label>());
104 this->beginDataArray<Type>(fieldName, nTotal);
115 this->endDataArray();
122 const word& fieldName,
126 label nValues =
field.size();
133 this->beginDataArray<Type>(fieldName, nValues);
144 this->endDataArray();
autoPtr< vtk::formatter > format_
The VTK formatter in use (only valid on master process)
vtk::formatter & format()
The VTK formatter in use. FatalError for off-processor.
void writeBasicField(const word &fieldName, const UList< Type > &field)
Write basic (primitive) field content.
A traits class, which is primarily used for primitives and vector-space.
bool legacy() const noexcept
Commonly used query.
void reduce(T &value, [[maybe_unused]] BinaryOp bop, [[maybe_unused]] const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
A class for handling words, derived from Foam::string.
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
word format(conversionProperties.get< word >("format"))
void writeUniform(const word &fieldName, const Type &val, const label nValues)
Write uniform field content.
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
Write a list of values.
void writeValueParallel(vtk::formatter &fmt, const Type &val, const label count=1)
Component-wise write of a value (N times) in parallel.
void beginDataArray(const word &fieldName, const label nValues)
Start of a field or DataArray output (legacy or non-legacy).