From: Wolfgang Bangerth Date: Fri, 30 Aug 2013 00:50:29 +0000 (+0000) Subject: Simplify a couple of functions. X-Git-Tag: v8.1.0~932 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3675770193f220ce0efcf92d6acdc8c672f84fcd;p=dealii.git Simplify a couple of functions. git-svn-id: https://svn.dealii.org/trunk@30528 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/hp/dof_levels.h b/deal.II/include/deal.II/hp/dof_levels.h index 9ac98d14d2..ea7b17fa88 100644 --- a/deal.II/include/deal.II/hp/dof_levels.h +++ b/deal.II/include/deal.II/hp/dof_levels.h @@ -29,9 +29,6 @@ namespace internal { namespace hp { - template - class DoFLevel; - /** * Store the indices of the degrees of freedom that are located on * objects of dimension @p structdim. @@ -307,23 +304,9 @@ namespace internal "information for an object on which no such " "information is available")); - if (dim == dimm) - { - // if we are on a cell, then - // the only set of indices we - // store is the one for the - // cell, which is unique. then - // fe_index must be - // active_fe_index - Assert (fe_index == dof_handler.levels[obj_level]->active_fe_indices[obj_index], - ExcMessage ("FE index does not match that of the present cell")); - return dofs[dof_offsets[obj_index]+local_index]; - } - else - { - Assert (false, ExcInternalError()); - return 0; - } + Assert (fe_index == active_fe_indices[obj_index], + ExcMessage ("FE index does not match that of the present cell")); + return dofs[dof_offsets[obj_index]+local_index]; } @@ -366,22 +349,9 @@ namespace internal "information for an object on which no such " "information is available")); - if (dim == dimm) - { - // if we are on a cell, then - // the only set of indices we - // store is the one for the - // cell, which is unique. then - // fe_index must be - // active_fe_index - Assert (fe_index == dof_handler.levels[obj_level]->active_fe_indices[obj_index], - ExcMessage ("FE index does not match that of the present cell")); - dofs[dof_offsets[obj_index]+local_index] = global_index; - } - else - { - Assert (false, ExcInternalError()); - } + Assert (fe_index == active_fe_indices[obj_index], + ExcMessage ("FE index does not match that of the present cell")); + dofs[dof_offsets[obj_index]+local_index] = global_index; } @@ -409,17 +379,9 @@ namespace internal if (dof_offsets[obj_index] == numbers::invalid_dof_index) return 0; - // if we are on a cell, then the - // only set of indices we store - // is the one for the cell, - // which is unique - if (dim == dimm) - return 1; - else - { - Assert (false, ExcInternalError()); - return 0; - } + // we are on a cell, so the only set of indices we store is the + // one for the cell, which is unique + return 1; } @@ -451,20 +413,12 @@ namespace internal "information for an object on which no such " "information is available")); - if (dim == dimm) - { - // this is a cell, so there - // is only a single - // fe_index - Assert (n == 0, ExcIndexRange (n, 0, 1)); - - return dof_handler.levels[obj_level]->active_fe_indices[obj_index]; - } - else - { - Assert (false, ExcInternalError()); - return 0; - } + // this is a cell, so there + // is only a single + // fe_index + Assert (n == 0, ExcIndexRange (n, 0, 1)); + + return active_fe_indices[obj_index]; } @@ -500,22 +454,9 @@ namespace internal "information for an object on which no such " "information is available")); - if (dim == dimm) - { - // if we are on a cell, - // then the only set of - // indices we store is the - // one for the cell, which - // is unique - Assert (obj_index < dof_handler.levels[obj_level]->active_fe_indices.size(), - ExcInternalError()); - return (fe_index == dof_handler.levels[obj_level]->active_fe_indices[obj_index]); - } - else - { - Assert (false, ExcInternalError()); - return false; - } + Assert (obj_index < active_fe_indices.size(), + ExcInternalError()); + return (fe_index == active_fe_indices[obj_index]); } } // namespace hp