Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
internalMeshWriter Class Reference

Write an OpenFOAM volume (internal) geometry and internal fields as a vtu file or a legacy vtk file. More...

Inheritance diagram for internalMeshWriter:
Inheritance graph
[legend]
Collaboration diagram for internalMeshWriter:
Collaboration graph
[legend]

Public Member Functions

 internalMeshWriter (const polyMesh &mesh, const vtk::vtuCells &cells, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64)
 
 internalMeshWriter (const polyMesh &mesh, const vtk::vtuCells &cells, const fileName &file, bool parallel=Pstream::parRun())
 
 internalMeshWriter (const polyMesh &mesh, const vtk::vtuCells &cells, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
 
virtual ~internalMeshWriter ()=default
 
virtual bool beginFile (std::string title="")
 
virtual bool writeGeometry ()
 
virtual bool beginCellData (label nFields=0)
 
virtual bool beginPointData (label nFields=0)
 
void writeCellIDs ()
 
bool writeProcIDs ()
 
void writePointIDs ()
 
template<class Type >
void writeUniform (const word &fieldName, const Type &val)
 
template<class Type >
void writeCellData (const word &fieldName, const UList< Type > &field)
 
template<class Type >
void writePointData (const word &fieldName, const UList< Type > &field)
 
- Public Member Functions inherited from fileWriter
 fileWriter (const vtk::fileTag contentType, const vtk::outputOptions opts)
 
virtual ~fileWriter ()
 
vtk::fileTag contentType () const
 
vtk::outputOptions opts () const
 
word ext () const
 
bool legacy () const
 
bool parallel () const noexcept
 
const wordstate () const
 
const fileNameoutput () const noexcept
 
bool open (const fileName &file, bool parallel=Pstream::parRun())
 
void close ()
 
bool beginFieldData (label nFields=0)
 
label nCellData () const noexcept
 
label nPointData () const noexcept
 
bool endFieldData ()
 
bool endCellData ()
 
bool endPointData ()
 
void writeTimeValue (scalar timeValue)
 

Static Public Member Functions

static word ext (vtk::outputOptions opts)
 

Static Public Attributes

static int debug = 0
 

Protected Attributes

label numberOfPoints_
 
label numberOfCells_
 
const polyMeshmesh_
 
const vtuCellsvtuCells_
 
- Protected Attributes inherited from fileWriter
vtk::fileTag contentType_
 
outputOptions opts_
 
bool parallel_
 
outputState state_
 
label nCellData_
 
label nPointData_
 
fileName outputFile_
 
autoPtr< vtk::formatterformat_
 
std::ofstream os_
 

Additional Inherited Members

- Protected Types inherited from fileWriter
enum  outputState {
  CLOSED = 0, OPENED, DECLARED, FIELD_DATA,
  PIECE, CELL_DATA, POINT_DATA
}
 
- Protected Member Functions inherited from fileWriter
void checkFormatterValidity () const
 
OstreamreportBadState (Ostream &, outputState expected) const
 
OstreamreportBadState (Ostream &, outputState, outputState) const
 
std::ofstream & os () noexcept
 
vtk::formatterformat ()
 
bool isState (outputState test) const noexcept
 
bool notState (outputState test) const noexcept
 
template<class Type >
void beginDataArray (const word &fieldName, const label nValues)
 
void endDataArray ()
 
void beginPoints (const label nPoints)
 
void endPoints ()
 
bool enter_Piece ()
 
bool endPiece ()
 
bool enter_CellData (label nEntries, label nFields)
 
bool enter_PointData (label nEntries, label nFields)
 
bool exit_File ()
 
template<class Type >
void writeUniform (const word &fieldName, const Type &val, const label nValues)
 
template<class Type >
void writeBasicField (const word &fieldName, const UList< Type > &field)
 
bool writeProcIDs (const label nValues)
 
 fileWriter (const fileWriter &)=delete
 
void operator= (const fileWriter &)=delete
 
- Static Protected Attributes inherited from fileWriter
static const Enum< outputStatestateNames
 

Detailed Description

Write an OpenFOAM volume (internal) geometry and internal fields as a vtu 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.

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.
See also
Foam::vtk::internalWriter
Source files

Definition at line 65 of file foamVtkInternalMeshWriter.H.

Constructor & Destructor Documentation

◆ internalMeshWriter() [1/3]

internalMeshWriter ( const polyMesh mesh,
const vtk::vtuCells cells,
const vtk::outputOptions  opts = vtk::formatType::INLINE_BASE64 
)

Definition at line 465 of file foamVtkInternalMeshWriter.C.

◆ internalMeshWriter() [2/3]

internalMeshWriter ( const polyMesh mesh,
const vtk::vtuCells cells,
const fileName file,
bool  parallel = Pstream::parRun() 
)

Definition at line 484 of file foamVtkInternalMeshWriter.C.

◆ internalMeshWriter() [3/3]

internalMeshWriter ( const polyMesh mesh,
const vtk::vtuCells cells,
const vtk::outputOptions  opts,
const fileName file,
bool  parallel = Pstream::parRun() 
)

Definition at line 498 of file foamVtkInternalMeshWriter.C.

◆ ~internalMeshWriter()

virtual ~internalMeshWriter ( )
virtualdefault

Member Function Documentation

◆ ext()

static word ext ( vtk::outputOptions  opts)
inlinestatic

Definition at line 170 of file foamVtkInternalMeshWriter.H.

References outputOptions::ext(), fileWriter::opts(), and Foam::vtk::UNSTRUCTURED_GRID.

Here is the call graph for this function:

◆ beginFile()

bool beginFile ( std::string  title = "")
virtual

Reimplemented from fileWriter.

Definition at line 514 of file foamVtkInternalMeshWriter.C.

References fileWriter::beginFile(), DebugInFunction, Foam::endl(), and Foam::name().

Here is the call graph for this function:

◆ writeGeometry()

bool writeGeometry ( )
virtual

Implements fileWriter.

Definition at line 552 of file foamVtkInternalMeshWriter.C.

References Foam::vtk::CELLS, format(), and globalIndex::localStart().

Here is the call graph for this function:

◆ beginCellData()

bool beginCellData ( label  nFields = 0)
virtual

Implements fileWriter.

Definition at line 589 of file foamVtkInternalMeshWriter.C.

◆ beginPointData()

bool beginPointData ( label  nFields = 0)
virtual

Implements fileWriter.

Definition at line 595 of file foamVtkInternalMeshWriter.C.

◆ writeCellIDs()

void writeCellIDs ( )

◆ writeProcIDs()

bool writeProcIDs ( )

Definition at line 635 of file foamVtkInternalMeshWriter.C.

References fileWriter::writeProcIDs().

Here is the call graph for this function:

◆ writePointIDs()

void writePointIDs ( )

◆ writeUniform()

void writeUniform ( const word fieldName,
const Type &  val 
)

Definition at line 28 of file foamVtkInternalMeshWriterTemplates.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::expressions::POINT_DATA.

Here is the call graph for this function:

◆ writeCellData()

void writeCellData ( const word fieldName,
const UList< Type > &  field 
)

◆ writePointData()

void writePointData ( const word fieldName,
const UList< Type > &  field 
)

Member Data Documentation

◆ numberOfPoints_

label numberOfPoints_
protected

Definition at line 74 of file foamVtkInternalMeshWriter.H.

◆ numberOfCells_

label numberOfCells_
protected

Definition at line 77 of file foamVtkInternalMeshWriter.H.

◆ mesh_

const polyMesh& mesh_
protected

Definition at line 80 of file foamVtkInternalMeshWriter.H.

◆ vtuCells_

const vtuCells& vtuCells_
protected

Definition at line 83 of file foamVtkInternalMeshWriter.H.

◆ debug

int debug = 0
static

Definition at line 119 of file foamVtkInternalMeshWriter.H.


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