Go to the documentation of this file.
66 case formatType::INLINE_ASCII:
70 case formatType::INLINE_BASE64:
74 case formatType::APPEND_BASE64:
78 case formatType::APPEND_BINARY:
82 case formatType::LEGACY_ASCII:
86 case formatType::LEGACY_BINARY:
103 for (label i=0; i < len; ++i)
114 const UList<uint8_t>&
values
118 for (
const uint8_t val :
values)
129 const globalIndex& procOffset
133 const globalIndex procAddr
135 UPstream::listGatherValues<label>(
values.size()),
140 if (Pstream::master())
143 const label offsetId = procOffset.offset(0);
144 for (
const label val :
values)
150 DynamicList<label> recvData(procAddr.maxNonLocalSize());
152 for (
const label proci : procAddr.subProcs())
154 recvData.resize_nocopy(procAddr.localSize(proci));
157 UPstream::commsTypes::scheduled,
159 recvData.data_bytes(),
160 recvData.size_bytes()
164 const label offsetId = procOffset.offset(proci);
165 for (
const label val : recvData)
176 UPstream::commsTypes::scheduled,
190 const std::string& title,
195 os <<
"# vtk DataFile Version 2.0" <<
nl;
202 const auto truncate = title.find(
'\n');
204 if (title.empty() || 0 == truncate)
209 else if (std::string::npos == truncate)
215 os << title.substr(0, truncate) <<
nl;
219 os << (binary ?
"BINARY" :
"ASCII") <<
nl;
226 const std::string& title,
227 const std::string& contentType
230 std::ostream&
os = fmt.
os();
233 if (contentType.size())
235 os <<
"DATASET " << contentType.c_str() <<
nl;
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
void writeIdentity(vtk::formatter &fmt, const label len, label start=0)
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
void fileHeader(std::ostream &os, const std::string &title, bool binary)
OBJstream os(runTime.globalPath()/outputName)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
labelRange subProcs() const noexcept
void reset(autoPtr< T > &&other) noexcept
label maxNonLocalSize() const
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
void resize_nocopy(const label len)
label offset(const label proci) const
autoPtr< vtk::formatter > newFormatter(std::ostream &os, unsigned prec=IOstream::defaultPrecision())
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
UList< label > labelUList
A UList of labels.