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,
158 recvData.data_bytes(),
159 recvData.size_bytes()
163 const label offsetId = procOffset.localStart(proci);
164 for (
const label val : recvData)
177 UPstream::commsTypes::scheduled,
178 UPstream::masterNo(),
192 const std::string& title,
197 os <<
"# vtk DataFile Version 2.0" <<
nl;
204 const auto truncate = title.find(
'\n');
206 if (title.empty() || 0 == truncate)
211 else if (std::string::npos == truncate)
217 os << title.substr(0, truncate) <<
nl;
221 os << (binary ?
"BINARY" :
"ASCII") <<
nl;
228 const std::string& title,
229 const std::string& contentType
232 std::ostream&
os = fmt.
os();
235 if (contentType.size())
237 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)
globalIndex procAddr(aMesh.nFaces())
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
Write a list of values.