44 for (label i=0; i <
n; ++i)
46 for (
direction cmpt=0; cmpt < nCmpt; ++cmpt)
61 for (
const Type& val : values)
68template<
class Type,
unsigned N>
75 for (
const Type& val : values)
90 for (
const label idx : addressing)
92 vtk::write(fmt, values[idx]);
105 for (
const label idx : selected)
107 vtk::write(fmt, values[idx]);
121 vtk::writeList(fmt, values);
122 vtk::writeList(fmt, indirect, addressing);
138 <<
"Contiguous data only" <<
endl
143 const List<label> counts(UPstream::listGatherValues(count));
144 const List<Type> values(UPstream::listGatherValues(val));
146 if (Pstream::master())
151 vtk::write(fmt, counts[i], values[i]);
168 <<
"Contiguous data only" <<
endl
177 if (Pstream::master())
180 vtk::writeList(fmt, values);
185 for (
const label proci :
procAddr.subProcs())
190 UPstream::commsTypes::scheduled,
195 vtk::writeList(fmt, recvData);
203 UPstream::commsTypes::scheduled,
204 UPstream::masterNo(),
205 values.cdata_bytes(),
224 <<
"Contiguous data only" <<
endl
230 if (!Pstream::master())
239 if (Pstream::master())
242 vtk::writeList(fmt, values, addressing);
247 for (
const label proci :
procAddr.subProcs())
252 UPstream::commsTypes::scheduled,
257 vtk::writeList(fmt, recvData);
264 UPstream::commsTypes::scheduled,
265 UPstream::masterNo(),
285 <<
"Contiguous data only" <<
endl
291 if (!Pstream::master())
293 sendData =
subset(selected, values);
300 if (Pstream::master())
303 vtk::writeList(fmt, values, selected);
308 for (
const label proci :
procAddr.subProcs())
313 UPstream::commsTypes::scheduled,
318 vtk::writeList(fmt, recvData);
325 UPstream::commsTypes::scheduled,
326 UPstream::masterNo(),
346 <<
"Contiguous data only" <<
endl
356 if (Pstream::master())
359 vtk::writeList(fmt, values1);
360 vtk::writeList(fmt, values2);
368 for (
const label proci : procAddr1.
subProcs())
374 UPstream::commsTypes::scheduled,
379 vtk::writeList(fmt, recvData);
385 UPstream::commsTypes::scheduled,
390 vtk::writeList(fmt, recvData);
397 UPstream::commsTypes::scheduled,
398 UPstream::masterNo(),
405 UPstream::commsTypes::scheduled,
406 UPstream::masterNo(),
427 <<
"Contiguous data only" <<
endl
433 if (!Pstream::master())
444 if (Pstream::master())
448 vtk::writeList(fmt, values1);
449 vtk::writeList(fmt, values2, addressing);
457 for (
const label proci : procAddr1.
subProcs())
463 UPstream::commsTypes::scheduled,
468 vtk::writeList(fmt, recvData);
474 UPstream::commsTypes::scheduled,
479 vtk::writeList(fmt, recvData);
486 UPstream::commsTypes::scheduled,
487 UPstream::masterNo(),
494 UPstream::commsTypes::scheduled,
495 UPstream::masterNo(),
Various functions to operate on Lists.
globalIndex procAddr(aMesh.nFaces())
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void resize_nocopy(const label len)
A 1D vector of objects of type <T> with a fixed length <N>.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A List with indirect addressing. Like IndirectList but does not store addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
void size(const label n)
Older name for setAddressableSize.
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label localSize() const
My local size.
labelRange subProcs() const noexcept
Range of process indices for addressed sub-offsets (processes)
label maxNonLocalSize() const
The max of localSizes, excluding current processor.
A traits class, which is primarily used for primitives.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void writeListsParallel(vtk::formatter &fmt, const UList< Type > &values1, const UList< Type > &values2)
Write a list of values and another list of values.
void writeLists(vtk::formatter &fmt, const UList< Type > &values1, const UList< Type > &values2, const labelUList &addressing)
Write a list of values and a list of values via indirect addressing.
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
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 component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.
A template class to specify that a data type can be considered as being contiguous in memory.