Peano
Loading...
Searching...
No Matches
tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter Class Reference

HDF 5 writer. More...

#include <PeanoHDF5PatchFileWriter.h>

Inheritance diagram for tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter:
Collaboration diagram for tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter:

Data Structures

class  CellDataWriter
 
class  VertexDataWriter
 

Public Member Functions

 PeanoHDF5PatchFileWriter (int dimension, const std::string &filename, bool append, bool compress)
 
virtual ~PeanoHDF5PatchFileWriter ()
 
virtual CellDataWritercreateCellDataWriter (const std::string &identifier, int unknownsPerAxis, int recordsPerCell, const std::string &description) override
 Caller has to destroy this instance manually.
 
virtual CellDataWritercreateCellDataWriter (const std::string &identifier, int unknownsPerAxis, int recordsPerCell, const std::string &description, const std::string &metaData) override
 Create cell data writer.
 
virtual CellDataWritercreateCellDataWriter (const std::string &identifier, int unknownsPerAxis, int recordsPerCell, const std::string &description, const std::string &metaData, double *mapping) override
 The mapping is an additional field that has d * (n+1)^d doubles that describe how the vertices within a unit cube are distributed.
 
virtual VertexDataWritercreateVertexDataWriter (const std::string &identifier, int unknownsPerAxis, int recordsPerVertex, const std::string &description) override
 Caller has to destroy this instance manually.
 
virtual VertexDataWritercreateVertexDataWriter (const std::string &identifier, int unknownsPerAxis, int recordsPerVertex, const std::string &description, const std::string &metaData) override
 Create vertex data writer.
 
virtual VertexDataWritercreateVertexDataWriter (const std::string &identifier, int unknownsPerAxis, int recordsPerVertex, const std::string &description, const std::string &metaData, double *mapping) override
 Create writer.
 
virtual int plotPatch (const tarch::la::Vector< 2, double > &offset, const tarch::la::Vector< 2, double > &size) override
 
virtual int plotPatch (const tarch::la::Vector< 3, double > &offset, const tarch::la::Vector< 3, double > &size) override
 
virtual bool writeToFile () override
 
virtual bool isOpen () override
 
virtual void clear () override
 Clear the writer, i.e.
 
void addMetaData (const std::string &metaData)
 
- Public Member Functions inherited from tarch::plotter::griddata::blockstructured::PatchWriter
virtual ~PatchWriter ()=default
 

Protected Member Functions

std::string getNameOfCurrentDataset () const
 

Protected Attributes

const int _dimensions
 
const bool _compress
 
int _vertexCounter
 
int _cellCounter
 
bool _isOpen
 
std::vector< double > _geometryData
 
int _numberOfActiveDataset
 See the cookbook.
 

Static Protected Attributes

static tarch::logging::Log _log
 
static const std::string HEADER
 

Detailed Description

HDF 5 writer.

This class works if and only if you have compiled Peano with –with-hdf5 (autotools).

Definition at line 31 of file PeanoHDF5PatchFileWriter.h.

Constructor & Destructor Documentation

◆ PeanoHDF5PatchFileWriter()

tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::PeanoHDF5PatchFileWriter ( int dimension,
const std::string & filename,
bool append,
bool compress )

◆ ~PeanoHDF5PatchFileWriter()

virtual tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::~PeanoHDF5PatchFileWriter ( )
virtual

Member Function Documentation

◆ addMetaData()

void tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::addMetaData ( const std::string & metaData)

◆ clear()

virtual void tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::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::blockstructured::PatchWriter.

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

Here is the caller graph for this function:

◆ createCellDataWriter() [1/3]

virtual CellDataWriter * tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::createCellDataWriter ( const std::string & identifier,
int unknownsPerAxis,
int recordsPerCell,
const std::string & description )
overridevirtual

Caller has to destroy this instance manually.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ createCellDataWriter() [2/3]

virtual CellDataWriter * tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::createCellDataWriter ( const std::string & identifier,
int unknownsPerAxis,
int recordsPerCell,
const std::string & description,
const std::string & metaData )
overridevirtual

Create cell data writer.

Wrapper around createCellDataWriter(std::string, int, int, std::string, std::string, double*) with default values. Please consult description of the more elaborate routine for details.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ createCellDataWriter() [3/3]

virtual CellDataWriter * tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::createCellDataWriter ( const std::string & identifier,
int unknownsPerAxis,
int recordsPerCell,
const std::string & description,
const std::string & metaData,
double * mapping )
overridevirtual

The mapping is an additional field that has d * (n+1)^d doubles that describe how the vertices within a unit cube are distributed.

d is the dimension of the plotter, n is the number of cells per axis.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ createVertexDataWriter() [1/3]

virtual VertexDataWriter * tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::createVertexDataWriter ( const std::string & identifier,
int unknownsPerAxis,
int recordsPerVertex,
const std::string & description )
overridevirtual

Caller has to destroy this instance manually.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ createVertexDataWriter() [2/3]

virtual VertexDataWriter * tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::createVertexDataWriter ( const std::string & identifier,
int unknownsPerAxis,
int recordsPerVertex,
const std::string & description,
const std::string & metaData )
overridevirtual

Create vertex data writer.

Wrapper around createVertexDataWriter(std::string, int, int, std::string, std::string, double*) with default values. Please consult description of the more elaborate routine for details.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ createVertexDataWriter() [3/3]

virtual VertexDataWriter * tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::createVertexDataWriter ( const std::string & identifier,
int unknownsPerAxis,
int recordsPerVertex,
const std::string & description,
const std::string & metaData,
double * mapping )
overridevirtual

Create writer.

Caller has to destroy this instance manually.

Parameters
identifierName of your data. I recommend to stick to C++ identifier rules for this one, i.e. no fancy chars and no spaces
unknownsPerAxisWe plot a (logically) Cartesian piece of data. This is the number of unknowns per axis
recordsPerVertexNumber of entries stores per unknown. Data is, by default, written as AoS
descriptionThis is a description of the data. Should be a one-liner.
metaDataFurther meta data without prescribed semantics. Can be a longer text block.
mappingArray of positions within a unit cube/square. It is an AoS of vectors within the unit square which distorts all the plotting points within the logical Cartesian mesh imposed over the unit cube. By default, all data are Cartesian and spaced out equidistantly, i.e. if you have 4x4 data points per cell, then you get a chess board pattern of 16 smaller cubes over the cell in 2d. However, you might prefer something like Gauss Lobatto nodes, and then the data are not spaced out uniformly anymore.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ getNameOfCurrentDataset()

std::string tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::getNameOfCurrentDataset ( ) const
protected
See also
_numberOfActiveDataset

◆ isOpen()

virtual bool tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::isOpen ( )
overridevirtual
Returns
Whether writer is ready to accept data.

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ plotPatch() [1/2]

virtual int tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::plotPatch ( const tarch::la::Vector< 2, double > & offset,
const tarch::la::Vector< 2, double > & size )
overridevirtual
Returns
Patch index, i.e. unique number of this patch

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ plotPatch() [2/2]

virtual int tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::plotPatch ( const tarch::la::Vector< 3, double > & offset,
const tarch::la::Vector< 3, double > & size )
overridevirtual
Returns
Patch index, i.e. unique number of this patch

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

◆ writeToFile()

virtual bool tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::writeToFile ( )
overridevirtual
Returns
Write has been successful

Implements tarch::plotter::griddata::blockstructured::PatchWriter.

Field Documentation

◆ _cellCounter

int tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_cellCounter
protected

Definition at line 40 of file PeanoHDF5PatchFileWriter.h.

◆ _compress

const bool tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_compress
protected

Definition at line 37 of file PeanoHDF5PatchFileWriter.h.

◆ _dimensions

const int tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_dimensions
protected

◆ _geometryData

std::vector<double> tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_geometryData
protected

Definition at line 50 of file PeanoHDF5PatchFileWriter.h.

◆ _isOpen

bool tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_isOpen
protected

Definition at line 48 of file PeanoHDF5PatchFileWriter.h.

◆ _log

tarch::logging::Log tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_log
staticprotected

Definition at line 33 of file PeanoHDF5PatchFileWriter.h.

◆ _numberOfActiveDataset

int tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_numberOfActiveDataset
protected

See the cookbook.

At any time, the writer pipes data only into one dataset (subdirectory) which is identified through a unique number. Yet, HDF5 works with identifiers (string) instead of numbers, so you have to convert it through getNameOfCurrentDataset().

Definition at line 58 of file PeanoHDF5PatchFileWriter.h.

◆ _vertexCounter

int tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::_vertexCounter
protected

Definition at line 39 of file PeanoHDF5PatchFileWriter.h.

◆ HEADER

const std::string tarch::plotter::griddata::blockstructured::PeanoHDF5PatchFileWriter::HEADER
staticprotected

Definition at line 34 of file PeanoHDF5PatchFileWriter.h.


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