Peano 4
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()

◆ ~VTUTextFileWriter()

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

Definition at line 82 of file VTUTextFileWriter.cpp.

References assertionEqualsMsg.

Member Function Documentation

◆ clear()

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.

Definition at line 97 of file VTUTextFileWriter.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::VTUTextFileWriter::createCellDataWriter ( const std::string & identifier,
int recordsPerCell )
overridevirtual

Caller has to destroy this instance manually.

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

Definition at line 243 of file VTUTextFileWriter.cpp.

◆ createCellWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::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.

Definition at line 217 of file VTUTextFileWriter.cpp.

◆ createVertexDataWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::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.

Definition at line 251 of file VTUTextFileWriter.cpp.

◆ createVertexWriter()

tarch::plotter::griddata::unstructured::UnstructuredGridWriter::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.

Definition at line 212 of file VTUTextFileWriter.cpp.

◆ isOpen()

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

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

Definition at line 210 of file VTUTextFileWriter.cpp.

◆ validateDataWriterIdentifier()

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

Definition at line 222 of file VTUTextFileWriter.cpp.

References logWarning.

◆ 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.

Definition at line 146 of file VTUTextFileWriter.cpp.

References logDebug, logError, and logWarning.

◆ writeToFile()

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.

Definition at line 109 of file VTUTextFileWriter.cpp.

References assertion, logDebug, and logError.

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

◆ _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

◆ _numberOfVertices

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

◆ _parallelCellDataDescription

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

◆ _parallelVertexDataDescription

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

◆ _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
Initial value:
= "<?xml version=\"1.0\"?>\n\
<!-- Generated by Peano3 output component $Revision: 1.2 $ Author: Tobias Weinzierl -->\n"

Definition at line 60 of file VTUTextFileWriter.h.


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