Go to the documentation of this file.
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)
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 set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
A class for handling words, derived from Foam::string.
A class for handling file names.
static std::string path(const std::string &str)
Return directory path name (part before last /)
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
autoPtr< formatter > newFormatter(std::ostream &os) const
Return new formatter based on the selected output options.
void beginPointData(vtk::formatter &fmt, label nPoints, label nFields)
Emit legacy POINT_DATA nPoints, FIELD FieldData nFields.
bool legacy() const
True if writer uses legacy file format.
fileName lessExt() const
Return file name without extension (part before last .)
Mesh consisting of general polyhedral cells.
word format(conversionProperties.get< word >("format"))
bool append() const
True if output format uses an append mode.
bool hasExt() const
Various checks for extensions.
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
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.
void beginPoints(std::ostream &os, label nPoints)
Emit header for POINTS (with trailing newline).
reduce(hasMovingMesh, orOp< bool >())
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Write topoSet in VTK format.
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
Write a list of values.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
labelList pointLabels(nPoints, -1)