25 GeoLib::Point const& point,
const bool multiple_nodes_allowed)
31 std::size_t
const number_of_found_nodes_at_rank = node_ids.size();
35 if (number_of_total_found_nodes == 0)
38 "BoundaryElementsAtPoint: the mesh node searcher was unable to "
39 "locate the point ({:f}, {:f}, {:f}) in the mesh.",
43 if (number_of_found_nodes_at_rank == 0)
51 "BoundaryElementsAtPoint: the mesh node searcher was unable to "
52 "locate the point ({:f}, {:f}, {:f}) in the mesh.",
57 if (node_ids.size() == 1)
59 std::array<MeshLib::Node*, 1>
const nodes = {
67 const_cast<std::vector<MeshLib::Node*>&
>(mesh.
getNodes());
68 std::size_t
const nearest_node_id =
69 *std::min_element(node_ids.begin(), node_ids.end(),
70 [&mesh_nodes, &point](
auto id0,
auto id1)
72 return MathLib::sqrDist(*mesh_nodes[id0], point) <
73 MathLib::sqrDist(*mesh_nodes[id1], point);
76 if (!multiple_nodes_allowed)
79 "BoundaryElementsAtPoint: the mesh node searcher found {:d} points "
80 "near the requested point ({:f}, {:f}, {:f}) in the mesh, while "
81 "exactly one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has "
84 mesh_nodes[nearest_node_id]->
getID(),
85 (*mesh_nodes[nearest_node_id])[0],
86 (*mesh_nodes[nearest_node_id])[1],
87 (*mesh_nodes[nearest_node_id])[2],
91 "BoundaryElementsAtPoint: the mesh node searcher found {:d} points "
92 "near the requested point ({:f}, {:f}, {:f}) in the mesh, while "
93 "exactly one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has "
96 mesh_nodes[nearest_node_id]->
getID(), (*mesh_nodes[nearest_node_id])[0],
97 (*mesh_nodes[nearest_node_id])[1], (*mesh_nodes[nearest_node_id])[2],
100 std::array<MeshLib::Node*, 1>
const nodes = {