NLMech  0.1.0
rw::writer::VtkWriter Class Reference

A vtk writer for simple point data and complex fem mesh data. More...

#include <vtkWriter.h>

Collaboration diagram for rw::writer::VtkWriter:
Collaboration graph

Public Member Functions

void close ()
 Closes the file and store it to the hard disk.
 
 VtkWriter (const std::string &filename, const std::string &compress_type="")
 Constructor. More...
 
Mesh data
void appendNodes (const std::vector< util::Point3 > *nodes, const std::vector< util::Point3 > *u=nullptr)
 Writes the nodes to the file. More...
 
void appendMesh (const std::vector< util::Point3 > *nodes, const size_t &element_type, const std::vector< size_t > *en_con, const std::vector< util::Point3 > *u=nullptr)
 Writes the mesh data to file. More...
 
Point data
void appendPointData (const std::string &name, const std::vector< uint8_t > *data)
 Writes the scalar point data to the file. More...
 
void appendPointData (const std::string &name, const std::vector< size_t > *data)
 Writes the scalar point data to the file. More...
 
void appendPointData (const std::string &name, const std::vector< int > *data)
 Writes the scalar point data to the file. More...
 
void appendPointData (const std::string &name, const std::vector< float > *data)
 Writes the scalar point data to the file. More...
 
void appendPointData (const std::string &name, const std::vector< double > *data)
 Writes the scalar point data to the file. More...
 
void appendPointData (const std::string &name, const std::vector< util::Point3 > *data)
 Writes the vector point data to the file. More...
 
void appendPointData (const std::string &name, const std::vector< util::SymMatrix3 > *data)
 Writes the symmetric matrix data associated to nodes to the file. More...
 
void appendPointData (const std::string &name, const std::vector< blaze::StaticMatrix< double, 3, 3 > > *data)
 Writes the matrix data associated to nodes to the file. More...
 
Cell data
void appendCellData (const std::string &name, const std::vector< float > *data)
 Writes the float data associated to cells to the file. More...
 
void appendCellData (const std::string &name, const std::vector< util::SymMatrix3 > *data)
 Writes the symmetric matrix data associated to cells to the file. More...
 
Field data
void appendFieldData (const std::string &name, const double &data)
 Writes the scalar field data to the file. More...
 
void appendFieldData (const std::string &name, const float &data)
 Writes the scalar field data to the file. More...
 
void addTimeStep (const double &timestep)
 Writes the time step to the file. More...
 

Private Attributes

std::string d_compressType
 compression_type Specify the compressor (if any)
 
vtkSmartPointer< vtkUnstructuredGrid > d_grid_p
 Unstructured grid.
 
vtkSmartPointer< vtkXMLUnstructuredGridWriter > d_writer_p
 XML unstructured grid writer.
 

Detailed Description

A vtk writer for simple point data and complex fem mesh data.

Constructor & Destructor Documentation

◆ VtkWriter()

rw::writer::VtkWriter::VtkWriter ( const std::string &  filename,
const std::string &  compress_type = "" 
)
explicit

Constructor.

Creates and opens .vtu file of name given by filename. The file remains open till the close() function is invoked.

Parameters
filenameName of file which will be created
compress_typeCompression method (optional)

Member Function Documentation

◆ addTimeStep()

void rw::writer::VtkWriter::addTimeStep ( const double &  timestep)

Writes the time step to the file.

Parameters
timestepCurrent time step of the simulation

◆ appendCellData() [1/2]

void rw::writer::VtkWriter::appendCellData ( const std::string &  name,
const std::vector< float > *  data 
)

Writes the float data associated to cells to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendCellData() [2/2]

void rw::writer::VtkWriter::appendCellData ( const std::string &  name,
const std::vector< util::SymMatrix3 > *  data 
)

Writes the symmetric matrix data associated to cells to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendFieldData() [1/2]

void rw::writer::VtkWriter::appendFieldData ( const std::string &  name,
const double &  data 
)

Writes the scalar field data to the file.

Parameters
nameName of the data
dataValue

◆ appendFieldData() [2/2]

void rw::writer::VtkWriter::appendFieldData ( const std::string &  name,
const float &  data 
)

Writes the scalar field data to the file.

Parameters
nameName of the data
dataValue

◆ appendMesh()

void rw::writer::VtkWriter::appendMesh ( const std::vector< util::Point3 > *  nodes,
const size_t &  element_type,
const std::vector< size_t > *  en_con,
const std::vector< util::Point3 > *  u = nullptr 
)

Writes the mesh data to file.

Parameters
nodesVector of nodal coordinates
element_typeType of element
en_conVector of element-node connectivity
uVector of nodal displacement

◆ appendNodes()

void rw::writer::VtkWriter::appendNodes ( const std::vector< util::Point3 > *  nodes,
const std::vector< util::Point3 > *  u = nullptr 
)

Writes the nodes to the file.

Parameters
nodesReference positions of the nodes
uNodal displacements

◆ appendPointData() [1/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< blaze::StaticMatrix< double, 3, 3 > > *  data 
)

Writes the matrix data associated to nodes to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [2/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< double > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [3/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< float > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [4/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< int > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [5/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< size_t > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [6/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< uint8_t > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [7/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< util::Point3 > *  data 
)

Writes the vector point data to the file.

Parameters
nameName of the data
dataVector containing the data

◆ appendPointData() [8/8]

void rw::writer::VtkWriter::appendPointData ( const std::string &  name,
const std::vector< util::SymMatrix3 > *  data 
)

Writes the symmetric matrix data associated to nodes to the file.

Parameters
nameName of the data
dataVector containing the data

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