]> https://gitweb.dealii.org/ - dealii.git/commitdiff
A few more safety checks.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 4 May 2006 02:32:54 +0000 (02:32 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 4 May 2006 02:32:54 +0000 (02:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@13037 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 97f0657ea64f6dc2dce1a6317e36d63a334a5bb4..dc04c1b02b899ef193f4349d306f8428f61575fe 100644 (file)
@@ -45,6 +45,14 @@ namespace internal
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_line));
 
+                                       // make sure we are on an
+                                       // object for which DoFs have
+                                       // been allocated at all
+      Assert (line_dof_offsets[line_index] != deal_II_numbers::invalid_unsigned_int,
+              ExcMessage ("You are trying to access degree of freedom "
+                          "information for an object on which no such "
+                          "information is available"));
+      
                                        // if we are in 1d, then the
                                        // only set of indices we store
                                        // is the one for the cell,
@@ -110,6 +118,14 @@ namespace internal
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_line));
 
+                                       // make sure we are on an
+                                       // object for which DoFs have
+                                       // been allocated at all
+      Assert (line_dof_offsets[line_index] != deal_II_numbers::invalid_unsigned_int,
+              ExcMessage ("You are trying to access degree of freedom "
+                          "information for an object on which no such "
+                          "information is available"));
+
                                        // if we are in 1d, then the
                                        // only set of indices we store
                                        // is the one for the cell,
@@ -178,6 +194,14 @@ namespace internal
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_quad));
 
+                                       // make sure we are on an
+                                       // object for which DoFs have
+                                       // been allocated at all
+      Assert (quad_dof_offsets[quad_index] != deal_II_numbers::invalid_unsigned_int,
+              ExcMessage ("You are trying to access degree of freedom "
+                          "information for an object on which no such "
+                          "information is available"));
+
                                        // if we are in 1d, then the
                                        // only set of indices we store
                                        // is the one for the cell,
@@ -244,6 +268,14 @@ namespace internal
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_quad));
 
+                                       // make sure we are on an
+                                       // object for which DoFs have
+                                       // been allocated at all
+      Assert (quad_dof_offsets[quad_index] != deal_II_numbers::invalid_unsigned_int,
+              ExcMessage ("You are trying to access degree of freedom "
+                          "information for an object on which no such "
+                          "information is available"));
+
                                        // if we are in 1d, then the
                                        // only set of indices we store
                                        // is the one for the cell,
@@ -312,6 +344,14 @@ namespace internal
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_hex));
 
+                                       // make sure we are on an
+                                       // object for which DoFs have
+                                       // been allocated at all
+      Assert (hex_dof_offsets[hex_index] != deal_II_numbers::invalid_unsigned_int,
+              ExcMessage ("You are trying to access degree of freedom "
+                          "information for an object on which no such "
+                          "information is available"));
+
                                        // if we are in 1d, then the
                                        // only set of indices we store
                                        // is the one for the cell,
@@ -378,6 +418,14 @@ namespace internal
               ExcIndexRange(local_index, 0,
                             dof_handler.get_fe()[fe_index].dofs_per_hex));
 
+                                       // make sure we are on an
+                                       // object for which DoFs have
+                                       // been allocated at all
+      Assert (hex_dof_offsets[hex_index] != deal_II_numbers::invalid_unsigned_int,
+              ExcMessage ("You are trying to access degree of freedom "
+                          "information for an object on which no such "
+                          "information is available"));
+
                                        // if we are in 1d, then the
                                        // only set of indices we store
                                        // is the one for the cell,

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.