surfaceMeshWriter Class Reference

Write faces (eg face-zones or face-sets) with fields. More...

Inheritance diagram for surfaceMeshWriter:
[legend]
Collaboration diagram for surfaceMeshWriter:
[legend]

Public Member Functions

 surfaceMeshWriter (const indirectPrimitivePatch &pp, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64)
 Construct from patch (default format INLINE_BASE64) More...
 
 surfaceMeshWriter (const indirectPrimitivePatch &pp, const fileName &file, bool parallel=Pstream::parRun())
 
 surfaceMeshWriter (const indirectPrimitivePatch &pp, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
 Construct from patch and open the file for writing. More...
 
virtual ~surfaceMeshWriter ()=default
 Destructor. More...
 
template<class Type >
void write (const GeometricField< Type, fvsPatchField, surfaceMesh > &field)
 Write surface field (CellData) More...
 
template<class Type >
void write (const GeometricField< Type, faPatchField, areaMesh > &field)
 Write surface field (CellData) More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getFaceField (const GeometricField< Type, fvsPatchField, surfaceMesh > &sfld) const
 
- Public Member Functions inherited from indirectPatchWriter
 indirectPatchWriter (const indirectPrimitivePatch &pp, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64)
 Construct from patch (default output INLINE_BASE64) More...
 
 indirectPatchWriter (const indirectPrimitivePatch &pp, const fileName &file, bool parallel=Pstream::parRun())
 Construct from components (default output INLINE_BASE64),. More...
 
 indirectPatchWriter (const indirectPrimitivePatch &pp, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
 Construct from components and open the file for writing. More...
 
virtual ~indirectPatchWriter ()=default
 Destructor. More...
 
const indirectPrimitivePatchpatch () const
 Reference to the indirect patch. More...
 
virtual bool beginFile (std::string title="")
 Write file header (non-collective) More...
 
virtual bool writeGeometry ()
 Write patch topology. More...
 
virtual bool beginCellData (label nFields=0)
 Begin CellData output section for specified number of fields. More...
 
virtual bool beginPointData (label nFields=0)
 Begin PointData for specified number of fields. More...
 
template<class Type >
void writeUniform (const word &fieldName, const Type &val)
 Write a uniform field of Cell (Face) or Point values. More...
 
template<class Type >
void write (const word &fieldName, const UList< Type > &field)
 Write a list of Cell (Face) or Point values. More...
 
- Public Member Functions inherited from fileWriter
 fileWriter (const vtk::fileTag contentType, const vtk::outputOptions opts)
 Construct from components. More...
 
virtual ~fileWriter ()
 Destructor. More...
 
vtk::fileTag contentType () const
 The content type. More...
 
vtk::outputOptions opts () const
 The output options in use. More...
 
word ext () const
 File extension for current format type. More...
 
bool legacy () const
 Commonly used query. More...
 
bool parallel () const
 Parallel output requested? More...
 
const wordstate () const
 The output state in printable format. More...
 
const fileNameoutput () const
 The current output file name. More...
 
bool open (const fileName &file, bool parallel=Pstream::parRun())
 Open file for writing (creates parent directory). More...
 
void close ()
 End the file contents and close the file after writing. More...
 
bool beginFieldData (label nFields=0)
 Begin FieldData output section for specified number of fields. More...
 
label nCellData () const
 Return the number of CellData written for the Piece thus far. More...
 
label nPointData () const
 Return the number of PointData written for the Piece thus far. More...
 
bool endFieldData ()
 Explicitly end FieldData output and switch to DECLARED state. More...
 
bool endCellData ()
 Explicitly end CellData output and switch to PIECE state. More...
 
bool endPointData ()
 Explicitly end PointData output and switch to PIECE state. More...
 
void writeTimeValue (scalar timeValue)
 Write "TimeValue" FieldData (name as per Catalyst output) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from indirectPatchWriter
static word ext (vtk::outputOptions opts)
 File extension for given output type. More...
 
- Protected Types inherited from fileWriter
enum  outputState {
  CLOSED = 0, OPENED, DECLARED, FIELD_DATA,
  PIECE, CELL_DATA, POINT_DATA
}
 Internal tracking of the output state. More...
 
- Protected Member Functions inherited from fileWriter
std::ofstream & os ()
 The backend ostream in use. More...
 
vtk::formatterformat ()
 The VTK formatter in use. More...
 
bool isState (outputState test) const
 True if the output state corresponds to the test state. More...
 
bool notState (outputState test) const
 True if the output state does not correspond to the test state. More...
 
template<class Type >
void writeUniform (const word &fieldName, const Type &val, const label nValues)
 Write uniform field content. More...
 
bool enter_Piece ()
 Trigger change state to Piece. Resets nCellData_, nPointData_. More...
 
bool endPiece ()
 Explicitly end Piece output and switch to DECLARED state. More...
 
bool enter_CellData (label nEntries, label nFields)
 Trigger change state to CellData. More...
 
bool enter_PointData (label nEntries, label nFields)
 Trigger change state to PointData. More...
 
bool exit_File ()
 Emit file footer (end data, end piece, end file) More...
 
 fileWriter (const fileWriter &)=delete
 No copy construct. More...
 
void operator= (const fileWriter &)=delete
 No copy assignment. More...
 
- Protected Attributes inherited from fileWriter
vtk::fileTag contentType_
 The content type. More...
 
outputOptions opts_
 The requested output options. More...
 
bool parallel_
 Writing in parallel (via master) More...
 
outputState state_
 The output state. More...
 
label nCellData_
 The number of CellData written for the Piece thus far. More...
 
label nPointData_
 The number of PointData written for the Piece thus far. More...
 
fileName outputFile_
 The output file name. More...
 
autoPtr< vtk::formatterformat_
 The VTK formatter in use (master process) More...
 
std::ofstream os_
 The backend ostream in use (master process) More...
 
- Static Protected Attributes inherited from fileWriter
static const Enum< outputStatestateNames
 Names for the output state (for messages, not for file output). More...
 

Detailed Description

Write faces (eg face-zones or face-sets) with fields.

The file output states are managed by the Foam::vtk::fileWriter class. FieldData (eg, TimeValue) must appear before any geometry pieces.

Note
Parallel output is combined into a single Piece without point merging, which is similar to using multi-piece data sets, but allows more convenient creation as a streaming process. In the future, the duplicate points at processor connections may be addressed using ghost points.
Source files

Definition at line 66 of file foamVtkSurfaceMeshWriter.H.

Constructor & Destructor Documentation

◆ surfaceMeshWriter() [1/3]

Construct from patch (default format INLINE_BASE64)

Definition at line 93 of file foamVtkSurfaceMeshWriter.H.

◆ surfaceMeshWriter() [2/3]

surfaceMeshWriter ( const indirectPrimitivePatch pp,
const fileName file,
bool  parallel = Pstream::parRun() 
)
inline

Construct from patch (default format INLINE_BASE64), and open the file for writing.

The file name is with/without an extension.

Definition at line 105 of file foamVtkSurfaceMeshWriter.H.

◆ surfaceMeshWriter() [3/3]

surfaceMeshWriter ( const indirectPrimitivePatch pp,
const vtk::outputOptions  opts,
const fileName file,
bool  parallel = Pstream::parRun() 
)
inline

Construct from patch and open the file for writing.

The file name is with/without an extension.

Definition at line 117 of file foamVtkSurfaceMeshWriter.H.

◆ ~surfaceMeshWriter()

virtual ~surfaceMeshWriter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ write() [1/2]

void write ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  field)

Write surface field (CellData)

Definition at line 70 of file foamVtkSurfaceMeshWriterTemplates.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, field(), Foam::nl, and Foam::vtk::write().

Here is the call graph for this function:

◆ write() [2/2]

void write ( const GeometricField< Type, faPatchField, areaMesh > &  field)

Write surface field (CellData)

Definition at line 89 of file foamVtkSurfaceMeshWriterTemplates.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, field(), Foam::nl, and Foam::vtk::write().

Here is the call graph for this function:

◆ getFaceField()

Foam::tmp<Foam::Field<Type> > getFaceField ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  sfld) const

Definition at line 34 of file foamVtkSurfaceMeshWriterTemplates.C.

References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Foam::New(), Foam::foamVersion::patch, and patches.

Here is the call graph for this function:

The documentation for this class was generated from the following files: