Write as points/lines, optionally with fields, as a vtp file or a legacy vtk file. More...
#include <foamVtkCoordSetWriter.H>


Public Types | |
| enum | elemOutputType { NO_ELEMENTS = 0 , DEFAULT_ELEMENTS = 1 , POINT_ELEMENTS = 2 , LINE_ELEMENTS = 3 } |
| Types of element output. More... | |
Public Member Functions | |
| coordSetWriter (const coordSetWriter &)=delete | |
| No copy construct. | |
| void | operator= (const coordSetWriter &)=delete |
| No copy assignment. | |
| coordSetWriter (const UPtrList< const pointField > &pts, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64) | |
| Construct from components (default format INLINE_BASE64). | |
| coordSetWriter (const UPtrList< const pointField > &pts, const fileName &file, bool paralel=false) | |
| Construct from components (default format INLINE_BASE64), and open the file for writing. | |
| coordSetWriter (const UPtrList< const pointField > &pts, const vtk::outputOptions opts, const fileName &file, bool paralel=false) | |
| Construct from components and open the file for writing. | |
| virtual | ~coordSetWriter ()=default |
| Destructor. | |
| void | setElementType (const elemOutputType elemOutput) |
| Define preferred element type. | |
| virtual bool | open (const fileName &file, bool parallel=false) |
| Open file for writing. Non-parallel only. | |
| virtual void | setTime (const instant &inst) |
| Define a time name/value for the output. | |
| virtual bool | beginFile (std::string title="") |
| Write file header (non-collective). | |
| virtual bool | writeGeometry () |
| Write patch topology. | |
| void | writeTimeValue () |
| Write the currently set time as "TimeValue" FieldData. | |
| void | piece (const UPtrList< const pointField > &points) |
| Reset point references to begin a new piece. | |
| bool | writeProcIDs () |
| Write processor ids for each line as CellData or for each point as PointData, depending on isPointData() state. No-op in serial. | |
| template<class Type> | |
| void | writePointData (const word &fieldName, const UPtrList< const Field< Type > > &fieldPtrs) |
| Write primitive field of PointData. | |
| void | writeTimeValue (scalar timeValue) |
| Write "TimeValue" FieldData (name as per Catalyst output). | |
| Public Member Functions inherited from polyWriter | |
| polyWriter (const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64) | |
| Construct from components (default format INLINE_BASE64). | |
| polyWriter (const fileName &file, bool parallel=UPstream::parRun()) | |
| Construct from components (default format INLINE_BASE64), and open the file for writing. | |
| polyWriter (const vtk::outputOptions opts, const fileName &file, bool parallel=UPstream::parRun()) | |
| Construct from components and open the file for writing. | |
| virtual | ~polyWriter ()=default |
| Destructor. | |
| bool | writeLineGeometry (const pointField &points, const edgeList &edges) |
| Low-level write edge/point topology. Normally used by writeGeometry() in a derived class. | |
| bool | writePolyGeometry (const pointField &points, const faceList &faces) |
| Low-level write face/point topology. Normally used by writeGeometry() in a derived class. | |
| virtual bool | beginCellData (label nFields=0) |
| Begin CellData output section for specified number of fields. | |
| virtual bool | beginPointData (label nFields=0) |
| Begin PointData for specified number of fields. | |
| template<class Type> | |
| void | write (const word &fieldName, const UList< Type > &field) |
| Write primitive field of CellData (Poly or Line) or PointData values. | |
| template<class Type> | |
| void | writeCellData (const word &fieldName, const UList< Type > &field) |
| Write primitive field of CellData. | |
| template<class Type> | |
| void | writePointData (const word &fieldName, const UList< Type > &field) |
| Write primitive field of PointData. | |
| word | ext () const |
| File extension for current format type. | |
| Public Member Functions inherited from fileWriter | |
| fileWriter (const vtk::fileTag contentType, const vtk::outputOptions opts) | |
| Construct from components. | |
| virtual | ~fileWriter () |
| Destructor. | |
| vtk::fileTag | contentType () const noexcept |
| The content type. | |
| vtk::outputOptions | opts () const noexcept |
| The output options in use. | |
| word | ext () const |
| File extension for current format type. | |
| bool | legacy () const noexcept |
| Commonly used query. | |
| bool | parallel () const noexcept |
| Parallel output requested? | |
| const word & | state () const |
| The output state in printable format. | |
| const fileName & | output () const noexcept |
| The current output file name. | |
| void | close () |
| End the file contents and close the file after writing. | |
| bool | beginFieldData (label nFields=0) |
| Begin FieldData output section for specified number of fields. | |
| bool | isCellData () const noexcept |
| True if output state corresponds to CELL_DATA. | |
| bool | isPointData () const noexcept |
| True if output state corresponds to POINT_DATA. | |
| label | nCellData () const noexcept |
| The number of CellData written for the Piece thus far. | |
| label | nPointData () const noexcept |
| The number of PointData written for the Piece thus far. | |
| bool | endFieldData () |
| Explicitly end FieldData output and switch to DECLARED state. | |
| bool | endCellData () |
| Explicitly end CellData output and switch to PIECE state. | |
| bool | endPointData () |
| Explicitly end PointData output and switch to PIECE state. | |
| void | writeTimeValue (scalar timeValue) |
| Write "TimeValue" FieldData (name as per Catalyst output). | |
Additional Inherited Members | |
| Static Public Member Functions inherited from polyWriter | |
| static word | ext (vtk::outputOptions opts) |
| File extension for given output type. | |
| Protected Types inherited from fileWriter | |
| enum class | outputState : uint8_t { CLOSED = 0 , OPENED , DECLARED , FIELD_DATA , PIECE , CELL_DATA , POINT_DATA } |
| Internal tracking of the output state. More... | |
| Protected Member Functions inherited from polyWriter | |
| template<class Type> | |
| void | writeUniformValue (const label nCellValues, const word &fieldName, const Type &val) |
| Write a uniform field of Cell (Poly or Line) or Point values. | |
| Protected Member Functions inherited from fileWriter | |
| void | checkFormatterValidity () const |
| Verify that formatter in either allocated or not required. | |
| Ostream & | reportBadState (Ostream &, outputState expected) const |
| Generate message reporting bad writer state. | |
| Ostream & | reportBadState (Ostream &, outputState, outputState) const |
| Generate message reporting bad writer state. | |
| std::ofstream & | os () noexcept |
| The backend ostream in use. | |
| vtk::formatter & | format () |
| The VTK formatter in use. FatalError for off-processor. | |
| bool | isState (outputState test) const noexcept |
| True if output state corresponds to the test state. | |
| bool | notState (outputState test) const noexcept |
| True if output state does not correspond to the test state. | |
| template<class Type> | |
| void | beginDataArray (const word &fieldName, const label nValues) |
| Start of a field or DataArray output (legacy or non-legacy). | |
| void | endDataArray () |
| Flush formatter and end of DataArray output (non-legacy). | |
| void | beginPoints (const label nPoints) |
| Start of a POINTS DataArray. | |
| void | endPoints () |
| End of a POINTS DataArray. | |
| bool | enter_Piece () |
| Trigger change state to Piece. Resets nCellData_, nPointData_. | |
| bool | endPiece () |
| Explicitly end Piece output and switch to DECLARED state. | |
| bool | enter_CellData (label nEntries, label nFields) |
| Trigger change state to CellData. | |
| bool | enter_PointData (label nEntries, label nFields) |
| Trigger change state to PointData. | |
| bool | exit_File () |
| Emit file footer (end data, end piece, end file). | |
| template<class Type> | |
| void | writeUniform (const word &fieldName, const Type &val, const label nValues) |
| Write uniform field content. | |
| template<class Type> | |
| void | writeBasicField (const word &fieldName, const UList< Type > &field) |
| Write basic (primitive) field content. | |
| bool | writeProcIDs (const label nValues) |
| Write nValues of processor ids as CellData or PointData (no-op in serial). | |
| fileWriter (const fileWriter &)=delete | |
| No copy construct. | |
| void | operator= (const fileWriter &)=delete |
| No copy assignment. | |
| Protected Attributes inherited from polyWriter | |
| label | numberOfPoints_ |
| The number of field points for the current Piece. | |
| label | numberOfCells_ |
| The number of field cells (edges or faces) for the current Piece. | |
| label | nLocalPoints_ |
| Local number of points. | |
| label | nLocalVerts_ |
| Local number of vertices (points). | |
| label | nLocalLines_ |
| Local number of lines (edges). | |
| label | nLocalPolys_ |
| Local number of polys (faces). | |
| Protected Attributes inherited from fileWriter | |
| outputState | state_ |
| The output state. | |
| vtk::fileTag | contentType_ |
| The content type (PolyData, UnstructuredGrid ...). | |
| bool | parallel_ |
| Parallel writing (via master). | |
| vtk::outputOptions | opts_ |
| Requested output options. | |
| label | nCellData_ |
| The number of CellData written for the Piece thus far. | |
| label | nPointData_ |
| The number of PointData written for the Piece thus far. | |
| fileName | outputFile_ |
| The output file name. | |
| autoPtr< vtk::formatter > | format_ |
| The VTK formatter in use (only valid on master process). | |
| std::ofstream | os_ |
| The backend ostream in use (only opened on master process). | |
| Static Protected Attributes inherited from fileWriter | |
| static const Enum< outputState > | stateNames |
| Names for the output state (for messages, not for file output). | |
Write as points/lines, optionally with fields, as a vtp file or a legacy vtk file.
The file output states are managed by the Foam::vtk::fileWriter class. FieldData (eg, TimeValue) must appear before any geometry pieces.
Definition at line 59 of file foamVtkCoordSetWriter.H.
| enum elemOutputType |
Types of element output.
| Enumerator | |
|---|---|
| NO_ELEMENTS | |
| DEFAULT_ELEMENTS | |
| POINT_ELEMENTS | |
| LINE_ELEMENTS | |
Definition at line 70 of file foamVtkCoordSetWriter.H.
|
delete |
No copy construct.
References coordSetWriter().
Referenced by coordSetWriter(), and operator=().


|
explicit |
Construct from components (default format INLINE_BASE64).
References Foam::vtk::INLINE_BASE64, fileWriter::opts(), and pts.

| coordSetWriter | ( | const UPtrList< const pointField > & | pts, |
| const fileName & | file, | ||
| bool | paralel = false ) |
Construct from components (default format INLINE_BASE64), and open the file for writing.
The file name is with/without an extension.
References pts.
| coordSetWriter | ( | const UPtrList< const pointField > & | pts, |
| const vtk::outputOptions | opts, | ||
| const fileName & | file, | ||
| bool | paralel = false ) |
Construct from components and open the file for writing.
The file name is with/without an extension.
References fileWriter::opts(), and pts.

|
virtualdefault |
Destructor.
|
delete |
| void setElementType | ( | const elemOutputType | elemOutput | ) |
Define preferred element type.
|
virtual |
Open file for writing. Non-parallel only.
Reimplemented from fileWriter.
References fileWriter::parallel().

|
virtual |
Define a time name/value for the output.
|
virtual |
Write file header (non-collective).
Reimplemented from fileWriter.
|
virtual |
Write patch topology.
Also writes the file header if not previously written.
Reimplemented from polyWriter.
References fileWriter::writeTimeValue().

| void writeTimeValue | ( | ) |
Write the currently set time as "TimeValue" FieldData.
| void piece | ( | const UPtrList< const pointField > & | points | ) |
Reset point references to begin a new piece.
References points.
| bool writeProcIDs | ( | ) |
Write processor ids for each line as CellData or for each point as PointData, depending on isPointData() state. No-op in serial.
Not implemented.
| void writePointData | ( | const word & | fieldName, |
| const UPtrList< const Field< Type > > & | fieldPtrs ) |
Write primitive field of PointData.
| void writeTimeValue | ( | scalar | timeValue | ) |
Write "TimeValue" FieldData (name as per Catalyst output).
Must be called within the FIELD_DATA state.