From: Wolfgang Bangerth Date: Thu, 4 May 2006 02:32:54 +0000 (+0000) Subject: A few more safety checks. X-Git-Tag: v8.0.0~11775 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c0676fbee12cc22f9f410e6b894cc25896dba1f;p=dealii.git A few more safety checks. git-svn-id: https://svn.dealii.org/trunk@13037 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/hp_dof_levels.cc b/deal.II/deal.II/source/dofs/hp_dof_levels.cc index 97f0657ea6..dc04c1b02b 100644 --- a/deal.II/deal.II/source/dofs/hp_dof_levels.cc +++ b/deal.II/deal.II/source/dofs/hp_dof_levels.cc @@ -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,