PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
A class to read VTK (.vtu) mesh files. More...
#include <vtkReader.h>
Public Member Functions | |
VtkReader (const std::string &filename) | |
Constructor. | |
void | readMesh (size_t dim, std::vector< util::Point > *nodes, size_t &element_type, size_t &num_elems, std::vector< size_t > *enc, std::vector< std::vector< size_t > > *nec, std::vector< double > *volumes, bool is_fd=false) |
Reads mesh data into node file and element file. | |
void | readNodes (std::vector< util::Point > *nodes) |
Reads nodal position. | |
void | readCells (size_t dim, size_t &element_type, size_t &num_elems, std::vector< size_t > *enc, std::vector< std::vector< size_t > > *nec) |
Reads cell data, i.e. element-node connectivity and node-element connectivity. | |
bool | readPointData (const std::string &name, std::vector< uint8_t > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< size_t > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< int > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< float > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< double > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< util::Point > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< util::SymMatrix3 > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< util::Matrix3 > *data) |
reads point data from .vtu file | |
bool | readCellData (const std::string &name, std::vector< float > *data) |
reads cell data from .vtu file | |
bool | readCellData (const std::string &name, std::vector< double > *data) |
reads cell data from .vtu file | |
bool | readCellData (const std::string &name, std::vector< util::Point > *data) |
reads cell data from .vtu file | |
bool | readCellData (const std::string &name, std::vector< util::SymMatrix3 > *data) |
reads cell data from .vtu file | |
bool | readCellData (const std::string &name, std::vector< util::Matrix3 > *data) |
reads cell data from .vtu file | |
void | close () |
Close the file. | |
Private Attributes | |
vtkSmartPointer< vtkXMLUnstructuredGridReader > | d_reader_p |
XML unstructured grid writer. | |
vtkSmartPointer< vtkUnstructuredGrid > | d_grid_p |
Unstructured grid. | |
Static Private Attributes | |
static size_t | d_count = 0 |
Counter. | |
A class to read VTK (.vtu) mesh files.
Definition at line 32 of file vtkReader.h.
|
explicit |
Constructor.
filename | Name of mesh file (with/without .vtu extension) |
Definition at line 30 of file vtkReader.cpp.
References util::io::checkAndCreateNewFilename(), d_count, and d_reader_p.
void rw::reader::VtkReader::close | ( | ) |
Close the file.
Definition at line 616 of file vtkReader.cpp.
bool rw::reader::VtkReader::readCellData | ( | const std::string & | name, |
std::vector< double > * | data | ||
) |
reads cell data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 494 of file vtkReader.cpp.
bool rw::reader::VtkReader::readCellData | ( | const std::string & | name, |
std::vector< float > * | data | ||
) |
reads cell data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 468 of file vtkReader.cpp.
bool rw::reader::VtkReader::readCellData | ( | const std::string & | name, |
std::vector< util::Matrix3 > * | data | ||
) |
reads cell data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 575 of file vtkReader.cpp.
bool rw::reader::VtkReader::readCellData | ( | const std::string & | name, |
std::vector< util::Point > * | data | ||
) |
reads cell data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 520 of file vtkReader.cpp.
bool rw::reader::VtkReader::readCellData | ( | const std::string & | name, |
std::vector< util::SymMatrix3 > * | data | ||
) |
reads cell data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 547 of file vtkReader.cpp.
void rw::reader::VtkReader::readCells | ( | size_t | dim, |
size_t & | element_type, | ||
size_t & | num_elems, | ||
std::vector< size_t > * | enc, | ||
std::vector< std::vector< size_t > > * | nec | ||
) |
Reads cell data, i.e. element-node connectivity and node-element connectivity.
dim | Dimension |
element_type | Type of element |
num_elems | Number of elements |
enc | Element-node connectivity |
nec | Node-element connectivity |
Definition at line 183 of file vtkReader.cpp.
References util::vtk_map_element_to_num_nodes.
void rw::reader::VtkReader::readMesh | ( | size_t | dim, |
std::vector< util::Point > * | nodes, | ||
size_t & | element_type, | ||
size_t & | num_elems, | ||
std::vector< size_t > * | enc, | ||
std::vector< std::vector< size_t > > * | nec, | ||
std::vector< double > * | volumes, | ||
bool | is_fd = false |
||
) |
Reads mesh data into node file and element file.
dim | Dimension |
nodes | Vector of nodes data |
element_type | Type of element |
num_elems | Number of elements |
enc | Vector holding element-node connectivity |
nec | Vector holding node-element connectivity |
volumes | Vector holding volume of the nodes |
is_fd | Flag indicating if this mesh is for finite_difference simulation |
Definition at line 41 of file vtkReader.cpp.
References util::vtk_map_element_to_num_nodes.
void rw::reader::VtkReader::readNodes | ( | std::vector< util::Point > * | nodes | ) |
Reads nodal position.
nodes | Vector of nodal coordinates |
Definition at line 165 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< double > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 346 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< float > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 320 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< int > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 294 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< size_t > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 268 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< uint8_t > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 242 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< util::Matrix3 > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 427 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< util::Point > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 372 of file vtkReader.cpp.
bool rw::reader::VtkReader::readPointData | ( | const std::string & | name, |
std::vector< util::SymMatrix3 > * | data | ||
) |
reads point data from .vtu file
name | Name of data |
data | Pointer to the vector of data |
Definition at line 399 of file vtkReader.cpp.
|
staticprivate |
|
private |
Unstructured grid.
Definition at line 139 of file vtkReader.h.
|
private |
XML unstructured grid writer.
Definition at line 136 of file vtkReader.h.
Referenced by VtkReader().