Interface that is used by VTKOutput in order to write data to VTK files.
If one wants to write block data to a VTK file, one must implement a class that derives from vtk::internal::BlockCellDataWriter. An instance of this class then can be registered at a VTKOutput object. Every time the output function of this VTKOutput object is triggered, all registered BlockCellDataWriter objects are called.
Implementations of vtk::internal::BlockCellDataWriter are not supposed to inherit directly from vtk::internal::BlockCellDataWriter but from vtk::BlockCellDataWriter which provides a much nicer interface for the user to implement!
Every class derived from BlockCellDataWriter must implement two push functions that write one data element to either an output stream or a Base64Writer. Typically, a private "evaluate" function is implemented and called in both push functions:
Both push functions always receive block local cell coordinates corresponding to the two protected members "block_" and "blockStorage_". The data elements which are pushed to the stream/Base64Writer must always be of the same type! Every data type is assigned a specific string in VTK. This string must be returned by the pure virtual member function "typeString()". This function should always be implemented by calling the utility function "vtk::typeToString()":
Additionally, every class derived from BlockCellDataWriter can implement two further push functions that are used for resampling the data. The parameters passed to these two functions are as follows:
Every time "configure( const IBlock& block, const StructuredBlockStorage& sbs )" is called, the block and its corresponding structured block storage assigned to the BlockCellDataWriter may change. This triggers the call of a protected member function "configure()" which must be implemented and is intended for reacting to these changes.
#include <BlockCellDataWriter.h>
Public Member Functions | |
BlockCellDataWriter (const std::string &id) | |
virtual | ~BlockCellDataWriter ()=default |
void | configure (const IBlock &block, const StructuredBlockStorage &sbs) |
virtual void | push (std::ostream &os, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f)=0 |
For the documentation of this function, please refer to the documentation/general description of this class. More... | |
virtual void | push (Base64Writer &b64, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f)=0 |
For the documentation of this function, please refer to the documentation/general description of this class. More... | |
virtual void | push (std::ostream &os, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f, const real_t localXCell, const real_t localYCell, const real_t localZCell, const real_t globalX, const real_t globalY, const real_t globalZ, const real_t samplingDx, const real_t samplingDy, const real_t samplingDz) |
For the documentation of this function, please refer to the documentation/general description of this class. More... | |
virtual void | push (Base64Writer &b64, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f, const real_t localXCell, const real_t localYCell, const real_t localZCell, const real_t globalX, const real_t globalY, const real_t globalZ, const real_t samplingDx, const real_t samplingDy, const real_t samplingDz) |
For the documentation of this function, please refer to the documentation/general description of this class. More... | |
uint_t | xSize () const |
uint_t | ySize () const |
uint_t | zSize () const |
virtual uint_t | fSize () const =0 |
must return the size of the fourth dimension More... | |
virtual std::string | typeString () const =0 |
Every data type is assigned a specific string in VTK. More... | |
const std::string & | identifier () const |
Protected Member Functions | |
virtual void | configure ()=0 |
Every time "configure( const IBlock& block, const StructuredBlockStorage& sbs )" is called, the block and its corresponding structured block storage assigned to the BlockCellDataWriter may change. More... | |
void | setIdentifier (const std::string &id) |
Protected Attributes | |
const IBlock * | block_ |
const StructuredBlockStorage * | blockStorage_ |
std::string | identifier_ |
Private Member Functions | |
BlockCellDataWriter ()=default | |
|
inline |
|
virtualdefault |
Reimplemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >, walberla::vtk::BlockCellDataWriter< float, LatticeModel_T::Stencil::Size >, walberla::vtk::BlockCellDataWriter< typename VectorTrait< typename Field_T::value_type >::OutputType, VectorTrait< Field_T::value_type >::F_SIZE *Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float >, walberla::vtk::BlockCellDataWriter< float, 1 >, walberla::vtk::BlockCellDataWriter< int >, walberla::vtk::BlockCellDataWriter< uint8_t >, walberla::vtk::BlockCellDataWriter< float, 3 >, walberla::vtk::BlockCellDataWriter< T, 1 >, walberla::vtk::BlockCellDataWriter< uint8_t, Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float, 9 >, walberla::vtk::BlockCellDataWriter< uint8_t, 1 >, and walberla::vtk::BlockCellDataWriter< cell_idx_t, 3 >.
|
privatedefault |
|
protectedpure virtual |
Every time "configure( const IBlock& block, const StructuredBlockStorage& sbs )" is called, the block and its corresponding structured block storage assigned to the BlockCellDataWriter may change.
This triggers the call of this function which must be implemented and is intended for reacting to these changes.
Implemented in walberla::field::StabilityChecker< Field_T, Filter_T, CheckFunction_T >::GlobalCoordVTKWriter, walberla::field::StabilityChecker< Field_T, Filter_T, CheckFunction_T >::LocalCoordVTKWriter, walberla::field::StabilityChecker< Field_T, Filter_T, CheckFunction_T >::FValueVTKWriter, walberla::field::VTKWriter< Field_T, OutputType >, walberla::lbm::VelocityMagnitudeVTKWriter< LatticeModel_T, OutputType >, walberla::field::FlagFieldMapping< FlagField_T, T >, walberla::lbm::NonEqulibriumVTKWriter< LatticeModel_T, OutputType >, walberla::lbm::DensityVTKWriter< LatticeModel_T, OutputType >, walberla::lbm::VelocityVTKWriter< LatticeModel_T, OutputType >, walberla::vtk::DumpBlockStructureProcess, walberla::vtk::DumpBlockStructureLevel, walberla::lbm::VelocitySIMagnitudeVTKWriter< LatticeModel_T, OutputType >, walberla::lbm::VelocitySIVTKWriter< LatticeModel_T, OutputType >, walberla::field::BinarizationFieldWriter< FieldType, TargetType >, walberla::lbm::DensitySIVTKWriter< LatticeModel_T, OutputType >, walberla::lbm::VorticityComponentVTKWriter< VelocityField_T, Filter_T, OutputType >, walberla::lbm::CurlMagnitudeVTKWriter< VelocityField_T, Filter_T, OutputType >, walberla::lbm::PressureTensorVTKWriter< LatticeModel_T, OutputType >, and walberla::lbm::QCriterionVTKWriter< VelocityField_T, Filter_T, OutputType >.
|
inline |
|
pure virtual |
must return the size of the fourth dimension
(data fields storing scalar values return "1", data fields storing vector data return the size of the vector)
Implemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >.
|
inline |
|
pure virtual |
For the documentation of this function, please refer to the documentation/general description of this class.
Implemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >, walberla::vtk::BlockCellDataWriter< float, LatticeModel_T::Stencil::Size >, walberla::vtk::BlockCellDataWriter< typename VectorTrait< typename Field_T::value_type >::OutputType, VectorTrait< Field_T::value_type >::F_SIZE *Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float >, walberla::vtk::BlockCellDataWriter< float, 1 >, walberla::vtk::BlockCellDataWriter< int >, walberla::vtk::BlockCellDataWriter< uint8_t >, walberla::vtk::BlockCellDataWriter< float, 3 >, walberla::vtk::BlockCellDataWriter< T, 1 >, walberla::vtk::BlockCellDataWriter< uint8_t, Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float, 9 >, walberla::vtk::BlockCellDataWriter< uint8_t, 1 >, and walberla::vtk::BlockCellDataWriter< cell_idx_t, 3 >.
|
inlinevirtual |
For the documentation of this function, please refer to the documentation/general description of this class.
Reimplemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >, walberla::vtk::BlockCellDataWriter< float, LatticeModel_T::Stencil::Size >, walberla::vtk::BlockCellDataWriter< typename VectorTrait< typename Field_T::value_type >::OutputType, VectorTrait< Field_T::value_type >::F_SIZE *Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float >, walberla::vtk::BlockCellDataWriter< float, 1 >, walberla::vtk::BlockCellDataWriter< int >, walberla::vtk::BlockCellDataWriter< uint8_t >, walberla::vtk::BlockCellDataWriter< float, 3 >, walberla::vtk::BlockCellDataWriter< T, 1 >, walberla::vtk::BlockCellDataWriter< uint8_t, Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float, 9 >, walberla::vtk::BlockCellDataWriter< uint8_t, 1 >, and walberla::vtk::BlockCellDataWriter< cell_idx_t, 3 >.
|
pure virtual |
For the documentation of this function, please refer to the documentation/general description of this class.
Implemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >, walberla::vtk::BlockCellDataWriter< float, LatticeModel_T::Stencil::Size >, walberla::vtk::BlockCellDataWriter< typename VectorTrait< typename Field_T::value_type >::OutputType, VectorTrait< Field_T::value_type >::F_SIZE *Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float >, walberla::vtk::BlockCellDataWriter< float, 1 >, walberla::vtk::BlockCellDataWriter< int >, walberla::vtk::BlockCellDataWriter< uint8_t >, walberla::vtk::BlockCellDataWriter< float, 3 >, walberla::vtk::BlockCellDataWriter< T, 1 >, walberla::vtk::BlockCellDataWriter< uint8_t, Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float, 9 >, walberla::vtk::BlockCellDataWriter< uint8_t, 1 >, and walberla::vtk::BlockCellDataWriter< cell_idx_t, 3 >.
|
inlinevirtual |
For the documentation of this function, please refer to the documentation/general description of this class.
Reimplemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >, walberla::vtk::BlockCellDataWriter< float, LatticeModel_T::Stencil::Size >, walberla::vtk::BlockCellDataWriter< typename VectorTrait< typename Field_T::value_type >::OutputType, VectorTrait< Field_T::value_type >::F_SIZE *Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float >, walberla::vtk::BlockCellDataWriter< float, 1 >, walberla::vtk::BlockCellDataWriter< int >, walberla::vtk::BlockCellDataWriter< uint8_t >, walberla::vtk::BlockCellDataWriter< float, 3 >, walberla::vtk::BlockCellDataWriter< T, 1 >, walberla::vtk::BlockCellDataWriter< uint8_t, Field_T::F_SIZE >, walberla::vtk::BlockCellDataWriter< float, 9 >, walberla::vtk::BlockCellDataWriter< uint8_t, 1 >, and walberla::vtk::BlockCellDataWriter< cell_idx_t, 3 >.
|
inlineprotected |
|
pure virtual |
Every data type is assigned a specific string in VTK.
This string must be returned by this function, which should always be implemented by calling the utility function "vtk::typeToString()":
Implemented in walberla::vtk::BlockCellDataWriter< T, F_SIZE_ARG >.
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |