From 8e5e2194aa0999d33d38c1330cde62273373208f Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 29 Jun 2020 08:57:55 +0200 Subject: [PATCH] Remove DoFHandlerType from mg_tools.h --- include/deal.II/multigrid/mg_tools.h | 16 +++++------ source/multigrid/mg_tools.cc | 41 +++++++++++++--------------- source/multigrid/mg_tools.inst.in | 27 +++++++++--------- 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/include/deal.II/multigrid/mg_tools.h b/include/deal.II/multigrid/mg_tools.h index 142ea23fbe..d6d821c26a 100644 --- a/include/deal.II/multigrid/mg_tools.h +++ b/include/deal.II/multigrid/mg_tools.h @@ -80,11 +80,11 @@ namespace MGTools * There is no need to consider hanging nodes here, since only one level is * considered. */ - template + template void - make_sparsity_pattern(const DoFHandlerType &dof_handler, - SparsityPatternType & sparsity, - const unsigned int level); + make_sparsity_pattern(const DoFHandler &dof_handler, + SparsityPatternType & sparsity, + const unsigned int level); /** * Make a sparsity pattern including fluxes of discontinuous Galerkin @@ -151,9 +151,9 @@ namespace MGTools * degrees of freedom on a refinement edge to those not on the refinement edge * of a certain level. */ - template + template void - make_interface_sparsity_pattern(const DoFHandlerType & dof_handler, + make_interface_sparsity_pattern(const DoFHandler &dof_handler, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternType & sparsity, const unsigned int level); @@ -165,10 +165,10 @@ namespace MGTools * Result is a vector containing for each level a vector containing the * number of dofs for each block (access is result[level][block]). */ - template + template void count_dofs_per_block( - const DoFHandlerType & dof_handler, + const DoFHandler & dof_handler, std::vector> &dofs_per_block, std::vector target_block = {}); diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index e33c86e778..bcfd0c89b5 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -560,11 +560,11 @@ namespace MGTools - template + template void - make_sparsity_pattern(const DoFHandlerType &dof, - SparsityPatternType & sparsity, - const unsigned int level) + make_sparsity_pattern(const DoFHandler &dof, + SparsityPatternType & sparsity, + const unsigned int level) { const types::global_dof_index n_dofs = dof.n_dofs(level); (void)n_dofs; @@ -575,9 +575,9 @@ namespace MGTools ExcDimensionMismatch(sparsity.n_cols(), n_dofs)); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; - std::vector dofs_on_this_cell(dofs_per_cell); - typename DoFHandlerType::cell_iterator cell = dof.begin(level), - endc = dof.end(level); + std::vector dofs_on_this_cell(dofs_per_cell); + typename DoFHandler::cell_iterator cell = dof.begin(level), + endc = dof.end(level); for (; cell != endc; ++cell) if (dof.get_triangulation().locally_owned_subdomain() == numbers::invalid_subdomain_id || @@ -1018,9 +1018,9 @@ namespace MGTools - template + template void - make_interface_sparsity_pattern(const DoFHandlerType & dof, + make_interface_sparsity_pattern(const DoFHandler &dof, const MGConstrainedDoFs &mg_constrained_dofs, SparsityPatternType & sparsity, const unsigned int level) @@ -1034,9 +1034,9 @@ namespace MGTools ExcDimensionMismatch(sparsity.n_cols(), n_dofs)); const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; - std::vector dofs_on_this_cell(dofs_per_cell); - typename DoFHandlerType::cell_iterator cell = dof.begin(level), - endc = dof.end(level); + std::vector dofs_on_this_cell(dofs_per_cell); + typename DoFHandler::cell_iterator cell = dof.begin(level), + endc = dof.end(level); for (; cell != endc; ++cell) if (cell->is_locally_owned_on_level()) { @@ -1153,18 +1153,16 @@ namespace MGTools - template + template void count_dofs_per_block( - const DoFHandlerType & dof_handler, + const DoFHandler & dof_handler, std::vector> &dofs_per_block, std::vector target_block) { - const FiniteElement &fe = - dof_handler.get_fe(); - const unsigned int n_blocks = fe.n_blocks(); - const unsigned int n_levels = + const FiniteElement &fe = dof_handler.get_fe(); + const unsigned int n_blocks = fe.n_blocks(); + const unsigned int n_levels = dof_handler.get_triangulation().n_global_levels(); AssertDimension(dofs_per_block.size(), n_levels); @@ -1213,11 +1211,10 @@ namespace MGTools for (unsigned int i = 0; i < n_blocks; ++i) { void (*fun_ptr)(const unsigned int level, - const DoFHandlerType &, + const DoFHandler &, const BlockMask &, std::vector &) = - &DoFTools::extract_level_dofs; + &DoFTools::extract_level_dofs; std::vector tmp(n_blocks, false); tmp[i] = true; diff --git a/source/multigrid/mg_tools.inst.in b/source/multigrid/mg_tools.inst.in index 9d70c819f1..5aaff41760 100644 --- a/source/multigrid/mg_tools.inst.in +++ b/source/multigrid/mg_tools.inst.in @@ -15,8 +15,7 @@ -for (DoFHandler : DOFHANDLER_TEMPLATES; PATTERN : SPARSITY_PATTERNS; - deal_II_dimension : DIMENSIONS; +for (PATTERN : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) { namespace MGTools @@ -24,11 +23,12 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; PATTERN : SPARSITY_PATTERNS; #if deal_II_dimension <= deal_II_space_dimension template void - make_sparsity_pattern< - DoFHandler, - PATTERN>(const DoFHandler &, - PATTERN &, - const unsigned int); + make_sparsity_pattern( + const DoFHandler &, + PATTERN &, + const unsigned int); #endif \} } @@ -42,12 +42,13 @@ for (PATTERN : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS; #if deal_II_dimension <= deal_II_space_dimension template void - make_interface_sparsity_pattern< - DoFHandler, - PATTERN>(const DoFHandler &, - const MGConstrainedDoFs &, - PATTERN &, - const unsigned int); + make_interface_sparsity_pattern( + const DoFHandler &, + const MGConstrainedDoFs &, + PATTERN &, + const unsigned int); #endif #if deal_II_dimension == deal_II_space_dimension -- 2.39.5