]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve an error message by duplicating text from the input file. 3070/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 6 Sep 2016 00:01:05 +0000 (18:01 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 6 Sep 2016 11:43:13 +0000 (05:43 -0600)
This is motivated by a question on the mailing list. We only printed the internal
number of the cell, edge, or point, but should really be printing the number that
is used in the input file.

include/deal.II/grid/grid_in.h
source/grid/grid_in.cc

index b781c1e177e68dbec1c210b3fe2ae4c159b66d68..cc39692d72a2ff202b09455565ce790576932cd3 100644 (file)
@@ -510,6 +510,15 @@ public:
   /**
    * Exception
    */
+  DeclException3 (ExcInvalidVertexIndexGmsh,
+                  int, int, int,
+                  << "While creating cell " << arg1
+                  << " (which is numbered as " << arg2
+                  << " in the input file), you are referencing a vertex with index " << arg3
+                  << " but no vertex with this index has been described in the input file.");
+  /**
+   * Exception
+   */
   DeclException0 (ExcInvalidDBMeshFormat);
   /**
    * Exception
index 61ac3ae2b8a338544de6e6eefd2938ed5e1cb1e7..97de9881ddb36cba0cf784f5c128761ca9633d60 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 1999 - 2015 by the deal.II authors
+// Copyright (C) 1999 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -1348,7 +1348,8 @@ void GridIn<dim, spacedim>::read_msh (std::istream &in)
         material id.
       */
 
-      in >> dummy          // ELM-NUMBER
+      unsigned int elm_number;
+      in >> elm_number     // ELM-NUMBER
          >> cell_type;     // ELM-TYPE
 
       switch (gmsh_file_format)
@@ -1430,7 +1431,8 @@ void GridIn<dim, spacedim>::read_msh (std::istream &in)
             {
               AssertThrow (vertex_indices.find (cells.back().vertices[i]) !=
                            vertex_indices.end(),
-                           ExcInvalidVertexIndex(cell, cells.back().vertices[i]));
+                           ExcInvalidVertexIndexGmsh(cell, elm_number,
+                                                     cells.back().vertices[i]));
 
               // vertex with this index exists
               cells.back().vertices[i] = vertex_indices[cells.back().vertices[i]];

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.