MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / init_elements

Method init_elements

tools/MeshUtils/PointLocator.cpp:69–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void PointLocator::init_elements() {
70 const size_t dim = m_mesh->get_dim();
71
72 if (dim == 2) {
73 if (m_mesh->get_num_faces() == 0) {
74 throw RuntimeError("2D Mesh has no faces.");
75 }
76 m_elements = m_mesh->get_faces();
77 m_vertex_per_element = m_mesh->get_vertex_per_face();
78 if (m_vertex_per_element != 3) {
79 throw NotImplementedError(
80 "Only triangle elements are supported in 2D");
81 }
82 } else if (dim == 3) {
83 if (m_mesh->get_num_voxels() == 0) {
84 throw RuntimeError("3D Mesh has no voxels.");
85 }
86 m_elements = m_mesh->get_voxels();
87 m_vertex_per_element = m_mesh->get_vertex_per_voxel();
88 if (m_vertex_per_element != 4) {
89 throw NotImplementedError(
90 "Only tetrahedron elements are supported in 2D");
91 }
92 } else {
93 throw NotImplementedError("Only 2D and 3D mesh are supported");
94 }
95}
96
97void PointLocator::init_barycentric_solvers() {
98 const size_t dim = m_mesh->get_dim();

Callers

nothing calls this directly

Calls 9

RuntimeErrorClass · 0.85
NotImplementedErrorClass · 0.85
get_dimMethod · 0.45
get_num_facesMethod · 0.45
get_facesMethod · 0.45
get_vertex_per_faceMethod · 0.45
get_num_voxelsMethod · 0.45
get_voxelsMethod · 0.45
get_vertex_per_voxelMethod · 0.45

Tested by

no test coverage detected