From: Peter Munch Date: Mon, 29 Jun 2020 06:57:55 +0000 (+0200) Subject: Remove DoFHandlerType from mg_tools.h X-Git-Tag: v9.3.0-rc1~1349^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e5e2194aa0999d33d38c1330cde62273373208f;p=dealii.git Remove DoFHandlerType from mg_tools.h --- 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