From 2befa96c77ac27eb5f4439d5dc8dabdff3102d58 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 30 Mar 2021 21:18:42 -0600 Subject: [PATCH] Deprecate a function in DoFTools. While there also update the documentation of its replacement a bit. --- include/deal.II/dofs/dof_tools.h | 42 +++++++++++++++++++------------- source/dofs/dof_tools.cc | 2 +- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/include/deal.II/dofs/dof_tools.h b/include/deal.II/dofs/dof_tools.h index 5e4926f822..9b526fdb45 100644 --- a/include/deal.II/dofs/dof_tools.h +++ b/include/deal.II/dofs/dof_tools.h @@ -1405,9 +1405,9 @@ namespace DoFTools * specified components of the solution. The function returns its results in * the last non-default-valued parameter which contains @p true if a degree * of freedom is at the boundary and belongs to one of the selected - * components, and @p false otherwise. The function is used in step-15. + * components, and @p false otherwise. * - * By specifying the @p boundary_id variable, you can select which boundary + * By specifying the @p boundary_ids variable, you can select which boundary * indicators the faces have to have on which the degrees of freedom are * located that shall be extracted. If it is an empty list, then all * boundary indicators are accepted. @@ -1424,13 +1424,15 @@ namespace DoFTools * component mask is used that corresponds to the first non-zero components. * Elements in the mask corresponding to later components are ignored. * - * @note This function will not work for DoFHandler objects that are built + * @deprecated This function will not work for DoFHandler objects that are built * on a parallel::distributed::Triangulation object. The reasons is that the * output argument @p selected_dofs has to have a length equal to all * global degrees of freedom. Consequently, this does not scale to very - * large problems. If you need the functionality of this function for + * large problems, and this is also why the function is deprecated. If you + * need the functionality of this function for * parallel triangulations, then you need to use the other - * DoFTools::extract_boundary_dofs function. + * DoFTools::extract_boundary_dofs() function that returns its information + * via an IndexSet object. * * @param[in] dof_handler The object that describes which degrees of freedom * live on which cell. @@ -1453,24 +1455,31 @@ namespace DoFTools * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ template - void + DEAL_II_DEPRECATED_EARLY void extract_boundary_dofs(const DoFHandler & dof_handler, const ComponentMask & component_mask, std::vector & selected_dofs, - const std::set &boundary_ids = - std::set()); + const std::set &boundary_ids = {}); /** - * This function does the same as the previous one but it returns its result - * as an IndexSet rather than a std::vector@. Thus, it can also be - * called for DoFHandler objects that are defined on - * parallel::distributed::Triangulation objects. + * Extract all degrees of freedom which are at the boundary and belong to + * specified components of the solution. The function returns its results in + * the form of an IndexSet that contains those entries that correspond to + * these selected degrees of freedom, i.e., which are at the boundary and + * belong to one of the selected components. + * + * By specifying the @p boundary_ids variable, you can select which boundary + * indicators the faces have to have on which the degrees of freedom are + * located that shall be extracted. If it is an empty list (the default), then + * all boundary indicators are accepted. * - * @note If the DoFHandler object is indeed defined on a - * parallel::distributed::Triangulation, then the @p selected_dofs index set + * @note If the DoFHandler object is defined on a + * parallel Triangulation object, then the computed index set * will contain only those degrees of freedom on the boundary that belong to * the locally relevant set (see - * @ref GlossLocallyRelevantDof "locally relevant DoFs"). + * @ref GlossLocallyRelevantDof "locally relevant DoFs"), i.e., the function + * only considers faces of locally owned and ghost cells, but not of + * artificial cells. * * @param[in] dof_handler The object that describes which degrees of freedom * live on which cell. @@ -1495,8 +1504,7 @@ namespace DoFTools extract_boundary_dofs(const DoFHandler & dof_handler, const ComponentMask & component_mask, IndexSet & selected_dofs, - const std::set &boundary_ids = - std::set()); + const std::set &boundary_ids = {}); /** * This function is similar to the extract_boundary_dofs() function but it diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 30fc0849fe..55f29fad21 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -634,6 +634,7 @@ namespace DoFTools } + template void extract_boundary_dofs(const DoFHandler & dof_handler, @@ -675,7 +676,6 @@ namespace DoFTools // boundary line is also part of a boundary face which we will be // visiting sooner or later for (const auto &cell : dof_handler.active_cell_iterators()) - // only work on cells that are either locally owned or at least ghost // cells if (cell->is_artificial() == false) -- 2.39.5