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

VTU Writer. More...

#include <VTUTextFileWriter.h>

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

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

 VTUTextFileWriter (const std::string &fileName, const std::string &indexFileName, tarch::plotter::PVDTimeSeriesWriter::IndexFileMode modeFile, double timeStamp, const int precision=6)
 
virtual ~VTUTextFileWriter ()
 
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.
 
void writeMetaDataFileForParallelSnapshot (const std::string &metaDataFilename, const std::vector< std::string > &files)
 This can be called on any writer (if there are multiple ones in a parallel run), but it cannot be static, as I have to know the unknown identifiers, e.g.
 
- Public Member Functions inherited from tarch::plotter::griddata::unstructured::UnstructuredGridWriter
virtual ~UnstructuredGridWriter ()=default
 

Private Member Functions

void validateDataWriterIdentifier (const std::string &identifier) const
 

Private Attributes

const std::string _dataType
 
bool _writtenToFile
 
int _numberOfVertices
 Total number of vertices.
 
int _numberOfCells
 Total number of cells.
 
std::string _vertexDescription
 
std::string _cellDescription
 
std::string _vertexDataDescription
 
std::string _cellDataDescription
 
std::string _parallelVertexDataDescription
 
std::string _parallelCellDataDescription
 
std::string _fileName
 

Static Private Attributes

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

Detailed Description

VTU Writer.

Output for vtk files (paraview) as text files. We write unstructured vtk (vtu) files here.

!! Usage

  • Create an instance of the VTUTextFileWriter.
  • 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 CellWriter.
  • 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

Definition at line 52 of file VTUTextFileWriter.h.

Constructor & Destructor Documentation

◆ VTUTextFileWriter()

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

◆ ~VTUTextFileWriter()

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

Member Function Documentation

◆ clear()

virtual void tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::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.output.Makefile.Makefile::__init__().

Here is the caller graph for this function:

◆ createCellDataWriter()

virtual CellDataWriter * tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::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::VTUTextFileWriter::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::VTUTextFileWriter::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::VTUTextFileWriter::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::VTUTextFileWriter::isOpen ( )
overridevirtual
Returns
Whether writer is ready to accept data.

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

◆ validateDataWriterIdentifier()

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

◆ writeMetaDataFileForParallelSnapshot()

void tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::writeMetaDataFileForParallelSnapshot ( const std::string & metaDataFilename,
const std::vector< std::string > & files )

This can be called on any writer (if there are multiple ones in a parallel run), but it cannot be static, as I have to know the unknown identifiers, e.g.

◆ writeToFile()

virtual bool tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::writeToFile ( )
overridevirtual
Parameters
filenameName of output file. Should be unique for each thread/rank combination
parallelMetaFilenameMeta file giving an overview over all files written simultaneously

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

Field Documentation

◆ _cellDataDescription

std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_cellDataDescription
private

Definition at line 79 of file VTUTextFileWriter.h.

◆ _cellDescription

std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_cellDescription
private

Definition at line 77 of file VTUTextFileWriter.h.

◆ _dataType

const std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_dataType
private

Definition at line 62 of file VTUTextFileWriter.h.

◆ _fileName

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

Definition at line 83 of file VTUTextFileWriter.h.

◆ _log

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

Logging device.

Definition at line 58 of file VTUTextFileWriter.h.

◆ _numberOfCells

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

Total number of cells.

Definition at line 74 of file VTUTextFileWriter.h.

◆ _numberOfVertices

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

Total number of vertices.

Definition at line 69 of file VTUTextFileWriter.h.

◆ _parallelCellDataDescription

std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_parallelCellDataDescription
private

Definition at line 81 of file VTUTextFileWriter.h.

◆ _parallelVertexDataDescription

std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_parallelVertexDataDescription
private

Definition at line 80 of file VTUTextFileWriter.h.

◆ _vertexDataDescription

std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_vertexDataDescription
private

Definition at line 78 of file VTUTextFileWriter.h.

◆ _vertexDescription

std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::_vertexDescription
private

Definition at line 76 of file VTUTextFileWriter.h.

◆ _writtenToFile

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

Definition at line 64 of file VTUTextFileWriter.h.

◆ HEADER

const std::string tarch::plotter::griddata::unstructured::vtk::VTUTextFileWriter::HEADER
staticprivate

Definition at line 60 of file VTUTextFileWriter.h.


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