From: Wolfgang Bangerth Date: Sat, 26 Jul 2014 10:48:05 +0000 (-0500) Subject: Improve error message. X-Git-Tag: v8.2.0-rc1~247^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f90503cfa0e7c0f98e31ab8903382ad34fabc006;p=dealii.git Improve error message. This is in response to an email on the mailing list that showed an error message that wasn't particularly helpful. --- 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