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(globalIndex::gatherOnly{},
values.size());
135 if (Pstream::master())
138 const label offsetId = procOffset.localStart(0);
139 for (
const label val :
values)
145 DynamicList<label> recvData(
procAddr.maxNonLocalSize());
147 for (
const label proci :
procAddr.subProcs())
149 const label procSize =
procAddr.localSize(proci);
153 recvData.resize_nocopy(procSize);
156 UPstream::commsTypes::scheduled,
162 const label offsetId = procOffset.localStart(proci);
163 for (
const label val : recvData)
176 UPstream::commsTypes::scheduled,
177 UPstream::masterNo(),
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;
constexpr char nl
The newline '\n' character (0x0a)
autoPtr< vtk::formatter > newFormatter(std::ostream &os, unsigned prec=IOstream::defaultPrecision())
Return a default asciiFormatter.
UList< label > labelUList
A UList of labels.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void fileHeader(std::ostream &os, const std::string &title, bool binary)
Emit header for legacy file (vtk DataFile Version 2.0)
void writeIdentity(vtk::formatter &fmt, const label len, label start=0)
Write an identity list of labels.
formatType
The output format type for file contents.
const int api
OpenFOAM api number (integer) corresponding to the value of OPENFOAM at the time of compilation...
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
OBJstream os(runTime.globalPath()/outputName)
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...
globalIndex procAddr(aMesh.nFaces())
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
Write a list of values.