]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a bunch of safety checks.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 4 May 2006 03:57:22 +0000 (03:57 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 4 May 2006 03:57:22 +0000 (03:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@13042 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/hp_dof_levels.cc

index cdd8d96b75fc9b237331c8970db8aa33550dfe9d..949e3ef9df5076257b36569389597f7792441d04 100644 (file)
@@ -41,6 +41,8 @@ namespace internal
       Assert (&dof_handler.get_fe() != 0,
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
       Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_line,
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_line));
@@ -116,6 +118,8 @@ namespace internal
       Assert (&dof_handler.get_fe() != 0,
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
       Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_line,
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_line));
@@ -259,6 +263,8 @@ namespace internal
       Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
               ExcMessage ("You need to specify a FE index when working "
                           "with hp DoFHandlers"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
 
                                        // make sure we are on an
                                        // object for which DoFs have
@@ -329,6 +335,8 @@ namespace internal
       Assert (&dof_handler.get_fe() != 0,
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
       Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_quad,
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_quad));
@@ -405,6 +413,8 @@ namespace internal
       Assert (&dof_handler.get_fe() != 0,
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
       Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_quad,
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_quad));
@@ -548,6 +558,8 @@ namespace internal
       Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
               ExcMessage ("You need to specify a FE index when working "
                           "with hp DoFHandlers"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
 
                                        // make sure we are on an
                                        // object for which DoFs have
@@ -618,6 +630,8 @@ namespace internal
       Assert (&dof_handler.get_fe() != 0,
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
       Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_hex,
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_hex));
@@ -694,6 +708,8 @@ namespace internal
       Assert (&dof_handler.get_fe() != 0,
               ExcMessage ("No finite element collection is associated with "
                           "this DoFHandler"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
       Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_hex,
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_hex));
@@ -837,6 +853,8 @@ namespace internal
       Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
               ExcMessage ("You need to specify a FE index when working "
                           "with hp DoFHandlers"));
+      Assert (fe_index < dof_handler.get_fe().size(),
+              ExcIndexRange (fe_index, 0, dof_handler.get_fe().size()));
 
                                        // make sure we are on an
                                        // object for which DoFs have

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.