From bf2e4d5a554095f87c94e4f4d2a16b44ad8c7172 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 6 Jul 2017 15:27:26 -0600 Subject: [PATCH] Unify the implementation of two functions. --- include/deal.II/dofs/dof_renumbering.h | 13 ++----- source/dofs/dof_renumbering.cc | 48 ++++---------------------- source/dofs/dof_renumbering.inst.in | 12 +++---- 3 files changed, 15 insertions(+), 58 deletions(-) diff --git a/include/deal.II/dofs/dof_renumbering.h b/include/deal.II/dofs/dof_renumbering.h index 42635eba43..094cc4e0be 100644 --- a/include/deal.II/dofs/dof_renumbering.h +++ b/include/deal.II/dofs/dof_renumbering.h @@ -614,22 +614,13 @@ namespace DoFRenumbering * For finite elements with only one component, or a single non-primitive * base element, this function is the identity operation. */ - template + template void - component_wise (DoFHandler &dof_handler, + component_wise (DoFHandlerType &dof_handler, const std::vector &target_component = std::vector()); - /** - * Sort the degrees of freedom by component. It does the same thing as the - * above function. - */ - template - void - component_wise (hp::DoFHandler &dof_handler, - const std::vector &target_component = std::vector ()); - /** * Sort the degrees of freedom by component. It does the same thing as the * above function, only that it does this for one single level of a diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index bbaf17d46a..fe2ac84df7 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -496,23 +496,23 @@ namespace DoFRenumbering - template + template void - component_wise (DoFHandler &dof_handler, + component_wise (DoFHandlerType &dof_handler, const std::vector &component_order_arg) { std::vector renumbering (dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index); - typename DoFHandler::active_cell_iterator + typename DoFHandlerType::active_cell_iterator start = dof_handler.begin_active(); - const typename DoFHandler::level_cell_iterator + const typename DoFHandlerType::level_cell_iterator end = dof_handler.end(); const types::global_dof_index result = - compute_component_wise::active_cell_iterator, - typename DoFHandler::level_cell_iterator> + compute_component_wise (renumbering, start, end, component_order_arg, false); if (result == 0) return; @@ -532,40 +532,6 @@ namespace DoFRenumbering ExcRenumberingIncomplete()); dof_handler.renumber_dofs (renumbering); - - // for (unsigned int level=0;level - void - component_wise (hp::DoFHandler &dof_handler, - const std::vector &component_order_arg) - { -//TODO: Merge with previous function - std::vector renumbering (dof_handler.n_dofs(), - numbers::invalid_dof_index); - - typename hp::DoFHandler::active_cell_iterator - start = dof_handler.begin_active(); - const typename hp::DoFHandler::level_cell_iterator - end = dof_handler.end(); - - const types::global_dof_index result = - compute_component_wise::dimension,hp::DoFHandler::space_dimension, - typename hp::DoFHandler::active_cell_iterator, - typename hp::DoFHandler::level_cell_iterator> - (renumbering, start, end, component_order_arg, false); - - if (result == 0) return; - - Assert (result == dof_handler.n_dofs(), - ExcRenumberingIncomplete()); - - dof_handler.renumber_dofs (renumbering); } diff --git a/source/dofs/dof_renumbering.inst.in b/source/dofs/dof_renumbering.inst.in index f3546de3eb..8ba908e2e5 100644 --- a/source/dofs/dof_renumbering.inst.in +++ b/source/dofs/dof_renumbering.inst.in @@ -43,10 +43,15 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS const std::vector&); template - void component_wise + void component_wise > (DoFHandler&, const std::vector&); + template + void component_wise > + (hp::DoFHandler&, + const std::vector&); + template void block_wise (DoFHandler&); @@ -149,11 +154,6 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS const bool, const std::vector&); - template - void component_wise - (hp::DoFHandler&, - const std::vector&); - template void component_wise (DoFHandler&, -- 2.39.5