From e38559d3a810f21efab1084cfd58bd463460af09 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 10 Dec 2008 17:36:06 +0000 Subject: [PATCH] Also move the functions that deal with vertex dofs to the accessor implementation rather than keeping them in the DoFHandlers. git-svn-id: https://svn.dealii.org/trunk@17907 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/dofs/dof_accessor.templates.h | 406 ++++++++++++++++-- deal.II/deal.II/include/dofs/dof_handler.h | 119 +---- deal.II/deal.II/include/hp/dof_handler.h | 329 +------------- deal.II/deal.II/source/hp/dof_handler.cc | 53 ++- 4 files changed, 418 insertions(+), 489 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index f6d41b6fd6..dd6b945814 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -172,36 +172,6 @@ DoFAccessor::child (const unsigned int i) const -template -inline -unsigned int -DoFAccessor::vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int fe_index) const -{ - return this->dof_handler->get_vertex_dof_index (this->vertex_index(vertex), - fe_index, - i); -} - - - -template -inline -void -DoFAccessor::set_vertex_dof_index (const unsigned int vertex, - const unsigned int i, - const unsigned int index, - const unsigned int fe_index) const -{ - this->dof_handler->set_vertex_dof_index (this->vertex_index(vertex), - fe_index, - i, - index); -} - - - namespace internal { namespace DoFAccessor @@ -1089,6 +1059,344 @@ namespace internal obj_index, n); } + + /** + * Set the @p local_index-th + * degree of freedom + * corresponding to the finite + * element specified by @p + * fe_index on the vertex with + * global number @p + * vertex_index to @p + * global_index. + */ + template + static + void + set_vertex_dof_index (dealii::DoFHandler &dof_handler, + const unsigned int vertex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) + { + Assert ((fe_index == dealii::DoFHandler::default_fe_index), + ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); + Assert (dof_handler.selected_fe != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + Assert (local_index < dof_handler.selected_fe->dofs_per_vertex, + ExcIndexRange(local_index, 0, + dof_handler.selected_fe->dofs_per_vertex)); + + dof_handler.vertex_dofs[vertex_index * + dof_handler.selected_fe->dofs_per_vertex + + local_index] + = global_index; + } + + + template + static + void + set_vertex_dof_index (dealii::hp::DoFHandler &dof_handler, + const unsigned int vertex_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) + { + Assert ( (fe_index != dealii::hp::DoFHandler::default_fe_index), + ExcMessage ("You need to specify a FE index when working " + "with hp DoFHandlers")); + Assert (dof_handler.finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + Assert (local_index < (*dof_handler.finite_elements)[fe_index].dofs_per_vertex, + ExcIndexRange(local_index, 0, + (*dof_handler.finite_elements)[fe_index].dofs_per_vertex)); + Assert (fe_index < dof_handler.finite_elements->size(), + ExcInternalError()); + Assert (dof_handler.vertex_dofs_offsets[vertex_index] != + numbers::invalid_unsigned_int, + ExcMessage ("This vertex is unused and has no DoFs associated with it")); + + // 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_handler.vertex_dofs_offsets[vertex_index]; + unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset]; + while (true) + { + Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError()); + + const unsigned int this_fe_index = *pointer; + + Assert (this_fe_index != numbers::invalid_unsigned_int, + ExcInternalError()); + Assert (this_fe_index < dof_handler.finite_elements->size(), + ExcInternalError()); + + if (this_fe_index == fe_index) + { + *(pointer + 1 + local_index) = global_index; + return; + } + else + pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1; + } + } + + + /** + * Get the @p local_index-th + * degree of freedom + * corresponding to the finite + * element specified by @p + * fe_index on the vertex with + * global number @p + * vertex_index to @p + * global_index. + */ + + template + static + unsigned int + get_vertex_dof_index (const dealii::DoFHandler &dof_handler, + const unsigned int vertex_index, + const unsigned int fe_index, + const unsigned int local_index) + { + Assert ((fe_index == dealii::DoFHandler::default_fe_index), + ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); + Assert (dof_handler.selected_fe != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + Assert (local_index < dof_handler.selected_fe->dofs_per_vertex, + ExcIndexRange(local_index, 0, + dof_handler.selected_fe->dofs_per_vertex)); + + return + dof_handler.vertex_dofs[vertex_index * + dof_handler.selected_fe->dofs_per_vertex + + local_index]; + } + + + template + static + unsigned int + get_vertex_dof_index (const dealii::hp::DoFHandler &dof_handler, + const unsigned int vertex_index, + const unsigned int fe_index, + const unsigned int local_index) + { + Assert ( (fe_index != dealii::hp::DoFHandler::default_fe_index), + ExcMessage ("You need to specify a FE index when working " + "with hp DoFHandlers")); + Assert (dof_handler.finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + Assert (local_index < (*dof_handler.finite_elements)[fe_index].dofs_per_vertex, + ExcIndexRange(local_index, 0, + (*dof_handler.finite_elements)[fe_index].dofs_per_vertex)); + Assert (vertex_index < dof_handler.vertex_dofs_offsets.size(), + ExcIndexRange (vertex_index, 0, + dof_handler.vertex_dofs_offsets.size())); + Assert (dof_handler.vertex_dofs_offsets[vertex_index] != + numbers::invalid_unsigned_int, + ExcMessage ("This vertex is unused and has no DoFs associated with it")); + + // 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_handler.vertex_dofs_offsets[vertex_index]; + const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset]; + while (true) + { + Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError()); + + const unsigned int this_fe_index = *pointer; + + Assert (this_fe_index != numbers::invalid_unsigned_int, + ExcInternalError()); + Assert (this_fe_index < dof_handler.finite_elements->size(), + ExcInternalError()); + + if (this_fe_index == fe_index) + return *(pointer + 1 + local_index); + else + pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1; + } + } + + + /** + * Return the number of + * different finite elements + * that are active on a given + * vertex. + */ + template + static + unsigned int + n_active_vertex_fe_indices (const dealii::hp::DoFHandler &dof_handler, + const unsigned int vertex_index) + { + Assert (dof_handler.finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + + // if this vertex is unused, return 0 + if (dof_handler.vertex_dofs_offsets[vertex_index] == numbers::invalid_unsigned_int) + return 0; + + // hop along the list of index + // sets and count the number of + // hops + const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset]; + + Assert (*pointer != numbers::invalid_unsigned_int, + ExcInternalError()); + + unsigned int counter = 0; + while (true) + { + Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError()); + + const unsigned int this_fe_index = *pointer; + + if (this_fe_index == numbers::invalid_unsigned_int) + return counter; + else + { + pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1; + ++counter; + } + } + } + + + + /** + * Return the fe index of the + * n-th finite element active + * on a given vertex. + */ + template + static + unsigned int + nth_active_vertex_fe_index (const dealii::hp::DoFHandler &dof_handler, + const unsigned int vertex_index, + const unsigned int n) + { + Assert (dof_handler.finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + Assert (n < n_active_vertex_fe_indices(dof_handler, vertex_index), + ExcIndexRange (n, 0, n_active_vertex_fe_indices(dof_handler, + vertex_index))); + // make sure we don't ask on + // unused vertices + Assert (dof_handler.vertex_dofs_offsets[vertex_index] != + numbers::invalid_unsigned_int, + ExcInternalError()); + + // hop along the list of index + // sets and count the number of + // hops + const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset]; + + Assert (*pointer != numbers::invalid_unsigned_int, + ExcInternalError()); + + unsigned int counter = 0; + while (true) + { + Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError()); + + const unsigned int this_fe_index = *pointer; + + Assert (this_fe_index < dof_handler.finite_elements->size(), + ExcInternalError()); + + if (counter == n) + return this_fe_index; + + Assert (this_fe_index != numbers::invalid_unsigned_int, + ExcInternalError()); + + pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1; + ++counter; + } + } + + + + /** + * Return whether a particular + * finite element index is + * active on the specified + * vertex. + */ + template + static + bool + fe_is_active_on_vertex (const dealii::hp::DoFHandler &dof_handler, + const unsigned int vertex_index, + const unsigned int fe_index) + { + Assert ( (fe_index != dealii::hp::DoFHandler::default_fe_index), + ExcMessage ("You need to specify a FE index when working " + "with hp DoFHandlers")); + Assert (dof_handler.finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); + Assert (fe_index < dof_handler.finite_elements->size(), + ExcInternalError()); + + // make sure we don't ask on + // unused vertices + Assert (dof_handler.vertex_dofs_offsets[vertex_index] != + numbers::invalid_unsigned_int, + ExcInternalError()); + + // hop along the list of index + // sets and see whether we find + // the given index + const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset]; + + Assert (*pointer != numbers::invalid_unsigned_int, + ExcInternalError()); + + while (true) + { + Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError()); + + const unsigned int this_fe_index = *pointer; + + Assert (this_fe_index < dof_handler.finite_elements->size(), + ExcInternalError()); + + if (this_fe_index == numbers::invalid_unsigned_int) + return false; + else + if (this_fe_index == fe_index) + return true; + else + pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1; + } + } + }; } } @@ -1181,6 +1489,44 @@ DoFAccessor::fe_index_is_active (const unsigned int fe_index) const +template +inline +unsigned int +DoFAccessor::vertex_dof_index (const unsigned int vertex, + const unsigned int i, + const unsigned int fe_index) const +{ + return + internal::DoFAccessor::Implementation::get_vertex_dof_index + (*this->dof_handler, + this->vertex_index(vertex), + fe_index, + i); +} + + + +template +inline +void +DoFAccessor::set_vertex_dof_index (const unsigned int vertex, + const unsigned int i, + const unsigned int index, + const unsigned int fe_index) const +{ + internal::DoFAccessor::Implementation::set_vertex_dof_index + (*this->dof_handler, + this->vertex_index(vertex), + fe_index, + i, + index); +} + + + + + + namespace internal { namespace DoFAccessor diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index f3c0eb0faa..20fe30e31d 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -1049,77 +1049,6 @@ class DoFHandler : public Subscriptor * Free all used memory. */ void clear_space (); - - /** - * Set the @p local_index-th - * degree of freedom - * corresponding to the finite - * element specified by @p - * fe_index on the vertex with - * global number @p - * vertex_index to @p - * global_index. - * - * This function is needed by - * DoFAccessor::set_vertex_dof_index - * when distributing degrees of - * freedom on a mesh. - * - * Since here we are dealing - * with a non-hp finite element - * DoF handler, the only - * reasonable choice for - * fe_index is - * default_fe_index. All other - * values will be ignored. The - * parameter to this function - * exists nevertheless to make - * sure that the accessor - * classes can be templatized - * on the type of the DoF - * handler. - */ - void - set_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - /** - * Get the @p local_index-th - * degree of freedom - * corresponding to the finite - * element specified by @p - * fe_index on the vertex with - * global number @p - * vertex_index to @p - * global_index. - * - * This function is needed by - * DoFAccessor::vertex_dof_index, - * which in turn is called for - * example when doing things - * like - * cell-@>get_dof_indices(). - * - * Since here we are dealing - * with a non-hp finite element - * DoF handler, the only - * reasonable choice for - * fe_index is - * default_fe_index. All other - * values will be ignored. The - * parameter to this function - * exists nevertheless to make - * sure that the accessor - * classes can be templatized - * on the type of the DoF - * handler. - */ - unsigned int - get_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index) const; /** * Space to store the DoF numbers @@ -1128,7 +1057,7 @@ class DoFHandler : public Subscriptor * levels[] tree of the * Triangulation objects. */ - std::vector*> levels; + std::vector*> levels; /** * Space to store DoF numbers of @@ -1138,7 +1067,7 @@ class DoFHandler : public Subscriptor * hierarchically, but in a flat * array. */ - internal::DoFHandler::DoFFaces * faces; + internal::DoFHandler::DoFFaces *faces; /** * Store the number of dofs @@ -1209,50 +1138,6 @@ DoFHandler::get_tria () const -template -inline -unsigned int -DoFHandler:: -get_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index) const -{ - Assert ((fe_index == DoFHandler::default_fe_index), - ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert (selected_fe != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (local_index < selected_fe->dofs_per_vertex, - ExcIndexRange(local_index, 0, - selected_fe->dofs_per_vertex)); - - return vertex_dofs[vertex_index * selected_fe->dofs_per_vertex + local_index]; -} - - - -template -inline -void -DoFHandler:: -set_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) -{ - Assert ((fe_index == DoFHandler::default_fe_index), - ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); - Assert (selected_fe != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (local_index < selected_fe->dofs_per_vertex, - ExcIndexRange(local_index, 0, - selected_fe->dofs_per_vertex)); - - vertex_dofs[vertex_index * selected_fe->dofs_per_vertex + local_index] = global_index; -} - - #endif // DOXYGEN diff --git a/deal.II/deal.II/include/hp/dof_handler.h b/deal.II/deal.II/include/hp/dof_handler.h index 593282ed3d..7636d27379 100644 --- a/deal.II/deal.II/include/hp/dof_handler.h +++ b/deal.II/deal.II/include/hp/dof_handler.h @@ -998,77 +998,6 @@ namespace hp virtual void pre_refinement_notification (const Triangulation &tria); virtual void post_refinement_notification (const Triangulation &tria); - /** - * Set the @p local_index-th - * degree of freedom - * corresponding to the finite - * element specified by @p - * fe_index on the vertex with - * global number @p - * vertex_index to @p - * global_index. - * - * This function is needed by - * DoFAccessor::set_vertex_dof_index - * when distributing degrees of - * freedom on a mesh. - */ - void - set_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index); - - /** - * Get the @p local_index-th - * degree of freedom - * corresponding to the finite - * element specified by @p - * fe_index on the vertex with - * global number @p - * vertex_index to @p - * global_index. - * - * This function is needed by - * DoFAccessor::vertex_dof_index, - * which in turn is called for - * example when doing things - * like - * cell-@>get_dof_indices(). - */ - unsigned int - get_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index) const; - - /** - * Return the number of - * different finite elements - * that are active on a given - * vertex. - */ - unsigned int - n_active_vertex_fe_indices (const unsigned int vertex_index) const; - - /** - * Return the fe index of the - * n-th finite element active - * on a given vertex. - */ - unsigned int - nth_active_vertex_fe_index (const unsigned int vertex_index, - const unsigned int n) const; - - /** - * Return whether a particular - * finite element index is - * active on the specified - * vertex. - */ - bool - fe_is_active_on_vertex (const unsigned int vertex_index, - const unsigned int fe_index) const; - /** * Compute identities between * DoFs located on @@ -1174,8 +1103,8 @@ namespace hp * * Access to this field is * generally through the - * get_vertex_dof_index() and - * set_vertex_dof_index() + * DoFAccessor::get_vertex_dof_index() and + * DoFAccessor::set_vertex_dof_index() * functions, encapsulating the * actual data format used to * the present class. @@ -1197,8 +1126,8 @@ namespace hp * * Access to this field is * generally through the - * get_vertex_dof_index() and - * set_vertex_dof_index() + * Accessor::get_vertex_dof_index() and + * Accessor::set_vertex_dof_index() * functions, encapsulating the * actual data format used to * the present class. @@ -1285,256 +1214,6 @@ namespace hp - template - inline - unsigned int - DoFHandler:: - get_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index) const - { - Assert ( (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage ("You need to specify a FE index when working " - "with hp DoFHandlers")); - Assert (finite_elements != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (local_index < (*finite_elements)[fe_index].dofs_per_vertex, - ExcIndexRange(local_index, 0, - (*finite_elements)[fe_index].dofs_per_vertex)); - Assert (vertex_index < vertex_dofs_offsets.size(), - ExcIndexRange (vertex_index, 0, vertex_dofs_offsets.size())); - Assert (vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, - ExcMessage ("This vertex is unused and has no DoFs associated with it")); - - // 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 = vertex_dofs_offsets[vertex_index]; - const unsigned int *pointer = &vertex_dofs[starting_offset]; - while (true) - { - Assert (pointer <= &vertex_dofs.back(), ExcInternalError()); - - const unsigned int this_fe_index = *pointer; - - Assert (this_fe_index != numbers::invalid_unsigned_int, - ExcInternalError()); - Assert (this_fe_index < finite_elements->size(), - ExcInternalError()); - - if (this_fe_index == fe_index) - return *(pointer + 1 + local_index); - else - pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1; - } - } - - - - template - inline - void - DoFHandler:: - set_vertex_dof_index (const unsigned int vertex_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) - { - Assert ( (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage ("You need to specify a FE index when working " - "with hp DoFHandlers")); - Assert (finite_elements != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (local_index < (*finite_elements)[fe_index].dofs_per_vertex, - ExcIndexRange(local_index, 0, - (*finite_elements)[fe_index].dofs_per_vertex)); - Assert (fe_index < finite_elements->size(), - ExcInternalError()); - Assert (vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, - ExcMessage ("This vertex is unused and has no DoFs associated with it")); - - // 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 = vertex_dofs_offsets[vertex_index]; - unsigned int *pointer = &vertex_dofs[starting_offset]; - while (true) - { - Assert (pointer <= &vertex_dofs.back(), ExcInternalError()); - - const unsigned int this_fe_index = *pointer; - - Assert (this_fe_index != numbers::invalid_unsigned_int, - ExcInternalError()); - Assert (this_fe_index < finite_elements->size(), - ExcInternalError()); - - if (this_fe_index == fe_index) - { - *(pointer + 1 + local_index) = global_index; - return; - } - else - pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1; - } - } - - - - template - inline - unsigned int - DoFHandler:: - n_active_vertex_fe_indices (const unsigned int vertex_index) const - { - Assert (finite_elements != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - - // if this vertex is unused, return 0 - if (vertex_dofs_offsets[vertex_index] == numbers::invalid_unsigned_int) - return 0; - - // hop along the list of index - // sets and count the number of - // hops - const unsigned int starting_offset = vertex_dofs_offsets[vertex_index]; - const unsigned int *pointer = &vertex_dofs[starting_offset]; - - Assert (*pointer != numbers::invalid_unsigned_int, - ExcInternalError()); - - unsigned int counter = 0; - while (true) - { - Assert (pointer <= &vertex_dofs.back(), ExcInternalError()); - - const unsigned int this_fe_index = *pointer; - - if (this_fe_index == numbers::invalid_unsigned_int) - return counter; - else - { - pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1; - ++counter; - } - } - } - - - - template - inline - unsigned int - DoFHandler:: - nth_active_vertex_fe_index (const unsigned int vertex_index, - const unsigned int n) const - { - Assert (finite_elements != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (n < n_active_vertex_fe_indices(vertex_index), - ExcIndexRange (n, 0, n_active_vertex_fe_indices(vertex_index))); - // make sure we don't ask on - // unused vertices - Assert (vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, - ExcInternalError()); - - // hop along the list of index - // sets and count the number of - // hops - const unsigned int starting_offset = vertex_dofs_offsets[vertex_index]; - const unsigned int *pointer = &vertex_dofs[starting_offset]; - - Assert (*pointer != numbers::invalid_unsigned_int, - ExcInternalError()); - - unsigned int counter = 0; - while (true) - { - Assert (pointer <= &vertex_dofs.back(), ExcInternalError()); - - const unsigned int this_fe_index = *pointer; - - Assert (this_fe_index < finite_elements->size(), - ExcInternalError()); - - if (counter == n) - return this_fe_index; - - Assert (this_fe_index != numbers::invalid_unsigned_int, - ExcInternalError()); - - pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1; - ++counter; - } - } - - - - template - inline - bool - DoFHandler:: - fe_is_active_on_vertex (const unsigned int vertex_index, - const unsigned int fe_index) const - { - Assert ( (fe_index != dealii::hp::DoFHandler::default_fe_index), - ExcMessage ("You need to specify a FE index when working " - "with hp DoFHandlers")); - Assert (finite_elements != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (fe_index < finite_elements->size(), - ExcInternalError()); - - // make sure we don't ask on - // unused vertices - Assert (vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, - ExcInternalError()); - - // hop along the list of index - // sets and see whether we find - // the given index - const unsigned int starting_offset = vertex_dofs_offsets[vertex_index]; - const unsigned int *pointer = &vertex_dofs[starting_offset]; - - Assert (*pointer != numbers::invalid_unsigned_int, - ExcInternalError()); - - while (true) - { - Assert (pointer <= &vertex_dofs.back(), ExcInternalError()); - - const unsigned int this_fe_index = *pointer; - - Assert (this_fe_index < finite_elements->size(), - ExcInternalError()); - - if (this_fe_index == numbers::invalid_unsigned_int) - return false; - else - if (this_fe_index == fe_index) - return true; - else - pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1; - } - } - #endif diff --git a/deal.II/deal.II/source/hp/dof_handler.cc b/deal.II/deal.II/source/hp/dof_handler.cc index 6c4e4850a6..3ef24bc51f 100644 --- a/deal.II/deal.II/source/hp/dof_handler.cc +++ b/deal.II/deal.II/source/hp/dof_handler.cc @@ -2959,11 +2959,14 @@ namespace hp ++vertex_index) { const unsigned int n_active_fe_indices - = n_active_vertex_fe_indices (vertex_index); + = internal::DoFAccessor::Implementation:: + n_active_vertex_fe_indices (*this, vertex_index); if (n_active_fe_indices > 1) { const unsigned int - first_fe_index = nth_active_vertex_fe_index (vertex_index, 0); + first_fe_index + = internal::DoFAccessor::Implementation:: + nth_active_vertex_fe_index (*this, vertex_index, 0); // loop over all the // other FEs with which @@ -2973,7 +2976,9 @@ namespace hp for (unsigned int f=1; f