From: Wolfgang Bangerth Date: Fri, 30 Aug 2013 02:35:13 +0000 (+0000) Subject: Make a lot of things simpler now that we no longer use DoFObjects in hp::DoFLevels... X-Git-Tag: v8.1.0~929 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c6e9a06bba7a50bb95be178fed90376a1b91b23;p=dealii.git Make a lot of things simpler now that we no longer use DoFObjects in hp::DoFLevels. Documentation coming next. git-svn-id: https://svn.dealii.org/trunk@30531 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index 486db2a4f5..402b71dbf2 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -820,20 +820,20 @@ namespace internal const dealii::internal::int2type<1> &) { return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, - fe_index, - obj_level); + fe_index); } template static unsigned int - n_active_fe_indices (const dealii::hp::DoFHandler<1,spacedim> &dof_handler, + n_active_fe_indices (const dealii::hp::DoFHandler<1,spacedim> &, const unsigned int obj_level, const unsigned int obj_index, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index); + // on a cell, the number of active elements is one + return 1; } @@ -847,9 +847,8 @@ namespace internal const unsigned int n, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level, - obj_index, - n); + Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); + return dof_handler.levels[obj_level]->active_fe_index (obj_index); } @@ -909,20 +908,20 @@ namespace internal const dealii::internal::int2type<2> &) { return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, - fe_index, - obj_level); + fe_index); } template static unsigned int - n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &dof_handler, + n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &, const unsigned int obj_level, const unsigned int obj_index, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index); + // on a cell, the number of active elements is one + return 1; } @@ -936,9 +935,8 @@ namespace internal const unsigned int n, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level, - obj_index, - n); + Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); + return dof_handler.levels[obj_level]->active_fe_index (obj_index); } @@ -1015,8 +1013,7 @@ namespace internal const dealii::internal::int2type<3> &) { return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, - fe_index, - obj_level); + fe_index); } @@ -1054,12 +1051,13 @@ namespace internal template static unsigned int - n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler, + n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &, const unsigned int obj_level, const unsigned int obj_index, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index); + // on a cell, the number of active elements is one + return 1; } @@ -1073,9 +1071,8 @@ namespace internal const unsigned int n, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level, - obj_index, - n); + Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); + return dof_handler.levels[obj_level]->active_fe_index (obj_index); } /** diff --git a/deal.II/include/deal.II/hp/dof_levels.h b/deal.II/include/deal.II/hp/dof_levels.h index 5d3fe4df65..7bd350cdf6 100644 --- a/deal.II/include/deal.II/hp/dof_levels.h +++ b/deal.II/include/deal.II/hp/dof_levels.h @@ -199,41 +199,13 @@ namespace internal const unsigned int local_index, const unsigned int obj_level) const; - /** - * Return the number of - * finite elements that are - * active on a given - * object. If this is a cell, - * the answer is of course - * one. If it is a face, the - * answer may be one or two, - * depending on whether the - * two adjacent cells use the - * same finite element or - * not. If it is an edge in - * 3d, the possible return - * value may be one or any - * other value larger than - * that. - * - * If the object is not part - * of an active cell, then no - * degrees of freedom have - * been distributed and zero - * is returned. - */ - unsigned int - n_active_fe_indices (const unsigned int obj_index) const; - /** * Return the fe_index of the * n-th active finite element * on this object. */ - types::global_dof_index - nth_active_fe_index (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int n) const; + unsigned int + active_fe_index (const unsigned int obj_index) const; /** * Check whether a given @@ -243,8 +215,7 @@ namespace internal */ bool fe_index_is_active (const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int obj_level) const; + const unsigned int fe_index) const; /** * Determine an estimate for the @@ -316,31 +287,7 @@ namespace internal inline unsigned int DoFLevel:: - n_active_fe_indices (const unsigned int obj_index) const - { - Assert (obj_index < dof_offsets.size(), - ExcIndexRange (obj_index, 0, dof_offsets.size())); - - // make sure we are on an - // object for which DoFs have - // been allocated at all - if (dof_offsets[obj_index] == numbers::invalid_dof_index) - 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; - } - - - - template - inline - types::global_dof_index - DoFLevel:: - nth_active_fe_index (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int n) const + active_fe_index (const unsigned int obj_index) const { Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -353,9 +300,6 @@ namespace internal "information for an object on which no such " "information is available")); - // 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]; } @@ -366,8 +310,7 @@ namespace internal bool DoFLevel:: fe_index_is_active (const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int obj_level) const + const unsigned int fe_index) const { Assert ((fe_index != dealii::hp::DoFHandler<1,1>::default_fe_index), ExcMessage ("You need to specify a FE index when working "