]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve an error message. 3584/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 15 Nov 2016 00:30:51 +0000 (17:30 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 15 Nov 2016 01:47:57 +0000 (18:47 -0700)
include/deal.II/hp/dof_level.h

index 13d8be88f15a8b3319bdb71e9a627aabde40f2d3..8c6316f7a3df1a7396dbc064acb0e3ed0864f8a3 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2003 - 2015 by the deal.II authors
+// Copyright (C) 2003 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -391,12 +391,16 @@ namespace internal
                                     const unsigned int dofs_per_cell) const
     {
       (void)dofs_per_cell;
-      Assert (obj_index < cell_cache_offsets.size(),
-              ExcInternalError());
-      Assert (cell_cache_offsets[obj_index]+dofs_per_cell
-              <=
-              cell_dof_indices_cache.size(),
-              ExcInternalError());
+      Assert ((obj_index < cell_cache_offsets.size())
+              &&
+              (cell_cache_offsets[obj_index]+dofs_per_cell
+               <=
+               cell_dof_indices_cache.size()),
+              ExcMessage("You are trying to access an element of the cache that stores "
+                         "the indices of all degrees of freedom that live on one cell. "
+                         "However, this element does not exist. Did you forget to call "
+                         "DoFHandler::distribute_dofs(), or did you forget to call it "
+                         "again after changing the active_fe_index of one of the cells?"));
 
       return &cell_dof_indices_cache[cell_cache_offsets[obj_index]];
     }

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.