]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an assertion to catch a case Chih-Che Chueh ran into.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 28 Aug 2013 13:06:17 +0000 (13:06 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 28 Aug 2013 13:06:17 +0000 (13:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@30515 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/tria.cc

index dd9046a3900f29f07de794362d474ff3bf61d893..9dc8aa8edfb29d3e7adb9a4e009af07cc971c526 100644 (file)
@@ -11081,7 +11081,8 @@ template <int dim, int spacedim>
 typename Triangulation<dim, spacedim>::active_cell_iterator
 Triangulation<dim, spacedim>::end_active (const unsigned int level) const
 {
-  return (level == levels.size()-1 ?
+  Assert (level<n_global_levels() || level < levels.size(), ExcInvalidLevel(level));
+  return (level >= levels.size()-1 ?
           active_cell_iterator(end()) :
           begin_active (level+1));
 }

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.