PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
A class to read Gmsh (msh) mesh files. More...
#include <mshReader.h>
Public Member Functions | |
MshReader (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< util::Point > *data) |
reads point data from .vtu file | |
bool | readPointData (const std::string &name, std::vector< double > *data) |
reads point data from .vtu file | |
void | close () |
Close the file. | |
Private Attributes | |
std::string | d_filename |
filename | |
std::ifstream | d_file |
vtk/vtu file | |
A class to read Gmsh (msh) mesh files.
This class can only handle Gmsh version 2.0, 2.1, 2.2.
Definition at line 28 of file mshReader.h.
|
explicit |
Constructor.
filename | Name of the mesh file |
Definition at line 19 of file mshReader.cpp.
void rw::reader::MshReader::close | ( | ) |
void rw::reader::MshReader::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 316 of file mshReader.cpp.
References util::io::isFileEmpty(), util::msh_map_element_to_num_nodes, util::msh_type_quadrangle, util::msh_type_tetrahedron, util::msh_type_triangle, util::vtk_type_quad, util::vtk_type_tetra, and util::vtk_type_triangle.
void rw::reader::MshReader::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 22 of file mshReader.cpp.
References util::io::isFileEmpty(), util::msh_map_element_to_num_nodes, util::msh_type_quadrangle, util::msh_type_tetrahedron, util::msh_type_triangle, util::vtk_type_quad, util::vtk_type_tetra, and util::vtk_type_triangle.
void rw::reader::MshReader::readNodes | ( | std::vector< util::Point > * | nodes | ) |
Reads nodal position.
nodes | Vector of nodal coordinates |
Definition at line 230 of file mshReader.cpp.
References util::io::isFileEmpty().
bool rw::reader::MshReader::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 553 of file mshReader.cpp.
bool rw::reader::MshReader::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 481 of file mshReader.cpp.
|
private |
vtk/vtu file
Definition at line 97 of file mshReader.h.
|
private |
filename
Definition at line 94 of file mshReader.h.