diff --git a/MeshGeoToolsLib/MeshNodeSearcher.cpp b/MeshGeoToolsLib/MeshNodeSearcher.cpp index 8b67976f638b144a8b05e53d020b119b2b9a6e87..85df600ca7d513c4e4afa0b415dadfc189182743 100644 --- a/MeshGeoToolsLib/MeshNodeSearcher.cpp +++ b/MeshGeoToolsLib/MeshNodeSearcher.cpp @@ -11,6 +11,7 @@ #include "MeshNodeSearcher.h" #include <typeinfo> +#include <sstream> #include "HeuristicSearchLength.h" #include "MeshNodesAlongPolyline.h" @@ -109,12 +110,21 @@ std::vector<std::size_t> MeshNodeSearcher::getMeshNodeIDs( } if (ids.size() != 1) { + std::stringstream ss; + auto const& bulk_nodes = _mesh.getNodes(); + for (auto const id : ids) + { + ss << "- bulk node: " << (*bulk_nodes[id]) << ", distance: " + << std::sqrt(MathLib::sqrDist(bulk_nodes[id]->getCoords(), + p.getCoords())) + << "\n"; + } OGS_FATAL( "Found %d nodes in the mesh for point %d : (%g, %g, %g) in %g " "epsilon radius in the mesh '%s'. Expected to find exactly one " - "node.", + "node.\n%s", ids.size(), p.getID(), p[0], p[1], p[2], epsilon_radius, - _mesh.getName().c_str()); + _mesh.getName().c_str(), ss.str().c_str()); } node_ids.push_back(ids.front()); }