From a637ce0062120507b10620e9ef7bd9142e8c5fce Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Thu, 11 Aug 2022 12:49:27 +0200
Subject: [PATCH] [A/IO/Gmsh] Error msg for point that isn't part of a
 polyline.

---
 Applications/FileIO/Gmsh/GMSHInterface.cpp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Applications/FileIO/Gmsh/GMSHInterface.cpp b/Applications/FileIO/Gmsh/GMSHInterface.cpp
index 7fa5a19c370..97740c90fee 100644
--- a/Applications/FileIO/Gmsh/GMSHInterface.cpp
+++ b/Applications/FileIO/Gmsh/GMSHInterface.cpp
@@ -268,6 +268,27 @@ int GMSHInterface::writeGMSHInputFile(std::ostream& out)
         polygon_tree->createGMSHPoints(_gmsh_pnts);
     }
 
+    std::stringstream error_messages;
+    error_messages.precision(std::numeric_limits<double>::digits10);
+    for (std::size_t k = 0; k < _gmsh_pnts.size(); ++k)
+    {
+        if (_gmsh_pnts[k] == nullptr)
+        {
+            error_messages
+                << "The point at (" << *(*merged_pnts)[k]
+                << ") is not part of a polyline, and won't be used in the "
+                   "meshing as a constraint. If you want to include it in the "
+                   "mesh please create a observation/measurement station for "
+                   "the point and include it additional in the meshing "
+                   "process.\n";
+        }
+    }
+    auto const error_message = error_messages.str();
+    if (!error_message.empty())
+    {
+        OGS_FATAL("{}", error_message);
+    }
+
     // *** finally write data :-)
     GeoLib::rotatePoints(_inverse_rot_mat, _gmsh_pnts);
     out << _gmsh_pnts;
-- 
GitLab