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::VTKWriter< Mesh > Class Template Reference

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

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

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

Public Member Functions

 VTKWriter ()=delete
 Construct with no parameters is not allowed.
 
 VTKWriter (std::ostream &str, VTK::FileFormat format=VTK::FileFormat::binary)
 Constructor of a VTIWriter.
 
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 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 writeHeader ()
 
void writePoints (const Mesh &mesh)
 

Protected Attributes

int cellDataArrays = 0
 
std::uint64_t cellsCount = 0
 
VTK::DataType currentSection = VTK::DataType::CellData
 
VTK::FileFormat format
 
bool headerWritten = false
 
int pointDataArrays = 0
 
std::uint64_t pointsCount = 0
 
std::ostream str
 

Detailed Description

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

Writer of data linked with meshes into VTK format.

Template Parameters
Meshtype of mesh.

Constructor & Destructor Documentation

◆ VTKWriter()

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

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::VTKWriter< 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::VTKWriter< Mesh >::writeEntities ( const Mesh & mesh)

Write mesh entites to the output file.

Template Parameters
EntityDimensionis a dimension of entities to be exported.
Parameters
meshis a mesh to be exported.

◆ writeMetadata()

template<typename Mesh >
void TNL::Meshes::Writers::VTKWriter< 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::VTKWriter< 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: