From: bangerth Date: Fri, 30 Aug 2013 01:34:29 +0000 (+0000) Subject: Simplify a whole bunch of functions. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f8794e06980d8822e6233323eb88005cf3a68c8;p=dealii-svn.git Simplify a whole bunch of functions. git-svn-id: https://svn.dealii.org/trunk@30529 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 3f1bedb386..486db2a4f5 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -477,8 +477,7 @@ namespace internal const dealii::internal::int2type<1> &) { return dof_handler.levels[obj_level]-> - get_dof_index (dof_handler, - obj_index, + get_dof_index (obj_index, fe_index, local_index, obj_level); @@ -497,8 +496,7 @@ namespace internal const types::global_dof_index global_index) { dof_handler.levels[obj_level]-> - set_dof_index (dof_handler, - obj_index, + set_dof_index (obj_index, fe_index, local_index, global_index, @@ -518,7 +516,7 @@ namespace internal { return dof_handler.faces->lines. get_dof_index (dof_handler, - obj_index, + obj_index, fe_index, local_index, obj_level); @@ -557,8 +555,7 @@ namespace internal const dealii::internal::int2type<2> &) { return dof_handler.levels[obj_level]-> - get_dof_index (dof_handler, - obj_index, + get_dof_index (obj_index, fe_index, local_index, obj_level); @@ -577,8 +574,7 @@ namespace internal const types::global_dof_index global_index) { dof_handler.levels[obj_level]-> - set_dof_index (dof_handler, - obj_index, + set_dof_index (obj_index, fe_index, local_index, global_index, @@ -677,8 +673,7 @@ namespace internal const dealii::internal::int2type<3> &) { return dof_handler.levels[obj_level]-> - get_dof_index (dof_handler, - obj_index, + get_dof_index (obj_index, fe_index, local_index, obj_level); @@ -697,8 +692,7 @@ namespace internal const types::global_dof_index global_index) { dof_handler.levels[obj_level]-> - set_dof_index (dof_handler, - obj_index, + set_dof_index (obj_index, fe_index, local_index, global_index, @@ -825,8 +819,7 @@ namespace internal const unsigned int fe_index, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->fe_index_is_active(dof_handler, - obj_index, + return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, fe_index, obj_level); } @@ -840,8 +833,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->n_active_fe_indices (dof_handler, - obj_index); + return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index); } @@ -855,8 +847,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->nth_active_fe_index (dof_handler, - obj_level, + return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level, obj_index, n); } @@ -917,8 +908,7 @@ namespace internal const unsigned int fe_index, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->fe_index_is_active(dof_handler, - obj_index, + return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, fe_index, obj_level); } @@ -932,8 +922,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->n_active_fe_indices (dof_handler, - obj_index); + return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index); } @@ -947,8 +936,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->nth_active_fe_index (dof_handler, - obj_level, + return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level, obj_index, n); } @@ -1026,8 +1014,7 @@ namespace internal const unsigned int fe_index, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->fe_index_is_active(dof_handler, - obj_index, + return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, fe_index, obj_level); } @@ -1072,8 +1059,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->n_active_fe_indices (dof_handler, - obj_index); + return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index); } @@ -1087,8 +1073,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->nth_active_fe_index (dof_handler, - obj_level, + return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level, obj_index, n); } diff --git a/deal.II/include/deal.II/hp/dof_levels.h b/deal.II/include/deal.II/hp/dof_levels.h index ea7b17fa88..5d3fe4df65 100644 --- a/deal.II/include/deal.II/hp/dof_levels.h +++ b/deal.II/include/deal.II/hp/dof_levels.h @@ -163,10 +163,8 @@ namespace internal * class template for more * information. */ - template void - set_dof_index (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index, + set_dof_index (const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, @@ -195,10 +193,8 @@ namespace internal * class template for more * information. */ - template types::global_dof_index - get_dof_index (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index, + get_dof_index (const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int obj_level) const; @@ -226,20 +222,16 @@ namespace internal * been distributed and zero * is returned. */ - template unsigned int - n_active_fe_indices (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index) const; + n_active_fe_indices (const unsigned int obj_index) const; /** * Return the fe_index of the * n-th active finite element * on this object. */ - template types::global_dof_index - nth_active_fe_index (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_level, + nth_active_fe_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int n) const; @@ -249,10 +241,8 @@ namespace internal * used on the present * object or not. */ - template bool - fe_index_is_active (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index, + fe_index_is_active (const unsigned int obj_index, const unsigned int fe_index, const unsigned int obj_level) const; @@ -268,31 +258,14 @@ namespace internal // -------------------- template functions -------------------------------- template - template inline types::global_dof_index DoFLevel:: - get_dof_index (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index, + get_dof_index (const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int obj_level) const { - 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 != 0, - ExcMessage ("No DoFHandler is specified for this iterator")); - Assert (&dof_handler.get_fe() != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (fe_index < dof_handler.get_fe().size(), - ExcIndexRange (fe_index, 0, dof_handler.get_fe().size())); - Assert (local_index < - dof_handler.get_fe()[fe_index].template n_dofs_per_object(), - ExcIndexRange(local_index, 0, - dof_handler.get_fe()[fe_index] - .template n_dofs_per_object())); Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -312,32 +285,15 @@ namespace internal template - template inline void DoFLevel:: - set_dof_index (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index, + set_dof_index (const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const unsigned int obj_level) { - 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 != 0, - ExcMessage ("No DoFHandler is specified for this iterator")); - Assert (&dof_handler.get_fe() != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (fe_index < dof_handler.get_fe().size(), - ExcIndexRange (fe_index, 0, dof_handler.get_fe().size())); - Assert (local_index < - dof_handler.get_fe()[fe_index].template n_dofs_per_object(), - ExcIndexRange(local_index, 0, - dof_handler.get_fe()[fe_index] - .template n_dofs_per_object())); Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -357,19 +313,11 @@ namespace internal template - template inline unsigned int DoFLevel:: - n_active_fe_indices (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index) const + n_active_fe_indices (const unsigned int obj_index) const { - Assert (dim <= dimm, ExcInternalError()); - Assert (&dof_handler != 0, - ExcMessage ("No DoFHandler is specified for this iterator")); - Assert (&dof_handler.get_fe() != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -387,21 +335,13 @@ namespace internal template - template inline types::global_dof_index DoFLevel:: - nth_active_fe_index (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_level, + nth_active_fe_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int n) const { - Assert (dim <= dimm, ExcInternalError()); - Assert (&dof_handler != 0, - ExcMessage ("No DoFHandler is specified for this iterator")); - Assert (&dof_handler.get_fe() != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); Assert (obj_index < dof_offsets.size(), ExcIndexRange (obj_index, 0, dof_offsets.size())); @@ -413,9 +353,7 @@ 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 + // 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]; @@ -424,27 +362,16 @@ namespace internal template - template inline bool DoFLevel:: - fe_index_is_active (const dealii::hp::DoFHandler &dof_handler, - const unsigned int obj_index, + fe_index_is_active (const unsigned int obj_index, const unsigned int fe_index, const unsigned int obj_level) const { - Assert (&dof_handler != 0, - ExcMessage ("No DoFHandler is specified for this iterator")); - Assert (&dof_handler.get_fe() != 0, - ExcMessage ("No finite element collection is associated with " - "this DoFHandler")); - Assert (obj_index < dof_offsets.size(), - ExcIndexRange (obj_index, 0, static_cast(dof_offsets.size()))); - Assert ((fe_index != dealii::hp::DoFHandler::default_fe_index), + Assert ((fe_index != dealii::hp::DoFHandler<1,1>::default_fe_index), ExcMessage ("You need to specify a FE index when working " "with hp DoFHandlers")); - Assert (fe_index < dof_handler.get_fe().size(), - ExcIndexRange (fe_index, 0, dof_handler.get_fe().size())); // make sure we are on an // object for which DoFs have