Skip to content
Snippets Groups Projects
Commit cbb7f90d authored by Tom Fischer's avatar Tom Fischer
Browse files

[MGTL] Improve error msg. in MeshNodeSearcher.

parent 26d00075
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "MeshNodeSearcher.h" #include "MeshNodeSearcher.h"
#include <typeinfo> #include <typeinfo>
#include <sstream>
#include "HeuristicSearchLength.h" #include "HeuristicSearchLength.h"
#include "MeshNodesAlongPolyline.h" #include "MeshNodesAlongPolyline.h"
...@@ -109,12 +110,21 @@ std::vector<std::size_t> MeshNodeSearcher::getMeshNodeIDs( ...@@ -109,12 +110,21 @@ std::vector<std::size_t> MeshNodeSearcher::getMeshNodeIDs(
} }
if (ids.size() != 1) 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( OGS_FATAL(
"Found %d nodes in the mesh for point %d : (%g, %g, %g) in %g " "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 " "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, 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()); node_ids.push_back(ids.front());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment