| 67 | } |
| 68 | |
| 69 | void 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 | |
| 97 | void PointLocator::init_barycentric_solvers() { |
| 98 | const size_t dim = m_mesh->get_dim(); |
nothing calls this directly
no test coverage detected