PolyFEM
Loading...
Searching...
No Matches
polyfem::mesh::MeshReader Class Reference

Stateless format decoders used exclusively by MeshLoader and in-memory adapters. More...

#include <MeshReader.hpp>

Static Public Member Functions

static MeshData read_msh (const std::filesystem::path &path)
 
static MeshData read_hybrid (std::istream &input, const std::string &description)
 
static MeshData read_obj (std::istream &input, const std::string &description)
 Reads a 2D polygonal mesh (planar OBJ) or a single polyhedron given by its boundary (non-planar OBJ).
 
static SurfaceMeshData read_msh_surface (const std::filesystem::path &path, bool keep_volume=false)
 
static SurfaceMeshData read_obj_surface (const std::filesystem::path &path)
 
static bool read_triangle_surface (const std::filesystem::path &path, SurfaceMeshData &result)
 

Detailed Description

Stateless format decoders used exclusively by MeshLoader and in-memory adapters.

Definition at line 23 of file MeshReader.hpp.

Member Function Documentation

◆ read_hybrid()

MeshData polyfem::mesh::MeshReader::read_hybrid ( std::istream &  input,
const std::string &  description 
)
static

Definition at line 164 of file MeshReader.cpp.

References polyfem::mesh::MeshData::cell_face_orientations, polyfem::mesh::MeshData::cell_faces, polyfem::mesh::MeshData::cell_is_hex, polyfem::mesh::MeshData::cell_kernel_points, polyfem::mesh::MeshData::elements_are_ordered, faces, polyfem::mesh::MeshData::faces, and polyfem::log_and_throw_error().

Referenced by polyfem::mesh::MeshLoader::load_fem().

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

◆ read_msh()

MeshData polyfem::mesh::MeshReader::read_msh ( const std::filesystem::path &  path)
static

Definition at line 136 of file MeshReader.cpp.

References polyfem::mesh::MeshData::body_ids, polyfem::mesh::MeshData::boundary_elements, polyfem::mesh::MeshData::boundary_ids, polyfem::mesh::MeshData::dimension(), polyfem::mesh::MeshData::elements, polyfem::mesh::MeshData::higher_order_connectivity, polyfem::mesh::MeshData::higher_order_nodes, polyfem::mesh::MeshData::higher_order_weights, polyfem::io::MshReader::load(), polyfem::log_and_throw_error(), polyfem::mesh::MeshData::vertices, and weights.

Referenced by polyfem::mesh::MeshLoader::load_fem().

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

◆ read_msh_surface()

SurfaceMeshData polyfem::mesh::MeshReader::read_msh_surface ( const std::filesystem::path &  path,
bool  keep_volume = false 
)
static
Parameters
keep_volumeFor a 3D tet mesh, keep every vertex and the tets, and index the boundary faces into the full vertex set.

Definition at line 316 of file MeshReader.cpp.

References polyfem::mesh::SurfaceMeshData::edges, polyfem::mesh::extract_triangle_surface_from_tets(), polyfem::mesh::SurfaceMeshData::faces, polyfem::mesh::find_triangle_surface_from_tets(), polyfem::io::MshReader::load(), polyfem::log_and_throw_error(), polyfem::mesh::SurfaceMeshData::points, polyfem::mesh::SurfaceMeshData::tets, polyfem::mesh::SurfaceMeshData::vertices, and weights.

Referenced by polyfem::mesh::MeshLoader::load_surface().

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

◆ read_obj()

MeshData polyfem::mesh::MeshReader::read_obj ( std::istream &  input,
const std::string &  description 
)
static

Reads a 2D polygonal mesh (planar OBJ) or a single polyhedron given by its boundary (non-planar OBJ).

Definition at line 265 of file MeshReader.cpp.

References polyfem::log_and_throw_error(), and V.

Referenced by polyfem::mesh::MeshLoader::load_fem().

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

◆ read_obj_surface()

SurfaceMeshData polyfem::mesh::MeshReader::read_obj_surface ( const std::filesystem::path &  path)
static

Definition at line 354 of file MeshReader.cpp.

References polyfem::mesh::SurfaceMeshData::edges, polyfem::mesh::SurfaceMeshData::faces, polyfem::log_and_throw_error(), polyfem::io::OBJReader::read(), and polyfem::mesh::SurfaceMeshData::vertices.

Referenced by polyfem::mesh::MeshLoader::load_surface().

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

◆ read_triangle_surface()

bool polyfem::mesh::MeshReader::read_triangle_surface ( const std::filesystem::path &  path,
SurfaceMeshData &  result 
)
static

Definition at line 363 of file MeshReader.cpp.

References polyfem::mesh::SurfaceMeshData::faces, and polyfem::mesh::SurfaceMeshData::vertices.

Referenced by polyfem::mesh::MeshLoader::load_surface().

Here is the caller graph for this function:

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