From acf5b6b056da8e7f5f74f03f62af7bc7e15a0fd7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 12 Nov 2021 21:33:05 -0700 Subject: [PATCH] Improve an error message. --- source/grid/tria.cc | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 1954cab660..57fce4ad70 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -2522,22 +2522,25 @@ namespace internal if (dim >= 2) process_subcelldata(connectivity.entity_to_entities(1, 0), tria.faces->lines, - subcelldata.boundary_lines); + subcelldata.boundary_lines, + vertices); // SubCellData: quad if (dim == 3) process_subcelldata(connectivity.entity_to_entities(2, 0), tria.faces->quads, - subcelldata.boundary_quads); + subcelldata.boundary_quads, + vertices); } - template + template static void process_subcelldata( const CRS & crs, TriaObjects & obj, - const std::vector> &boundary_objects_in) + const std::vector> &boundary_objects_in, + const std::vector> & vertex_locations) { AssertDimension(obj.structdim, structdim); @@ -2605,8 +2608,29 @@ namespace internal if (subcell_object->boundary_id != numbers::internal_face_boundary_id) { - AssertThrow(boundary_id != numbers::internal_face_boundary_id, - ExcNotImplemented()); + (void)vertex_locations; + AssertThrow( + boundary_id != numbers::internal_face_boundary_id, + ExcMessage( + "The input arguments for creating a triangulation " + "specified a boundary id for an internal face. This " + "is not allowed." + "\n\n" + "The object in question has vertex indices " + + [subcell_object]() { + std::string s; + for (const auto v : subcell_object->vertices) + s += std::to_string(v) + ','; + return s; + }() + + " which are located at positions " + + [vertex_locations, subcell_object]() { + std::ostringstream s; + for (const auto v : subcell_object->vertices) + s << '(' << vertex_locations[v] << ')'; + return s.str(); + }() + + ".")); boundary_id = subcell_object->boundary_id; } } -- 2.39.5