Template Numerical Library version\ main:94209208
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TNL::Meshes::Writers::VTIWriter< Mesh > Class Template Reference

Writer of data linked with meshes into VTI format. More...

#include <TNL/Meshes/Writers/VTIWriter.h>

Collaboration diagram for TNL::Meshes::Writers::VTIWriter< Mesh >:
Collaboration graph
[legend]

Public Member Functions

 VTIWriter ()=delete
 Construct with no parameters is not allowed.
 
 VTIWriter (std::ostream &str, VTK::FileFormat format=VTK::FileFormat::zlib_compressed)
 Constructor of a VTIWriter.
 
 ~VTIWriter ()
 Destructor.
 
template<typename Array >
void writeCellData (const Array &array, const std::string &name, int numberOfComponents=1)
 Writes data linked with mesh cells.
 
template<typename Array >
void writeDataArray (const Array &array, const std::string &name, int numberOfComponents=1)
 
template<int EntityDimension = Mesh::getMeshDimension()>
void writeEntities (const Mesh &mesh)
 Write mesh entites to the output file.
 
void writeImageData (const Mesh &mesh)
 
void writeImageData (const typename Mesh::PointType &origin, const typename Mesh::CoordinatesType &begin, const typename Mesh::CoordinatesType &end, const typename Mesh::PointType &spaceSteps)
 
void writeMetadata (std::int32_t cycle=-1, double time=-1)
 If desired, cycle and time of the simulation can put into the file.
 
template<typename Array >
void writePointData (const Array &array, const std::string &name, int numberOfComponents=1)
 Writes data linked with mesh vertexes.
 

Protected Member Functions

void closeCellData ()
 
void closePiece ()
 
void closePointData ()
 
void openCellData ()
 
void openPointData ()
 
void writeFooter ()
 
void writeHeader ()
 

Protected Attributes

bool cellDataClosed = false
 
bool cellDataOpen = false
 
std::uint64_t cellsCount = 0
 
VTK::FileFormat format
 
bool imageDataOpen = false
 
std::stringstream metadata
 
bool pieceOpen = false
 
bool pointDataClosed = false
 
bool pointDataOpen = false
 
std::uint64_t pointsCount = 0
 
std::ostream str
 
bool vtkfileOpen = false
 

Detailed Description

template<typename Mesh>
class TNL::Meshes::Writers::VTIWriter< Mesh >

Writer of data linked with meshes into VTI format.

Template Parameters
Meshtype of mesh.

Constructor & Destructor Documentation

◆ VTIWriter()

template<typename Mesh >
TNL::Meshes::Writers::VTIWriter< Mesh >::VTIWriter ( std::ostream & str,
VTK::FileFormat format = VTK::FileFormat::zlib_compressed )

Constructor of a VTIWriter.

Parameters
stroutput stream used for the export of the data.
format

Member Function Documentation

◆ writeCellData()

template<typename Mesh >
template<typename Array >
void TNL::Meshes::Writers::VTIWriter< Mesh >::writeCellData ( const Array & array,
const std::string & name,
int numberOfComponents = 1 )

Writes data linked with mesh cells.

Template Parameters
Arraytype of array holding the data.
Parameters
arrayinstance of an array holding the data.
nameis a name of data which will appear in the outptu file.
numberOfComponentsis number of compononets of the data for each cell.

◆ writeEntities()

template<typename Mesh >
template<int EntityDimension>
void TNL::Meshes::Writers::VTIWriter< Mesh >::writeEntities ( const Mesh & mesh)

Write mesh entites to the output file.

It is here only for compatibility with VTUWriter - it just calls writeImageData, the EntityDimension is unused.

Parameters
meshis a mesh to be exported.

◆ writeMetadata()

template<typename Mesh >
void TNL::Meshes::Writers::VTIWriter< Mesh >::writeMetadata ( std::int32_t cycle = -1,
double time = -1 )

If desired, cycle and time of the simulation can put into the file.

This follows the instructions at http://www.visitusers.org/index.php?title=Time_and_Cycle_in_VTK_files

Parameters
cycleis the of the simulation.
timeis the time of the simulation.

◆ writePointData()

template<typename Mesh >
template<typename Array >
void TNL::Meshes::Writers::VTIWriter< Mesh >::writePointData ( const Array & array,
const std::string & name,
int numberOfComponents = 1 )

Writes data linked with mesh vertexes.

Template Parameters
Arraytype of array holding the data.
Parameters
arrayinstance of an array holding the data.
nameis a name of data which will appear in the outptu file.
numberOfComponentsis number of compononets of the data for each vertex.

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