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

VTK Writer. More...

#include <VTKTextFileWriter.h>

Inheritance diagram for tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter:
Collaboration diagram for tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter:

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

 VTKTextFileWriter (const std::string &fileName, const std::string &indexFileName, tarch::plotter::PVDTimeSeriesWriter::IndexFileMode modeFile, double timeStamp, const int precision=6)
 
virtual ~VTKTextFileWriter ()
 
virtual bool isOpen () override
 
virtual bool writeToFile () override
 
virtual void clear () override
 Clear the writer, i.e.
 
virtual VertexWriter * createVertexWriter () override
 Caller has to destroy this instance manually.
 
virtual CellWriter * createCellWriter () override
 Caller has to destroy this instance manually.
 
virtual CellDataWriter * createCellDataWriter (const std::string &identifier, int recordsPerCell) override
 Caller has to destroy this instance manually.
 
virtual VertexDataWriter * createVertexDataWriter (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::string _vertexDescription
 
std::string _cellDescription
 
std::string _cellTypeDescription
 
std::string _vertexDataDescription
 
std::string _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 VTKTextFileWriter.
  • 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 VTKTextFileWriter.h.

Constructor & Destructor Documentation

◆ VTKTextFileWriter()

tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::VTKTextFileWriter ( const std::string &  fileName,
const std::string &  indexFileName,
tarch::plotter::PVDTimeSeriesWriter::IndexFileMode  modeFile,
double  timeStamp,
const int  precision = 6 
)

◆ ~VTKTextFileWriter()

virtual tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::~VTKTextFileWriter ( )
virtual

Member Function Documentation

◆ clear()

virtual void tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::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.

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

Here is the caller graph for this function:

◆ createCellDataWriter()

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

Caller has to destroy this instance manually.

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

◆ createCellWriter()

virtual CellWriter * tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::createCellWriter ( )
overridevirtual

Caller has to destroy this instance manually.

Do not create more than one cell writer.

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

◆ createVertexDataWriter()

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

Caller has to destroy this instance manually.

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

◆ createVertexWriter()

virtual VertexWriter * tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::createVertexWriter ( )
overridevirtual

Caller has to destroy this instance manually.

Do not create more than one vertex writer.

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

◆ isOpen()

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

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

◆ setDoubleOrFloatString()

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

Definition at line 94 of file VTKTextFileWriter.h.

◆ validateDataWriterIdentifier()

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

◆ writeToFile()

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

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

Field Documentation

◆ _cellDataDescription

std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_cellDataDescription
private

Definition at line 87 of file VTKTextFileWriter.h.

◆ _cellDescription

std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_cellDescription
private

Definition at line 84 of file VTKTextFileWriter.h.

◆ _cellTypeDescription

std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_cellTypeDescription
private

Definition at line 85 of file VTKTextFileWriter.h.

◆ _doubleOrFloat

const std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_doubleOrFloat
private

either "float" or "double" depending on _precision

Definition at line 66 of file VTKTextFileWriter.h.

◆ _fileName

std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_fileName
private

Definition at line 89 of file VTKTextFileWriter.h.

◆ _log

tarch::logging::Log tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_log
staticprivate

Logging device.

Definition at line 56 of file VTKTextFileWriter.h.

◆ _numberOfCellEntries

int tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_numberOfCellEntries
private

Total number of cell entries.

See _cellListEntries.

Definition at line 81 of file VTKTextFileWriter.h.

◆ _numberOfCells

int tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_numberOfCells
private

Total number of cells.

Definition at line 76 of file VTKTextFileWriter.h.

◆ _numberOfVertices

int tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_numberOfVertices
private

Total number of vertices.

Definition at line 71 of file VTKTextFileWriter.h.

◆ _precision

const int tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_precision
private

precision

Definition at line 63 of file VTKTextFileWriter.h.

◆ _vertexDataDescription

std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_vertexDataDescription
private

Definition at line 86 of file VTKTextFileWriter.h.

◆ _vertexDescription

std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_vertexDescription
private

Definition at line 83 of file VTKTextFileWriter.h.

◆ _writtenToFile

bool tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::_writtenToFile
private

Definition at line 60 of file VTKTextFileWriter.h.

◆ HEADER

const std::string tarch.plotter::griddata::unstructured::vtk::VTKTextFileWriter::HEADER
staticprivate

Definition at line 58 of file VTKTextFileWriter.h.


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