From 6feeac046f43dc4822ea61e7faefd29633210937 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 30 Aug 2013 12:29:55 +0000 Subject: [PATCH] Since these functions are now no longer used for cells, we can significantly simplify them. git-svn-id: https://svn.dealii.org/trunk@30535 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/hp/dof_objects.h | 328 ++++++++--------------- 1 file changed, 117 insertions(+), 211 deletions(-) diff --git a/deal.II/include/deal.II/hp/dof_objects.h b/deal.II/include/deal.II/hp/dof_objects.h index 15bae95dad..1a035b80bf 100644 --- a/deal.II/include/deal.II/hp/dof_objects.h +++ b/deal.II/include/deal.II/hp/dof_objects.h @@ -244,7 +244,7 @@ namespace internal }; -// --------------------- inline and template functions ------------------ + // --------------------- inline and template functions ------------------ template template @@ -283,47 +283,26 @@ 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 - { - // we are in higher space - // dimensions, so there may - // be multiple finite - // elements associated with - // this object. hop along - // the list of index sets - // until we find the one - // with the correct - // fe_index, and then poke - // into that part. trigger - // an exception if we can't - // find a set for this - // particular fe_index - const types::global_dof_index starting_offset = dof_offsets[obj_index]; - const types::global_dof_index *pointer = &dofs[starting_offset]; - while (true) - { - Assert (*pointer != numbers::invalid_dof_index, - ExcInternalError()); - if (*pointer == fe_index) - return *(pointer + 1 + local_index); - else - pointer += static_cast( - dof_handler.get_fe()[*pointer] - .template n_dofs_per_object() + 1); - } - } + Assert (dim( + dof_handler.get_fe()[*pointer] + .template n_dofs_per_object() + 1); + } } @@ -366,49 +345,28 @@ 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 - { - // we are in higher space - // dimensions, so there may - // be multiple finite - // elements associated with - // this object. hop along - // the list of index sets - // until we find the one - // with the correct - // fe_index, and then poke - // into that part. trigger - // an exception if we can't - // find a set for this - // particular fe_index - const types::global_dof_index starting_offset = dof_offsets[obj_index]; - types::global_dof_index *pointer = &dofs[starting_offset]; - while (true) - { - Assert (*pointer != numbers::invalid_dof_index, - ExcInternalError()); - if (*pointer == fe_index) - { - *(pointer + 1 + local_index) = global_index; - return; - } - else - pointer += dof_handler.get_fe()[*pointer] - .template n_dofs_per_object() + 1; - } - } + Assert (dim() + 1; + } } @@ -436,42 +394,28 @@ 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 - { - // otherwise, there may be - // multiple finite elements - // associated with this - // object. hop along the - // list of index sets until - // we find the one with the - // correct fe_index, and - // then poke into that - // part. trigger an - // exception if we can't - // find a set for this - // particular fe_index - const unsigned int starting_offset = dof_offsets[obj_index]; - const types::global_dof_index *pointer = &dofs[starting_offset]; - unsigned int counter = 0; - while (true) - { - if (*pointer == numbers::invalid_dof_index) - // end of list reached - return counter; - else - { - ++counter; - pointer += dof_handler.get_fe()[*pointer] - .template n_dofs_per_object() + 1; - } - } - } + Assert (dim() + 1; + } + } } @@ -503,55 +447,37 @@ 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 (n < n_active_fe_indices(dof_handler, obj_index), - ExcIndexRange (n, 0, - n_active_fe_indices(dof_handler, obj_index))); - - // we are in higher space - // dimensions, so there may - // be multiple finite - // elements associated with - // this object. hop along - // the list of index sets - // until we find the one - // with the correct - // fe_index, and then poke - // into that part. trigger - // an exception if we can't - // find a set for this - // particular fe_index - const unsigned int starting_offset = dof_offsets[obj_index]; - const types::global_dof_index *pointer = &dofs[starting_offset]; - unsigned int counter = 0; - while (true) - { - Assert (*pointer != numbers::invalid_dof_index, - ExcInternalError()); - - const unsigned int fe_index = *pointer; - - Assert (fe_index < dof_handler.get_fe().size(), - ExcInternalError()); - - if (counter == n) - return fe_index; - - ++counter; - pointer += dof_handler.get_fe()[fe_index] - .template n_dofs_per_object() + 1; - } - } + Assert (dim() + 1; + } } @@ -587,47 +513,27 @@ 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 - { - // we are in higher space - // dimensions, so there may - // be multiple finite - // elements associated with - // this object. hop along - // the list of index sets - // until we find the one - // with the correct - // fe_index, and then poke - // into that part. trigger - // an exception if we can't - // find a set for this - // particular fe_index - const types::global_dof_index starting_offset = dof_offsets[obj_index]; - const types::global_dof_index *pointer = &dofs[starting_offset]; - while (true) - { - if (*pointer == numbers::invalid_dof_index) - // end of list reached - return false; - else if (*pointer == fe_index) - return true; - else - pointer += static_cast( - dof_handler.get_fe()[*pointer] - .template n_dofs_per_object()+1); - } - } + Assert (dim( + dof_handler.get_fe()[*pointer] + .template n_dofs_per_object()+1); + } } } -- 2.39.5