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)
118 for (
const uint8_t val : values)
135 if (Pstream::master())
138 const label offsetId = procOffset.
localStart(0);
139 for (
const label val : values)
141 vtk::write(fmt, val + offsetId);
147 for (
const label proci :
procAddr.subProcs())
152 UPstream::commsTypes::scheduled,
159 const label offsetId = procOffset.
localStart(proci);
160 for (
const label val : recvData)
162 vtk::write(fmt, val + offsetId);
171 UPstream::commsTypes::scheduled,
172 UPstream::masterNo(),
173 values.cdata_bytes(),
185 const std::string& title,
190 os <<
"# vtk DataFile Version 2.0" <<
nl;
197 const auto truncate = title.find(
'\n');
199 if (title.empty() || 0 == truncate)
202 os <<
"File generated by OpenFOAM " << foamVersion::api <<
nl;
204 else if (std::string::npos == truncate)
210 os << title.substr(0, truncate) <<
nl;
214 os << (binary ?
"BINARY" :
"ASCII") <<
nl;
221 const std::string& title,
222 const std::string& contentType
225 std::ostream&
os = fmt.
os();
227 legacy::fileHeader(
os, title, isType<legacyRawFormatter>(fmt));
228 if (contentType.size())
230 os <<
"DATASET " << contentType.c_str() <<
nl;
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
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>, 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,.
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label localStart() const
My local start.
OBJstream os(runTime.globalPath()/outputName)
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.
autoPtr< vtk::formatter > newFormatter(std::ostream &os, unsigned prec=IOstream::defaultPrecision())
Return a default asciiFormatter.
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.
constexpr char nl
The newline '\n' character (0x0a)