From f90503cfa0e7c0f98e31ab8903382ad34fabc006 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 26 Jul 2014 05:48:05 -0500 Subject: [PATCH] Improve error message. This is in response to an email on the mailing list that showed an error message that wasn't particularly helpful. --- include/deal.II/grid/grid_in.h | 5 +++-- source/grid/grid_in.cc | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/deal.II/grid/grid_in.h b/include/deal.II/grid/grid_in.h index 2562f2870e..6798155dc5 100644 --- a/include/deal.II/grid/grid_in.h +++ b/include/deal.II/grid/grid_in.h @@ -510,8 +510,9 @@ public: */ DeclException2 (ExcInvalidVertexIndex, int, int, - << "Trying to access invalid vertex index " << arg2 - << " while creating cell " << arg1); + << "While creating cell " << arg1 + << ", you are referencing a vertex with index " << arg2 + << " but no vertex with this index has been described in the input file."); /** * Exception */ diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index 024a708b2e..a7b9f7fb98 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -659,9 +659,11 @@ void GridIn::read_ucd (std::istream &in) else { // no such vertex index - AssertThrow (false, ExcInvalidVertexIndex(cell, cells.back().vertices[i])); + AssertThrow (false, + ExcInvalidVertexIndex(cell, cells.back().vertices[i])); + cells.back().vertices[i] = numbers::invalid_unsigned_int; - }; + } } else if ((cell_type == "line") && ((dim == 2) || (dim == 3))) // boundary info -- 2.39.5