From: Wolfgang Bangerth Date: Fri, 8 Sep 2023 11:30:20 +0000 (-0600) Subject: Avoid the use of deprecated functions. X-Git-Tag: relicensing~515^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e19e08c3d8f8f0e01750122a3a5905fa98f5a0a7;p=dealii.git Avoid the use of deprecated functions. --- diff --git a/include/deal.II/distributed/solution_transfer.h b/include/deal.II/distributed/solution_transfer.h index db5ee4dfed..015ec0faa0 100644 --- a/include/deal.II/distributed/solution_transfer.h +++ b/include/deal.II/distributed/solution_transfer.h @@ -89,10 +89,9 @@ namespace parallel * process): * @code * // Create initial indexsets pertaining to the grid before refinement - * IndexSet locally_owned_dofs, locally_relevant_dofs; - * locally_owned_dofs = dof_handler.locally_owned_dofs(); - * DoFTools::extract_locally_relevant_dofs(dof_handler, - * locally_relevant_dofs); + * const IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); + * const IndexSet locally_relevant_dofs = + * DoFTools::extract_locally_relevant_dofs(dof_handler); * * // The solution vector only knows about locally owned DoFs * TrilinosWrappers::MPI::Vector solution; diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 761f7de48b..7461abedaf 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -1586,8 +1586,8 @@ namespace FETools &dh.get_triangulation()); Assert(parallel_tria != nullptr, ExcNotImplemented()); const IndexSet &locally_owned_dofs = dh.locally_owned_dofs(); - IndexSet locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs); + const IndexSet locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dh); vector.reinit(locally_owned_dofs, locally_relevant_dofs, parallel_tria->get_communicator()); @@ -1606,8 +1606,8 @@ namespace FETools &dh.get_triangulation()); Assert(parallel_tria != nullptr, ExcNotImplemented()); const IndexSet &locally_owned_dofs = dh.locally_owned_dofs(); - IndexSet locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs); + const IndexSet locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dh); vector.reinit(locally_owned_dofs, locally_relevant_dofs, parallel_tria->get_communicator()); @@ -1625,8 +1625,8 @@ namespace FETools &dh.get_triangulation()); Assert(parallel_tria != nullptr, ExcNotImplemented()); const IndexSet &locally_owned_dofs = dh.locally_owned_dofs(); - IndexSet locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs); + const IndexSet locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dh); vector.reinit(locally_owned_dofs, locally_relevant_dofs, parallel_tria->get_communicator()); diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index cf1350a8cc..bea408341d 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -382,8 +382,8 @@ namespace FETools // vector u2 with based on the sets of locally owned and relevant // dofs of dof2 const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs(); - IndexSet dof2_locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs); + const IndexSet dof2_locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dof2); PETScWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs, u1.get_mpi_communicator()); @@ -431,8 +431,8 @@ namespace FETools // vector u2 with based on the sets of locally owned and relevant // dofs of dof2 const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs(); - IndexSet dof2_locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs); + const IndexSet dof2_locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dof2); TrilinosWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs, u1.get_mpi_communicator()); @@ -462,8 +462,8 @@ namespace FETools return; const MPI_Comm mpi_communicator = u1.block(0).get_mpi_communicator(); const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs(); - IndexSet dof2_locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs); + const IndexSet dof2_locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dof2); TrilinosWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs, mpi_communicator); @@ -524,8 +524,8 @@ namespace FETools LinearAlgebra::distributed::Vector &u1_interpolated) { const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs(); - IndexSet dof2_locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs); + const IndexSet dof2_locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dof2); LinearAlgebra::distributed::Vector u2(dof2_locally_owned_dofs, dof2_locally_relevant_dofs, diff --git a/include/deal.II/numerics/solution_transfer.h b/include/deal.II/numerics/solution_transfer.h index ff35c6d750..3e6043b3c5 100644 --- a/include/deal.II/numerics/solution_transfer.h +++ b/include/deal.II/numerics/solution_transfer.h @@ -129,9 +129,9 @@ DEAL_II_NAMESPACE_OPEN * required for the interpolation process): * @code * // Create initial indexsets pertaining to the grid before refinement - * IndexSet locally_owned_dofs, locally_relevant_dofs; - * locally_owned_dofs = dof_handler.locally_owned_dofs(); - * DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); + * const IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); + * const IndexSet locally_relevant_dofs = + * DoFTools::extract_locally_relevant_dofs(dof_handler); * * // The solution vector only knows about locally owned DoFs * TrilinosWrappers::MPI::Vector solution; diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index 6ddf1a96d0..d234305774 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -415,17 +415,16 @@ namespace DoFRenumbering const IndexSet &locally_owned_dofs = [&]() -> const IndexSet & { if (reorder_level_dofs == false) { - DoFTools::extract_locally_relevant_dofs(dof_handler, - locally_relevant_dofs); + locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dof_handler); return dof_handler.locally_owned_dofs(); } else { Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index, ExcDoFHandlerNotInitialized()); - DoFTools::extract_locally_relevant_level_dofs(dof_handler, - level, - locally_relevant_dofs); + locally_relevant_dofs = + DoFTools::extract_locally_relevant_level_dofs(dof_handler, level); return dof_handler.locally_owned_mg_dofs(level); } }(); @@ -476,14 +475,13 @@ namespace DoFRenumbering IndexSet locally_active_dofs; if (reorder_level_dofs == false) { - DoFTools::extract_locally_active_dofs(dof_handler, - locally_active_dofs); + locally_active_dofs = + DoFTools::extract_locally_active_dofs(dof_handler); } else { - DoFTools::extract_locally_active_level_dofs(dof_handler, - locally_active_dofs, - level); + locally_active_dofs = + DoFTools::extract_locally_active_level_dofs(dof_handler, level); } bool needs_locally_active = false; diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index c0d8d3bb6e..db9f5458dc 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -2894,10 +2894,9 @@ namespace DoFTools } - IndexSet locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs( - coarse_to_fine_grid_map.get_destination_grid(), - locally_relevant_dofs); + const IndexSet locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs( + coarse_to_fine_grid_map.get_destination_grid()); copy_data.global_parameter_representation[i].reinit( coarse_to_fine_grid_map.get_destination_grid() diff --git a/source/fe/mapping_q_cache.cc b/source/fe/mapping_q_cache.cc index 813f4a7c4f..abeb8758d6 100644 --- a/source/fe/mapping_q_cache.cc +++ b/source/fe/mapping_q_cache.cc @@ -311,9 +311,9 @@ MappingQCache::initialize( // Step 1: copy global vector so that the ghost values are such that the // cache can be set up for all ghost cells LinearAlgebra::distributed::Vector - vector_ghosted; - IndexSet locally_relevant_dofs; - DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); + vector_ghosted; + const IndexSet locally_relevant_dofs = + DoFTools::extract_locally_relevant_dofs(dof_handler); vector_ghosted.reinit(dof_handler.locally_owned_dofs(), locally_relevant_dofs, dof_handler.get_communicator()); @@ -515,10 +515,8 @@ MappingQCache::initialize( for (unsigned int l = vectors.min_level(); l <= vectors.max_level(); ++l) { - IndexSet locally_relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs(dof_handler, - l, - locally_relevant_dofs); + const IndexSet locally_relevant_dofs = + DoFTools::extract_locally_relevant_level_dofs(dof_handler, l); vectors_ghosted[l].reinit(dof_handler.locally_owned_mg_dofs(l), locally_relevant_dofs, dof_handler.get_communicator()); diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 9a15719135..408f298d5f 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -211,10 +211,8 @@ MGTransferPrebuilt::build( // // increment dofs_per_cell since a useless diagonal element will be // stored - IndexSet level_p1_relevant_dofs; - DoFTools::extract_locally_relevant_level_dofs(dof_handler, - level + 1, - level_p1_relevant_dofs); + const IndexSet level_p1_relevant_dofs = + DoFTools::extract_locally_relevant_level_dofs(dof_handler, level + 1); DynamicSparsityPattern dsp(this->sizes[level + 1], this->sizes[level], level_p1_relevant_dofs); diff --git a/source/numerics/data_out_resample.cc b/source/numerics/data_out_resample.cc index 22d9ce4f32..df7f7abf8e 100644 --- a/source/numerics/data_out_resample.cc +++ b/source/numerics/data_out_resample.cc @@ -64,8 +64,8 @@ DataOutResample::update_mapping( std::vector dof_indices(fe.n_dofs_per_cell()); - IndexSet active_dofs; - DoFTools::extract_locally_active_dofs(patch_dof_handler, active_dofs); + const IndexSet active_dofs = + DoFTools::extract_locally_active_dofs(patch_dof_handler); partitioner = std::make_shared( patch_dof_handler.locally_owned_dofs(), active_dofs, MPI_COMM_WORLD);