PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
A interface class writing data. More...
#include <writer.h>
Public Member Functions | |
Writer () | |
Constructor. | |
Writer (const std::string &filename, const std::string &format="vtu", const std::string &compress_type="") | |
Constructor. | |
~Writer () | |
Destructor. | |
void | open (const std::string &filename, const std::string &format="vtu", const std::string &compress_type="") |
Open a .vtu file. | |
void | close () |
Closes the file and store it to the hard disk. | |
Mesh data | |
void | appendNodes (const std::vector< util::Point > *nodes, const std::vector< util::Point > *u=nullptr) |
Writes the nodes to the file. | |
void | appendMesh (const std::vector< util::Point > *nodes, const size_t &element_type, const std::vector< size_t > *en_con, const std::vector< util::Point > *u=nullptr) |
Writes the mesh data to file. | |
Point data | |
void | appendPointData (const std::string &name, const std::vector< uint8_t > *data) |
Writes the scalar point data to the file. | |
void | appendPointData (const std::string &name, const std::vector< size_t > *data) |
Writes the scalar point data to the file. | |
void | appendPointData (const std::string &name, const std::vector< int > *data) |
Writes the scalar point data to the file. | |
void | appendPointData (const std::string &name, const std::vector< float > *data) |
Writes the scalar point data to the file. | |
void | appendPointData (const std::string &name, const std::vector< double > *data) |
Writes the scalar point data to the file. | |
void | appendPointData (const std::string &name, const std::vector< util::Point > *data) |
Writes the vector point data to the file. | |
void | appendPointData (const std::string &name, const std::vector< util::SymMatrix3 > *data) |
Writes the symmetric matrix data associated to nodes to the file. | |
Cell data | |
void | appendCellData (const std::string &name, const std::vector< float > *data) |
Writes the float data associated to cells to the file. | |
void | appendCellData (const std::string &name, const std::vector< util::SymMatrix3 > *data) |
Writes the symmetric matrix data associated to cells to the file. | |
Field data | |
void | appendFieldData (const std::string &name, const double &data) |
Writes the scalar field data to the file. | |
void | appendFieldData (const std::string &name, const float &data) |
Writes the scalar field data to the file. | |
void | addTimeStep (const double ×tep) |
Writes the time step to the file. | |
Private Attributes | |
rw::writer::VtkWriter * | d_vtkWriter_p |
Pointer to the vtk writer class. | |
rw::writer::LegacyVtkWriter * | d_legacyVtkWriter_p |
Pointer to the vtk writer class. | |
rw::writer::MshWriter * | d_mshWriter_p |
Pointer to the vtk writer class. | |
std::string | d_format |
Format of output file. | |
A interface class writing data.
This interface separates the caller from vtk library.
rw::writer::Writer::Writer | ( | ) |
Constructor.
Definition at line 16 of file writer.cpp.
|
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) |
Definition at line 20 of file writer.cpp.
References open().
rw::writer::Writer::~Writer | ( | ) |
void rw::writer::Writer::addTimeStep | ( | const double & | timestep | ) |
Writes the time step to the file.
timestep | Current time step of the simulation |
Definition at line 172 of file writer.cpp.
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 |
Definition at line 150 of file writer.cpp.
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 |
Definition at line 161 of file writer.cpp.
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 |
Definition at line 182 of file writer.cpp.
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 |
Definition at line 193 of file writer.cpp.
void rw::writer::Writer::appendMesh | ( | const std::vector< util::Point > * | nodes, |
const size_t & | element_type, | ||
const std::vector< size_t > * | en_con, | ||
const std::vector< util::Point > * | 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 |
Definition at line 61 of file writer.cpp.
void rw::writer::Writer::appendNodes | ( | const std::vector< util::Point > * | nodes, |
const std::vector< util::Point > * | u = nullptr |
||
) |
Writes the nodes to the file.
nodes | Reference positions of the nodes |
u | Nodal displacements |
Definition at line 49 of file writer.cpp.
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 |
Definition at line 117 of file writer.cpp.
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 |
Definition at line 106 of file writer.cpp.
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 |
Definition at line 95 of file writer.cpp.
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 |
Definition at line 84 of file writer.cpp.
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 |
Definition at line 73 of file writer.cpp.
void rw::writer::Writer::appendPointData | ( | const std::string & | name, |
const std::vector< util::Point > * | data | ||
) |
Writes the vector point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 128 of file writer.cpp.
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 |
Definition at line 139 of file writer.cpp.
void rw::writer::Writer::close | ( | ) |
Closes the file and store it to the hard disk.
Definition at line 204 of file writer.cpp.
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) |
Definition at line 28 of file writer.cpp.
Referenced by Writer().
|
private |
|
private |
|
private |
|
private |