![]() |
NLMech
0.1.0
|
A interface class writing data. More...
#include <writer.h>

Public Member Functions | |
| void | close () |
| Closes the file and store it to the hard disk. | |
| void | open (const std::string &filename, const std::string &format="vtu", const std::string &compress_type="") |
| Open a .vtu file. More... | |
| Writer () | |
| Constructor. | |
| Writer (const std::string &filename, const std::string &format="vtu", const std::string &compress_type="") | |
| Constructor. More... | |
| ~Writer () | |
| Destructor. | |
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 ×tep) |
| Writes the time step to the file. More... | |
Private Member Functions | |
| void | checkLength (const size_t length, const std::string &name) |
| Check if the field is not zero This check is important for the legacy vtk writer, since empty fields result in warnings while laoding the data. More... | |
Private Attributes | |
| std::string | d_format |
| Format of output file. | |
| rw::writer::LegacyVtkWriter * | d_legacyVtkWriter_p |
| Pointer to the vtk writer class. | |
| rw::writer::MshWriter * | d_mshWriter_p |
| Pointer to the vtk writer class. | |
| rw::writer::VtkWriter * | d_vtkWriter_p |
| Pointer to the vtk writer class. | |
A interface class writing data.
This interface separates the caller from vtk library.
|
explicit |
Constructor.
Creates and opens .vtu file of name given by filename. The file remains open till the close() function is invoked or if the instance of this class is destroyed.
| filename | Name of file which will be created |
| format | Format of the output file, e.g. "vtu", "msh" |
| compress_type | Specify the compression type (optional) |

| void rw::writer::Writer::addTimeStep | ( | const double & | timestep | ) |
Writes the time step to the file.
| timestep | Current time step of the simulation |
Referenced by tools::pp::Compute::initWriter().

| void rw::writer::Writer::appendCellData | ( | const std::string & | name, |
| const std::vector< float > * | data | ||
| ) |
Writes the float data associated to cells to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendCellData | ( | const std::string & | name, |
| const std::vector< util::SymMatrix3 > * | data | ||
| ) |
Writes the symmetric matrix data associated to cells to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendFieldData | ( | const std::string & | name, |
| const double & | data | ||
| ) |
Writes the scalar field data to the file.
| name | Name of the data |
| data | Value |
| void rw::writer::Writer::appendFieldData | ( | const std::string & | name, |
| const float & | data | ||
| ) |
Writes the scalar field data to the file.
| name | Name of the data |
| data | Value |
| void rw::writer::Writer::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.
| nodes | Vector of nodal coordinates |
| element_type | Type of element |
| en_con | Vector of element-node connectivity |
| u | Vector of nodal displacement |
Referenced by tools::pp::Compute::initWriter().

| void rw::writer::Writer::appendNodes | ( | const std::vector< util::Point3 > * | nodes, |
| const std::vector< util::Point3 > * | u = nullptr |
||
| ) |
Writes the nodes to the file.
| nodes | Reference positions of the nodes |
| u | Nodal displacements |
Referenced by tools::pp::Compute::initWriter().

| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< blaze::StaticMatrix< double, 3, 3 > > * | data | ||
| ) |
Writes the matrix data associated to nodes to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< double > * | data | ||
| ) |
Writes the scalar point data to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< float > * | data | ||
| ) |
Writes the scalar point data to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< int > * | data | ||
| ) |
Writes the scalar point data to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< size_t > * | data | ||
| ) |
Writes the scalar point data to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< uint8_t > * | data | ||
| ) |
Writes the scalar point data to the file.
| name | Name of the data |
| data | Vector containing the data |
Referenced by tools::pp::Compute::Compute(), tools::pp::Compute::transformU(), and tools::pp::Compute::transformV().

| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< util::Point3 > * | data | ||
| ) |
Writes the vector point data to the file.
| name | Name of the data |
| data | Vector containing the data |
| void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
| const std::vector< util::SymMatrix3 > * | data | ||
| ) |
Writes the symmetric matrix data associated to nodes to the file.
| name | Name of the data |
| data | Vector containing the data |
|
inlineprivate |
Check if the field is not zero This check is important for the legacy vtk writer, since empty fields result in warnings while laoding the data.
| length | Size of the field |
| name | Name of the field |
| void rw::writer::Writer::open | ( | const std::string & | filename, |
| const std::string & | format = "vtu", |
||
| const std::string & | compress_type = "" |
||
| ) |
Open a .vtu file.
| filename | Name of file which will be created |
| format | Format of the output file, e.g. "vtu", "msh" |
| compress_type | Compression type (optional) |
Referenced by tools::pp::Compute::initWriter(), and Writer().
