24 GeoLib::Point const& point,
const bool multiple_nodes_allowed)
25 : _mesh(mesh), _point(point)
31 "BoundaryElementsAtPoint: the mesh node searcher was unable to "
32 "locate the point ({:f}, {:f}, {:f}) in the mesh.",
35 if (node_ids.size() == 1)
37 std::array<MeshLib::Node*, 1>
const nodes = {
44 const_cast<std::vector<MeshLib::Node*>&
>(mesh.
getNodes());
45 std::size_t
const nearest_node_id =
46 *std::min_element(node_ids.begin(), node_ids.end(),
47 [&mesh_nodes, &point](
auto id0,
auto id1)
49 return MathLib::sqrDist(*mesh_nodes[id0], point) <
50 MathLib::sqrDist(*mesh_nodes[id1], point);
53 if (!multiple_nodes_allowed)
56 "BoundaryElementsAtPoint: the mesh node searcher found {:d} points "
57 "near the requested point ({:f}, {:f}, {:f}) in the mesh, while "
58 "exactly one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has "
61 mesh_nodes[nearest_node_id]->
getID(),
62 (*mesh_nodes[nearest_node_id])[0],
63 (*mesh_nodes[nearest_node_id])[1],
64 (*mesh_nodes[nearest_node_id])[2],
68 "BoundaryElementsAtPoint: the mesh node searcher found {:d} points "
69 "near the requested point ({:f}, {:f}, {:f}) in the mesh, while "
70 "exactly one is expected. Node (id={:d}) ({:f}, {:f}, {:f}) has "
73 mesh_nodes[nearest_node_id]->
getID(), (*mesh_nodes[nearest_node_id])[0],
74 (*mesh_nodes[nearest_node_id])[1], (*mesh_nodes[nearest_node_id])[2],
77 std::array<MeshLib::Node*, 1>
const nodes = {
Definition of the Point class.
void WARN(char const *fmt, Args const &... args)
Definition of the Mesh class.
Definition of the Node class.
Definition of the Point3d class.
std::size_t getID() const
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
const Node * getNode(std::size_t idx) const
Get the node with the given index.
double sqrDist(MathLib::Point3d const &p0, MathLib::Point3d const &p1)