Wildmeshing Toolkit
wmtk::io::MshReader Class Reference

#include <MshReader.hpp>

Public Member Functions

 MshReader ()
 
 ~MshReader ()
 
std::shared_ptr< Meshread (const std::filesystem::path &filename, const bool ignore_z_if_zero, const std::vector< std::string > &extra_facet_attributes={})
 
std::shared_ptr< Meshread (const std::filesystem::path &filename, const int64_t embedded_dimension, const std::vector< std::vector< std::string >> &extra_attributes)
 
std::shared_ptr< Meshread (const std::filesystem::path &filename, const int64_t embedded_dimension=-1)
 

Private Member Functions

const mshio::NodeBlock * get_vertex_block (int DIM) const
 
const mshio::ElementBlock * get_simplex_element_block (int DIM) const
 
size_t get_num_vertices (int DIM) const
 
size_t get_num_simplex_elements (int DIM) const
 
template<int DIM>
void extract_vertices ()
 
template<int DIM>
void extract_simplex_elements ()
 
template<int DIM>
void extract ()
 
template<int DIM>
void validate ()
 
int get_mesh_dimension () const
 
int get_embedded_dimension () const
 
std::shared_ptr< Meshgenerate (const std::optional< std::vector< std::vector< std::string >>> &extra_attributes={})
 
template<int DIM>
auto generateT () -> std::shared_ptr< wmtk::utils::mesh_type_from_dimension_t< DIM >>
 
template<int DIM>
auto construct () -> std::shared_ptr< wmtk::utils::mesh_type_from_dimension_t< DIM >>
 
void extract_element_attribute (wmtk::Mesh &m, const std::string &attr_name, PrimitiveType pt)
 
template<>
void validate ()
 

Private Attributes

mshio::MshSpec m_spec
 
int64_t m_embedded_dimension
 
Eigen::MatrixXd V
 
MatrixXl S
 

Static Private Attributes

static const int64_t AUTO_EMBEDDED_DIMENSION = -2
 

Detailed Description

Definition at line 14 of file MshReader.hpp.

Constructor & Destructor Documentation

◆ MshReader()

wmtk::io::MshReader::MshReader ( )
default

◆ ~MshReader()

wmtk::io::MshReader::~MshReader ( )
default

Member Function Documentation

◆ construct()

template<int DIM>
auto wmtk::io::MshReader::construct
private

Definition at line 196 of file MshReader.cpp.

◆ extract()

template<int DIM>
void wmtk::io::MshReader::extract
private

Definition at line 23 of file MshReader.cpp.

◆ extract_element_attribute()

void wmtk::io::MshReader::extract_element_attribute ( wmtk::Mesh m,
const std::string &  attr_name,
PrimitiveType  pt 
)
private

Definition at line 282 of file MshReader.cpp.

References wmtk::Mesh::create_accessor(), wmtk::Mesh::get_all(), wmtk::get_primitive_type_id(), get_simplex_element_block(), m_spec, wmtk::Mesh::register_attribute(), and wmtk::Mesh::top_simplex_type().

Here is the call graph for this function:

◆ extract_simplex_elements()

template<int DIM>
void wmtk::io::MshReader::extract_simplex_elements
private

Definition at line 166 of file MshReader.cpp.

References get_simplex_element_block(), get_vertex_block(), and S.

Here is the call graph for this function:

◆ extract_vertices()

template<int DIM>
void wmtk::io::MshReader::extract_vertices
private

Definition at line 128 of file MshReader.cpp.

References AUTO_EMBEDDED_DIMENSION, get_vertex_block(), m_embedded_dimension, and V.

Here is the call graph for this function:

◆ generate()

auto wmtk::io::MshReader::generate ( const std::optional< std::vector< std::vector< std::string >>> &  extra_attributes = {})
private

Definition at line 320 of file MshReader.cpp.

References wmtk::get_primitive_type_from_id(), wmtk::log_and_throw_error(), wmtk::mesh_utils::set_matrix_attribute(), and wmtk::Vertex.

Referenced by read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateT()

template<int DIM>
auto wmtk::io::MshReader::generateT
private

Definition at line 361 of file MshReader.cpp.

◆ get_embedded_dimension()

int wmtk::io::MshReader::get_embedded_dimension ( ) const
private

Definition at line 119 of file MshReader.cpp.

References get_mesh_dimension(), and get_vertex_block().

Referenced by read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mesh_dimension()

int wmtk::io::MshReader::get_mesh_dimension ( ) const
private

Definition at line 28 of file MshReader.cpp.

References get_num_simplex_elements().

Referenced by get_embedded_dimension(), and read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_num_simplex_elements()

size_t wmtk::io::MshReader::get_num_simplex_elements ( int  DIM) const
private

Definition at line 108 of file MshReader.cpp.

References get_simplex_element_block().

Referenced by get_mesh_dimension().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_num_vertices()

size_t wmtk::io::MshReader::get_num_vertices ( int  DIM) const
private

Definition at line 98 of file MshReader.cpp.

References get_vertex_block().

Here is the call graph for this function:

◆ get_simplex_element_block()

const mshio::ElementBlock * wmtk::io::MshReader::get_simplex_element_block ( int  DIM) const
private

Definition at line 88 of file MshReader.cpp.

References m_spec.

Referenced by extract_element_attribute(), extract_simplex_elements(), and get_num_simplex_elements().

Here is the caller graph for this function:

◆ get_vertex_block()

const mshio::NodeBlock * wmtk::io::MshReader::get_vertex_block ( int  DIM) const
private

Definition at line 78 of file MshReader.cpp.

References m_spec.

Referenced by extract_simplex_elements(), extract_vertices(), get_embedded_dimension(), and get_num_vertices().

Here is the caller graph for this function:

◆ read() [1/3]

std::shared_ptr< Mesh > wmtk::io::MshReader::read ( const std::filesystem::path &  filename,
const bool  ignore_z_if_zero,
const std::vector< std::string > &  extra_facet_attributes = {} 
)

Definition at line 38 of file MshReader.cpp.

References AUTO_EMBEDDED_DIMENSION, generate(), get_mesh_dimension(), m_embedded_dimension, and m_spec.

Referenced by wmtk::io::read_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [2/3]

std::shared_ptr< Mesh > wmtk::io::MshReader::read ( const std::filesystem::path &  filename,
const int64_t  embedded_dimension,
const std::vector< std::vector< std::string >> &  extra_attributes 
)

Definition at line 54 of file MshReader.cpp.

References generate(), get_embedded_dimension(), m_embedded_dimension, and m_spec.

Here is the call graph for this function:

◆ read() [3/3]

std::shared_ptr< Mesh > wmtk::io::MshReader::read ( const std::filesystem::path &  filename,
const int64_t  embedded_dimension = -1 
)

Definition at line 66 of file MshReader.cpp.

References generate(), get_embedded_dimension(), m_embedded_dimension, and m_spec.

Here is the call graph for this function:

◆ validate() [1/2]

template<>
void wmtk::io::MshReader::validate ( )
private

Definition at line 373 of file MshReader.cpp.

References wmtk::utils::exactinit(), wmtk::log_and_throw_error(), wmtk::logger(), S, V, and wmtk::utils::wmtk_orient3d().

Here is the call graph for this function:

◆ validate() [2/2]

template<int DIM>
void wmtk::io::MshReader::validate
private

Definition at line 369 of file MshReader.cpp.

Member Data Documentation

◆ AUTO_EMBEDDED_DIMENSION

const int64_t wmtk::io::MshReader::AUTO_EMBEDDED_DIMENSION = -2
staticprivate

Definition at line 94 of file MshReader.hpp.

Referenced by extract_vertices(), and read().

◆ m_embedded_dimension

int64_t wmtk::io::MshReader::m_embedded_dimension
private

Definition at line 88 of file MshReader.hpp.

Referenced by extract_vertices(), and read().

◆ m_spec

mshio::MshSpec wmtk::io::MshReader::m_spec
private

◆ S

MatrixXl wmtk::io::MshReader::S
private

Definition at line 92 of file MshReader.hpp.

Referenced by extract_simplex_elements(), and validate().

◆ V

Eigen::MatrixXd wmtk::io::MshReader::V
private

Definition at line 91 of file MshReader.hpp.

Referenced by extract_vertices(), and validate().


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