19 GeoLib::Point const& point,
const bool multiple_nodes_allowed)
25 std::size_t
const number_of_found_nodes_at_rank = node_ids.size();
29 if (number_of_total_found_nodes == 0)
32 "BoundaryElementsAtPoint: the mesh node searcher was unable to "
33 "locate the point ({:f}, {:f}, {:f}) in the mesh.",
37 if (number_of_found_nodes_at_rank == 0)
45 "BoundaryElementsAtPoint: the mesh node searcher was unable to "
46 "locate the point ({:f}, {:f}, {:f}) in the mesh.",
51 if (node_ids.size() == 1)
53 std::array<MeshLib::Node*, 1>
const nodes = {
61 const_cast<std::vector<MeshLib::Node*>&
>(mesh.
getNodes());
62 std::size_t
const nearest_node_id =
63 *std::min_element(node_ids.begin(), node_ids.end(),
64 [&mesh_nodes, &point](
auto id0,
auto id1)
66 return MathLib::sqrDist(*mesh_nodes[id0], point) <
67 MathLib::sqrDist(*mesh_nodes[id1], point);
70 if (!multiple_nodes_allowed)
73 "BoundaryElementsAtPoint: the mesh node searcher found {:d} points "
74 "near the requested point ({:f}, {:f}, {:f}) in the mesh, while "
75 "exactly one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has "
78 mesh_nodes[nearest_node_id]->getID(),
79 (*mesh_nodes[nearest_node_id])[0],
80 (*mesh_nodes[nearest_node_id])[1],
81 (*mesh_nodes[nearest_node_id])[2],
85 "BoundaryElementsAtPoint: the mesh node searcher found {:d} points "
86 "near the requested point ({:f}, {:f}, {:f}) in the mesh, while "
87 "exactly one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has "
90 mesh_nodes[nearest_node_id]->getID(), (*mesh_nodes[nearest_node_id])[0],
91 (*mesh_nodes[nearest_node_id])[1], (*mesh_nodes[nearest_node_id])[2],
94 std::array<MeshLib::Node*, 1>
const nodes = {