49 const bool legacy = opts_.
legacy();
52 parallel = parallel && Pstream::parRun();
65 if (Pstream::master() || !parallel)
70 const word ext = vtk::fileExtension[vtk::fileTag::POLY_DATA];
81 : file.
hasExt(vtk::legacy::fileExtension)
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);
120 legacy::beginPoints(os_, numberOfPoints);
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);
180 legacy::beginPointData(
format(), numberOfPoints, 1);
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)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
reduce(hasMovingMesh, orOp< bool >())
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .)
static std::string path(const std::string &str)
Return directory path name (part before last /)
bool hasExt() const
Various checks for extensions.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Mesh consisting of general polyhedral cells.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
autoPtr< formatter > newFormatter(std::ostream &os) const
Return new formatter based on the selected output options.
bool legacy() const noexcept
True if writer uses legacy file format.
bool append() const noexcept
True if output format uses an append mode.
A class for handling words, derived from Foam::string.
Write topoSet in VTK format.
bool writePointSet(const polyMesh &mesh, const pointSet &set, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
Write pointSet to VTK polydata file.
word format(conversionProperties.get< word >("format"))
labelList pointLabels(nPoints, -1)