From 22daaf90d70ee4a0f937b49d97d4307ee0d33508 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Fri, 12 Aug 2016 13:27:42 +0200
Subject: [PATCH] Substitute debug output with throwing OGS_FATAL.

---
 .../Mesh2MeshPropertyInterpolation.cpp        | 35 +++----------------
 1 file changed, 5 insertions(+), 30 deletions(-)

diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp
index b98a244d99d..949c4319322 100644
--- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp
+++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp
@@ -126,37 +126,12 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(
             }
         }
 
+        if (cnt == 0)
+            OGS_FATAL(
+                "Mesh2MeshInterpolation: Could not find values in source mesh "
+                "for the element %d.",
+                k);
         dest_properties[k] /= cnt;
-
-        if (cnt == 0) {
-            std::string base_name("DebugData/Element-");
-            base_name += std::to_string(k);
-
-            std::string aabb_fname(base_name + "-aabb.gli");
-            std::ofstream out_aabb(aabb_fname.c_str());
-            out_aabb << "#POINTS" << "\n";
-            out_aabb << "0 " << elem_aabb.getMinPoint() << "\n";
-            out_aabb << "1 " << elem_aabb.getMaxPoint() << "\n";
-            out_aabb << "#STOP" << "\n";
-            out_aabb.close();
-
-
-            std::string source_fname(base_name + "-SourceNodes.gli");
-            std::ofstream out_src(source_fname.c_str());
-            out_src << "#POINTS" << "\n";
-            std::size_t nodes_cnt(0);
-            for (auto i_th_vec : nodes) {
-                const std::size_t n_nodes_in_vec(i_th_vec->size());
-                for (std::size_t j(0); j<n_nodes_in_vec; j++) {
-                    MeshLib::Node const*const j_th_node((*i_th_vec)[j]);
-                    out_src << nodes_cnt << " " << *j_th_node << "\n";
-                    nodes_cnt++;
-                }
-            }
-            out_src << "#STOP" << "\n";
-            out_src.close();
-            ERR("no source nodes in dest element %d", k);
-        }
     }
 }
 
-- 
GitLab