From 5b2f1a087c8d81140dfe56ead328c8cc56a63a57 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 28 May 2021 10:34:15 -0400 Subject: [PATCH] Remove deprecated DoFTools::extract_*dofs --- .../incompatibilities/20210528DanielArndt | 4 + include/deal.II/dofs/dof_tools.h | 107 ------------------ source/dofs/dof_tools.cc | 77 ------------- source/dofs/dof_tools.inst.in | 26 ----- 4 files changed, 4 insertions(+), 210 deletions(-) create mode 100644 doc/news/changes/incompatibilities/20210528DanielArndt diff --git a/doc/news/changes/incompatibilities/20210528DanielArndt b/doc/news/changes/incompatibilities/20210528DanielArndt new file mode 100644 index 0000000000..7bc5e527f3 --- /dev/null +++ b/doc/news/changes/incompatibilities/20210528DanielArndt @@ -0,0 +1,4 @@ +Removed: The deprecated overloads for DoFTools::extract_hanging_node_dofs(), +and DoFTools::extract_dofs() have been removed. +
+(Daniel Arndt, 2021/05/28) diff --git a/include/deal.II/dofs/dof_tools.h b/include/deal.II/dofs/dof_tools.h index 7f5f9ac329..c0980169b2 100644 --- a/include/deal.II/dofs/dof_tools.h +++ b/include/deal.II/dofs/dof_tools.h @@ -1198,29 +1198,6 @@ namespace DoFTools * @{ */ - /** - * Select all dofs that will be constrained by interface constraints, i.e. - * all hanging nodes. - * - * The size of @p selected_dofs shall equal dof_handler.n_dofs(). - * Previous contents of this array or overwritten. - * - * In case of a parallel::shared::Triangulation or a - * parallel::distributed::Triangulation only locally relevant dofs are - * considered. Note that the vector returned through the second argument still - * has size dof_handler.n_dofs(). Consequently, it can be very large - * for large parallel computations -- in fact, it may be too large to store on - * each processor. In that case, you may want to choose the variant of this - * function that returns an IndexSet object. - * - * @deprecated For the reason stated above, this function is deprecated in - * favor of the following function. - */ - template - DEAL_II_DEPRECATED void - extract_hanging_node_dofs(const DoFHandler &dof_handler, - std::vector & selected_dofs); - /** * Same as above but return the selected DoFs as IndexSet. In particular, * for parallel::TriangulationBase objects this function should be preferred. @@ -1229,54 +1206,6 @@ namespace DoFTools IndexSet extract_hanging_node_dofs(const DoFHandler &dof_handler); - /** - * Extract the indices of the degrees of freedom belonging to certain vector - * components of a vector-valued finite element. The @p component_mask - * defines which components or blocks of an FESystem are to be extracted - * from the DoFHandler @p dof. The entries in the output array @p - * selected_dofs corresponding to degrees of freedom belonging to these - * components are then flagged @p true, while all others are set to @p - * false. - * - * If the finite element under consideration is not primitive, i.e., some or - * all of its shape functions are non-zero in more than one vector component - * (which holds, for example, for FE_Nedelec or FE_RaviartThomas elements), - * then shape functions cannot be associated with a single vector component. - * In this case, if one shape vector component of this element is - * flagged in @p component_mask (see - * @ref GlossComponentMask), - * then this is equivalent to selecting all vector components - * corresponding to this non-primitive base element. - * - * @param[in] dof_handler The DoFHandler whose enumerated degrees of freedom - * are to be filtered by this function. - * @param[in] component_mask A mask that states which components you want - * to select. The size of this mask must be compatible with the number of - * components in the FiniteElement used by the @p dof_handler. See - * @ref GlossComponentMask "the glossary entry on component masks" - * for more information. - * @param[out] selected_dofs A vector that will hold @p true or @p false - * values for each degree of freedom depending on whether or not it - * corresponds to a vector component selected by the mask above. The size - * of this array must equal DoFHandler::n_locally_owned_dofs(), which for - * sequential computations of course equals DoFHandler::n_dofs(). The - * previous contents of this array are overwritten. Note that the resulting - * vector just holds the locally owned extracted degrees of freedom, which - * first have to be mapped to the global degrees of freedom, to correspond - * with them. - * - * @deprecated This function is difficult to use in parallel contexts because - * it returns a vector that needs to be indexed based on the position - * of a degree of freedom within the set of locally owned degrees of - * freedom. It is consequently deprecated in favor of the following - * function. - */ - template - DEAL_II_DEPRECATED void - extract_dofs(const DoFHandler &dof_handler, - const ComponentMask & component_mask, - std::vector & selected_dofs); - /** * Extract the (locally owned) indices of the degrees of freedom belonging to * certain vector components of a vector-valued finite element. The @@ -1314,42 +1243,6 @@ namespace DoFTools extract_dofs(const DoFHandler &dof_handler, const ComponentMask & component_mask); - /** - * This function is the equivalent to the DoFTools::extract_dofs() functions - * above except that the selection of which degrees of freedom to extract is - * not done based on components (see - * @ref GlossComponent) - * but instead based on whether they are part of a particular block (see - * @ref GlossBlock). - * Consequently, the second argument is not a ComponentMask but a BlockMask - * object. - * - * @param[in] dof_handler The DoFHandler whose enumerated degrees of freedom - * are to be filtered by this function. - * @param[in] block_mask A mask that states which blocks you want - * to select. The size of this mask must be compatible with the number of - * blocks in the FiniteElement used by the @p dof_handler. See - * @ref GlossBlockMask "the glossary entry on block masks" - * for more information. - * @param[out] selected_dofs A vector that will hold @p true or @p false - * values for each degree of freedom depending on whether or not it - * corresponds to a vector block selected by the mask above. The size - * of this array must equal DoFHandler::n_locally_owned_dofs(), which for - * sequential computations of course equals DoFHandler::n_dofs(). The - * previous contents of this array are overwritten. - * - * @deprecated This function is difficult to use in parallel contexts because - * it returns a vector that needs to be indexed based on the position - * of a degree of freedom within the set of locally owned degrees of - * freedom. It is consequently deprecated in favor of the following - * function. - */ - template - DEAL_II_DEPRECATED void - extract_dofs(const DoFHandler &dof_handler, - const BlockMask & block_mask, - std::vector & selected_dofs); - /** * This function is the equivalent to the DoFTools::extract_dofs() functions * above except that the selection of which degrees of freedom to extract is diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index e6d9d86dca..e595c456fc 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -388,53 +388,6 @@ namespace DoFTools - template - void - extract_dofs(const DoFHandler &dof, - const ComponentMask & component_mask, - std::vector & selected_dofs) - { - Assert(component_mask.represents_n_components( - dof.get_fe_collection().n_components()), - ExcMessage( - "The given component mask is not sized correctly to represent the " - "components of the given finite element.")); - Assert(selected_dofs.size() == dof.n_locally_owned_dofs(), - ExcDimensionMismatch(selected_dofs.size(), - dof.n_locally_owned_dofs())); - - // two special cases: no component is selected, and all components are - // selected; both rather stupid, but easy to catch - if (component_mask.n_selected_components( - dof.get_fe_collection().n_components()) == 0) - { - std::fill_n(selected_dofs.begin(), dof.n_locally_owned_dofs(), false); - return; - } - else if (component_mask.n_selected_components( - dof.get_fe_collection().n_components()) == - dof.get_fe_collection().n_components()) - { - std::fill_n(selected_dofs.begin(), dof.n_locally_owned_dofs(), true); - return; - } - - - // preset all values by false - std::fill_n(selected_dofs.begin(), dof.n_locally_owned_dofs(), false); - - // get the component association of each DoF and then select the ones - // that match the given set of components - std::vector dofs_by_component(dof.n_locally_owned_dofs()); - internal::get_component_association(dof, component_mask, dofs_by_component); - - for (types::global_dof_index i = 0; i < dof.n_locally_owned_dofs(); ++i) - if (component_mask[dofs_by_component[i]] == true) - selected_dofs[i] = true; - } - - - template IndexSet extract_dofs(const DoFHandler &dof, @@ -476,19 +429,6 @@ namespace DoFTools - template - void - extract_dofs(const DoFHandler &dof, - const BlockMask & block_mask, - std::vector & selected_dofs) - { - // simply forward to the function that works based on a component mask - extract_dofs( - dof, dof.get_fe_collection().component_mask(block_mask), selected_dofs); - } - - - template IndexSet extract_dofs(const DoFHandler &dof, @@ -1074,23 +1014,6 @@ namespace DoFTools - template - void - extract_hanging_node_dofs(const DoFHandler &dof_handler, - std::vector & selected_dofs) - { - const IndexSet selected_dofs_as_index_set = - extract_hanging_node_dofs(dof_handler); - Assert(selected_dofs.size() == dof_handler.n_dofs(), - ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs())); - // preset all values by false - std::fill(selected_dofs.begin(), selected_dofs.end(), false); - for (const auto index : selected_dofs_as_index_set) - selected_dofs[index] = true; - } - - - template IndexSet extract_hanging_node_dofs(const DoFHandler &dof_handler) diff --git a/source/dofs/dof_tools.inst.in b/source/dofs/dof_tools.inst.in index ea15af6bee..9f907a2eb1 100644 --- a/source/dofs/dof_tools.inst.in +++ b/source/dofs/dof_tools.inst.in @@ -93,22 +93,6 @@ for (deal_II_dimension, deal_II_space_dimension : DIMENSIONS) DoFHandler::active_cell_iterator> &patch); - // extract_dofs(): Deprecated versions that return information through - // the last argument - template void - extract_dofs( - const DoFHandler &, - const ComponentMask &, - std::vector &); - - template void - extract_dofs( - const DoFHandler &, - const BlockMask &, - std::vector &); - - - // extract_dofs(): New versions that return information as an IndexSet template IndexSet extract_dofs( const DoFHandler &, @@ -204,9 +188,6 @@ for (deal_II_dimension : DIMENSIONS) template IndexSet DoFTools::extract_hanging_node_dofs( const DoFHandler &); - template void DoFTools::extract_hanging_node_dofs( - const DoFHandler &, std::vector &); - template void DoFTools::extract_subdomain_dofs( const DoFHandler &dof_handler, const types::subdomain_id subdomain_id, @@ -361,10 +342,6 @@ for (deal_II_dimension : DIMENSIONS) template IndexSet DoFTools::extract_hanging_node_dofs( const DoFHandler &); - template void DoFTools::extract_hanging_node_dofs( - const DoFHandler &, - std::vector &); - #endif #if deal_II_dimension == 3 @@ -380,9 +357,6 @@ for (deal_II_dimension : DIMENSIONS) template IndexSet DoFTools::extract_hanging_node_dofs( const DoFHandler<1, 3> &); - template void DoFTools::extract_hanging_node_dofs(const DoFHandler<1, 3> &, - std::vector &); - #endif } -- 2.39.5