49 const bool legacy = opts_.
legacy();
52 parallel = parallel && Pstream::parRun();
65 if (Pstream::master() || !parallel)
85 os_.open(file.
lessExt() +
"." + ext);
90 os_.open(file +
"." + ext);
110 const auto& title =
set.name();
116 legacy::fileHeader<vtk::fileTag::POLY_DATA>(
format(), title);
131 .beginVTKFile<vtk::fileTag::POLY_DATA>();
138 vtk::fileAttr::NUMBER_OF_POINTS, numberOfPoints
142 const uint64_t payLoad = vtk::sizeofData<float,3>(numberOfPoints);
145 .tag(vtk::fileTag::POINTS)
146 .beginDataArray<float,3>(vtk::dataArrayAttr::POINTS);
147 format().writeSize(payLoad);
173 .endTag(vtk::fileTag::POINTS);
184 format().beginPointData();
195 legacy::intField<1>(
format(),
"pointID", numberOfPoints);
199 const uint64_t payLoad = vtk::sizeofData<label>(numberOfPoints);
201 format().beginDataArray<label>(
"pointID");
202 format().writeSize(payLoad);
226 format().endTag(vtk::fileTag::POLY_DATA)
A class for handling file names.
autoPtr< formatter > newFormatter(std::ostream &os) const
Return new formatter based on the selected output options.
labelList pointLabels(nPoints, -1)
bool writePointSet(const polyMesh &mesh, const pointSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=UPstream::parRun())
Write pointSet to VTK polydata file.
bool append() const noexcept
True if output format uses an append mode.
static std::string path(const std::string &str)
Return directory path name (part before last /)
void beginPointData(vtk::formatter &fmt, label nPoints, label nFields)
Emit legacy POINT_DATA nPoints, FIELD FieldData nFields.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void beginPoints(std::ostream &os, label nPoints)
Emit header for POINTS (with trailing newline).
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
A class for handling words, derived from Foam::string.
Write topoSet in VTK format.
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
word format(conversionProperties.get< word >("format"))
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
fileName lessExt() const
Return file name without extension (part before last .)
bool legacy() const noexcept
True if writer uses legacy file format.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
bool has_ext() const
Various checks for extensions.
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
Write a list of values.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.