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

Write OpenFOAM patches and patch fields in VTP or legacy vtk format. More...

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

Public Member Functions

 patchMeshWriter (const polyMesh &mesh, const labelList &patchIDs, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64)
 
 patchMeshWriter (const polyMesh &mesh, const labelList &patchIDs, const fileName &file, bool parallel=Pstream::parRun())
 
 patchMeshWriter (const polyMesh &mesh, const labelList &patchIDs, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
 
virtual ~patchMeshWriter ()=default
 
const labelListpatchIDs () const noexcept
 
virtual bool beginFile (std::string title="")
 
virtual bool writeGeometry ()
 
virtual bool beginCellData (label nFields=0)
 
virtual bool beginPointData (label nFields=0)
 
void writePatchIDs ()
 
bool writeProcIDs ()
 
bool writeNeighIDs ()
 
template<class Type >
void writeUniform (const word &fieldName, const Type &val)
 
- 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)
 

Protected Member Functions

void beginPiece ()
 
void writePoints ()
 
void writePolysLegacy (const label pointOffset)
 
void writePolys (const label pointOffset)
 
 patchMeshWriter (const patchMeshWriter &)=delete
 
void operator= (const patchMeshWriter &)=delete
 
- 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
 

Protected Attributes

label numberOfPoints_
 
label numberOfCells_
 
label nLocalPoints_
 
label nLocalPolys_
 
label nLocalVerts_
 
const polyMeshmesh_
 
labelList patchIDs_
 
- 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
}
 
- Static Protected Attributes inherited from fileWriter
static const Enum< outputStatestateNames
 

Detailed Description

Write OpenFOAM patches and patch fields in VTP or legacy vtk format.

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::patchWriter
Source files

Definition at line 63 of file foamVtkPatchMeshWriter.H.

Constructor & Destructor Documentation

◆ patchMeshWriter() [1/4]

patchMeshWriter ( const patchMeshWriter )
protecteddelete

◆ patchMeshWriter() [2/4]

patchMeshWriter ( const polyMesh mesh,
const labelList patchIDs,
const vtk::outputOptions  opts = vtk::formatType::INLINE_BASE64 
)

Definition at line 354 of file foamVtkPatchMeshWriter.C.

◆ patchMeshWriter() [3/4]

patchMeshWriter ( const polyMesh mesh,
const labelList patchIDs,
const fileName file,
bool  parallel = Pstream::parRun() 
)

Definition at line 376 of file foamVtkPatchMeshWriter.C.

◆ patchMeshWriter() [4/4]

patchMeshWriter ( const polyMesh mesh,
const labelList patchIDs,
const vtk::outputOptions  opts,
const fileName file,
bool  parallel = Pstream::parRun() 
)

Definition at line 390 of file foamVtkPatchMeshWriter.C.

◆ ~patchMeshWriter()

virtual ~patchMeshWriter ( )
virtualdefault

Member Function Documentation

◆ beginPiece()

void beginPiece ( )
protected

◆ writePoints()

void writePoints ( )
protected

◆ writePolysLegacy()

void writePolysLegacy ( const label  pointOffset)
protected

◆ writePolys()

void writePolys ( const label  pointOffset)
protected

◆ operator=()

void operator= ( const patchMeshWriter )
protecteddelete

◆ ext()

static word ext ( vtk::outputOptions  opts)
inlinestatic

Definition at line 164 of file foamVtkPatchMeshWriter.H.

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

Here is the call graph for this function:

◆ patchIDs()

const labelList& patchIDs ( ) const
inlinenoexcept

Definition at line 170 of file foamVtkPatchMeshWriter.H.

References patchMeshWriter::patchIDs_.

◆ beginFile()

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

Reimplemented from fileWriter.

Definition at line 406 of file foamVtkPatchMeshWriter.C.

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

Here is the call graph for this function:

◆ writeGeometry()

bool writeGeometry ( )
virtual

Implements fileWriter.

Definition at line 456 of file foamVtkPatchMeshWriter.C.

References globalIndex::localStart().

Here is the call graph for this function:

◆ beginCellData()

bool beginCellData ( label  nFields = 0)
virtual

Implements fileWriter.

Definition at line 482 of file foamVtkPatchMeshWriter.C.

◆ beginPointData()

bool beginPointData ( label  nFields = 0)
virtual

Implements fileWriter.

Definition at line 488 of file foamVtkPatchMeshWriter.C.

◆ writePatchIDs()

void writePatchIDs ( )

◆ writeProcIDs()

bool writeProcIDs ( )

Definition at line 579 of file foamVtkPatchMeshWriter.C.

References fileWriter::writeProcIDs().

Here is the call graph for this function:

◆ writeNeighIDs()

bool writeNeighIDs ( )

◆ writeUniform()

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

Definition at line 28 of file foamVtkPatchMeshWriterTemplates.C.

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

Here is the call graph for this function:

Member Data Documentation

◆ numberOfPoints_

label numberOfPoints_
protected

Definition at line 72 of file foamVtkPatchMeshWriter.H.

Referenced by patchMeshWriter::beginPiece().

◆ numberOfCells_

label numberOfCells_
protected

Definition at line 75 of file foamVtkPatchMeshWriter.H.

Referenced by patchMeshWriter::beginPiece().

◆ nLocalPoints_

label nLocalPoints_
protected

Definition at line 78 of file foamVtkPatchMeshWriter.H.

Referenced by patchMeshWriter::beginPiece().

◆ nLocalPolys_

label nLocalPolys_
protected

Definition at line 81 of file foamVtkPatchMeshWriter.H.

Referenced by patchMeshWriter::beginPiece().

◆ nLocalVerts_

label nLocalVerts_
protected

Definition at line 84 of file foamVtkPatchMeshWriter.H.

Referenced by patchMeshWriter::beginPiece().

◆ mesh_

const polyMesh& mesh_
protected

Definition at line 87 of file foamVtkPatchMeshWriter.H.

Referenced by patchMeshWriter::beginPiece().

◆ patchIDs_

labelList patchIDs_
protected

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