Peano 4
Loading...
Searching...
No Matches
tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter Class Reference

VTK Writer. More...

#include <VTKBinaryFileWriter.h>

Inheritance diagram for tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter:
Collaboration diagram for tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter:

Data Structures

class  CellDataWriter
 
class  CellWriter
 Writes the element data. More...
 
class  VertexDataWriter
 
class  VertexWriter
 This is the vertex writer you have to create to plot the vertices. More...
 

Public Member Functions

 VTKBinaryFileWriter (const std::string &fileName, const std::string &indexFileName, tarch::plotter::PVDTimeSeriesWriter::IndexFileMode modeFile, double timeStamp, const int precision=6)
 
virtual ~VTKBinaryFileWriter ()
 
virtual bool isOpen () override
 
virtual bool writeToFile () override
 
virtual void clear () override
 Clear the writer, i.e.
 
virtual VertexWritercreateVertexWriter () override
 Caller has to destroy this instance manually.
 
virtual CellWritercreateCellWriter () override
 Caller has to destroy this instance manually.
 
virtual CellDataWritercreateCellDataWriter (const std::string &identifier, int recordsPerCell) override
 Caller has to destroy this instance manually.
 
virtual VertexDataWritercreateVertexDataWriter (const std::string &identifier, int recordsPerVertex) override
 Caller has to destroy this instance manually.
 
- Public Member Functions inherited from tarch::plotter::griddata::unstructured::UnstructuredGridWriter
virtual ~UnstructuredGridWriter ()=default
 

Private Member Functions

void validateDataWriterIdentifier (const std::string &identifier) const
 
std::string setDoubleOrFloatString (const int precision)
 

Private Attributes

bool _writtenToFile
 
const int _precision
 precision
 
const std::string _doubleOrFloat
 either "float" or "double" depending on _precision
 
int _numberOfVertices
 Total number of vertices.
 
int _numberOfCells
 Total number of cells.
 
int _numberOfCellEntries
 Total number of cell entries.
 
std::stringstream _vertexDescription
 
std::stringstream _cellDescription
 
std::stringstream _cellTypeDescription
 
std::stringstream _vertexDataDescription
 
std::stringstream _cellDataDescription
 
std::string _fileName
 

Static Private Attributes

static tarch::logging::Log _log
 Logging device.
 
static const std::string HEADER
 

Detailed Description

VTK Writer.

Output for vtk files (paraview) as text files.

!! Usage

  • Create an instance of the VTKBinaryFileWriter.
  • For the vertices you want to write, you have to create your own VertexWriter.
  • Pass all the vertices to this writer (both hanging and persistent nodes). For each vertex you receive an unique number. Remember this number.
  • For the elements you want to write, you have to create your own ElementWriter.
  • For each record create a data writer. There's two writers: One for the vertices and one for the cells.

!!! Thread-safety

The plotter is not thread-safe and shall never be thread-safe: It is the responsibility of the using system to implement thread-safe calls. For Peano, this is the mappings where some events could occur simultaneously.

Author
Tobias Weinzierl
Version
Revision
1.1

Definition at line 50 of file VTKBinaryFileWriter.h.

Constructor & Destructor Documentation

◆ VTKBinaryFileWriter()

◆ ~VTKBinaryFileWriter()

tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::~VTKBinaryFileWriter ( )
virtual

Definition at line 83 of file VTKBinaryFileWriter.cpp.

References assertionEqualsMsg.

Member Function Documentation

◆ clear()

void tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::clear ( )
overridevirtual

Clear the writer, i.e.

erase all the data. However, as the writer does not track how many vertex and cell writers you've created, it's up to you to ensure that none of these instances is left.

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 103 of file VTKBinaryFileWriter.cpp.

Referenced by peano4.output.Makefile.Makefile::__init__().

Here is the caller graph for this function:

◆ createCellDataWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::CellDataWriter * tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::createCellDataWriter ( const std::string & identifier,
int recordsPerCell )
overridevirtual

Caller has to destroy this instance manually.

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 192 of file VTKBinaryFileWriter.cpp.

◆ createCellWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::CellWriter * tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::createCellWriter ( )
overridevirtual

Caller has to destroy this instance manually.

Do not create more than one cell writer.

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 166 of file VTKBinaryFileWriter.cpp.

◆ createVertexDataWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::VertexDataWriter * tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::createVertexDataWriter ( const std::string & identifier,
int recordsPerVertex )
overridevirtual

Caller has to destroy this instance manually.

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 200 of file VTKBinaryFileWriter.cpp.

◆ createVertexWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::VertexWriter * tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::createVertexWriter ( )
overridevirtual

Caller has to destroy this instance manually.

Do not create more than one vertex writer.

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 161 of file VTKBinaryFileWriter.cpp.

◆ isOpen()

bool tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::isOpen ( )
overridevirtual
Returns
Whether writer is ready to accept data.

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 159 of file VTKBinaryFileWriter.cpp.

◆ setDoubleOrFloatString()

std::string tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::setDoubleOrFloatString ( const int precision)
private

Definition at line 94 of file VTKBinaryFileWriter.h.

◆ validateDataWriterIdentifier()

void tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::validateDataWriterIdentifier ( const std::string & identifier) const
private

Definition at line 171 of file VTKBinaryFileWriter.cpp.

References logWarning.

◆ writeToFile()

bool tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::writeToFile ( )
overridevirtual
Returns
Write has been successful

Implements tarch::plotter::griddata::unstructured::UnstructuredGridWriter.

Definition at line 115 of file VTKBinaryFileWriter.cpp.

References assertion, logDebug, and logError.

Field Documentation

◆ _cellDataDescription

std::stringstream tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_cellDataDescription
private

Definition at line 87 of file VTKBinaryFileWriter.h.

◆ _cellDescription

std::stringstream tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_cellDescription
private

Definition at line 84 of file VTKBinaryFileWriter.h.

◆ _cellTypeDescription

std::stringstream tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_cellTypeDescription
private

Definition at line 85 of file VTKBinaryFileWriter.h.

◆ _doubleOrFloat

const std::string tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_doubleOrFloat
private

◆ _fileName

std::string tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_fileName
private

Definition at line 89 of file VTKBinaryFileWriter.h.

◆ _log

tarch::logging::Log tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_log
staticprivate

Logging device.

Definition at line 56 of file VTKBinaryFileWriter.h.

◆ _numberOfCellEntries

int tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_numberOfCellEntries
private

Total number of cell entries.

See _cellListEntries.

Definition at line 81 of file VTKBinaryFileWriter.h.

Referenced by tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::CellWriter::CellWriter().

◆ _numberOfCells

int tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_numberOfCells
private

◆ _numberOfVertices

int tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_numberOfVertices
private

◆ _precision

const int tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_precision
private

precision

Definition at line 63 of file VTKBinaryFileWriter.h.

◆ _vertexDataDescription

std::stringstream tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_vertexDataDescription
private

Definition at line 86 of file VTKBinaryFileWriter.h.

◆ _vertexDescription

std::stringstream tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_vertexDescription
private

Definition at line 83 of file VTKBinaryFileWriter.h.

◆ _writtenToFile

bool tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::_writtenToFile
private

Definition at line 60 of file VTKBinaryFileWriter.h.

◆ HEADER

const std::string tarch::plotter::griddata::unstructured::vtk::VTKBinaryFileWriter::HEADER
staticprivate
Initial value:
= "# vtk DataFile Version 2.0\n "
"Generated by Peano3 output component $Revision: 1.2 $ Author: Tobias Weinzierl\n "
"BINARY\n "

Definition at line 58 of file VTKBinaryFileWriter.h.


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