From: Daniel Arndt Date: Fri, 10 Jul 2020 20:20:14 +0000 (-0400) Subject: Remove deprecated MGConstrainedDoFs::initialize overload X-Git-Tag: v9.3.0-rc1~1279^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10694%2Fhead;p=dealii.git Remove deprecated MGConstrainedDoFs::initialize overload --- diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index beddf94a71..eb5e2dd907 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -69,23 +69,6 @@ public: void initialize(const DoFHandler &dof); - /** - * Fill the internal data structures with values extracted from the dof - * handler object and apply the boundary values provided. - * - * This function internally calls the initialize() function above and the - * constrains degrees on the external boundary of the domain by calling - * MGTools::make_boundary_list() with the given second and third argument. - * - * @deprecated Use initialize() followed by make_zero_boundary_constraints() instead - */ - template - DEAL_II_DEPRECATED void - initialize(const DoFHandler &dof, - const std::map *> - & function_map, - const ComponentMask &component_mask = ComponentMask()); - /** * Fill the internal data structures with information * about Dirichlet boundary dofs. @@ -326,27 +309,6 @@ MGConstrainedDoFs::initialize(const DoFHandler &dof) } -template -inline void -MGConstrainedDoFs::initialize( - const DoFHandler & dof, - const std::map *> &function_map, - const ComponentMask &component_mask) -{ - initialize(dof); - - // allocate an IndexSet for each global level. Contents will be - // overwritten inside make_boundary_list. - const unsigned int n_levels = dof.get_triangulation().n_global_levels(); - // At this point boundary_indices is empty. - boundary_indices.resize(n_levels); - - MGTools::make_boundary_list(dof, - function_map, - boundary_indices, - component_mask); -} - template inline void diff --git a/tests/matrix_free/multigrid_dg_sip_01.cc b/tests/matrix_free/multigrid_dg_sip_01.cc index 46f0199226..16b4185219 100644 --- a/tests/matrix_free/multigrid_dg_sip_01.cc +++ b/tests/matrix_free/multigrid_dg_sip_01.cc @@ -593,11 +593,9 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) } mg_smoother.initialize(mg_matrices, smoother_data); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MGTransferMF mg_transfer(mg_matrices, mg_constrained_dofs); diff --git a/tests/matrix_free/multigrid_dg_sip_02.cc b/tests/matrix_free/multigrid_dg_sip_02.cc index 93bb327e3c..f515e2a59f 100644 --- a/tests/matrix_free/multigrid_dg_sip_02.cc +++ b/tests/matrix_free/multigrid_dg_sip_02.cc @@ -500,11 +500,9 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) } mg_smoother.initialize(mg_matrices, smoother_data); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MGTransferMF mg_transfer(mg_matrices, mg_constrained_dofs); diff --git a/tests/matrix_free/parallel_multigrid_02.cc b/tests/matrix_free/parallel_multigrid_02.cc index 001ac71bd6..502521d8a0 100644 --- a/tests/matrix_free/parallel_multigrid_02.cc +++ b/tests/matrix_free/parallel_multigrid_02.cc @@ -116,7 +116,8 @@ do_test(const DoFHandler &dof) // level constraints: MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_01.cc b/tests/matrix_free/parallel_multigrid_adaptive_01.cc index 989d86af05..112bdbcee0 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_01.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_01.cc @@ -517,7 +517,8 @@ do_test(const DoFHandler &dof) Functions::ZeroFunction zero_function; std::map *> dirichlet_boundary; dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); LaplaceOperator fine_matrix; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_02.cc b/tests/matrix_free/parallel_multigrid_adaptive_02.cc index 5d5479275a..ab5be7e828 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_02.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_02.cc @@ -154,7 +154,8 @@ do_test(const DoFHandler &dof) // level constraints: MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_03.cc b/tests/matrix_free/parallel_multigrid_adaptive_03.cc index 578fad89ed..69a95e3863 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_03.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_03.cc @@ -525,7 +525,8 @@ do_test(const DoFHandler &dof, const bool threaded) Functions::ZeroFunction zero_function; std::map *> dirichlet_boundary; dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); LaplaceOperator fine_matrix; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_04.cc b/tests/matrix_free/parallel_multigrid_adaptive_04.cc index 76a6127fde..f4ff27044f 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_04.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_04.cc @@ -154,7 +154,8 @@ do_test(const DoFHandler &dof) // level constraints: MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_05.cc b/tests/matrix_free/parallel_multigrid_adaptive_05.cc index 707c0c5f3a..10af8b4820 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_05.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_05.cc @@ -522,7 +522,8 @@ do_test(const DoFHandler &dof, const bool threaded) Functions::ZeroFunction zero_function; std::map *> dirichlet_boundary; dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); LaplaceOperator fine_matrix; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_06.cc b/tests/matrix_free/parallel_multigrid_adaptive_06.cc index c7035df983..b17a08d117 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_06.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_06.cc @@ -239,7 +239,8 @@ do_test(const DoFHandler &dof, const unsigned int nb) // level constraints: MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc b/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc index 27c3755119..f83983f149 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_06ref.cc @@ -155,7 +155,8 @@ do_test(const DoFHandler &dof) // level constraints: MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_07.cc b/tests/matrix_free/parallel_multigrid_adaptive_07.cc index 90413c81fb..d58cbb863a 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_07.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_07.cc @@ -316,7 +316,10 @@ do_test(const std::vector *> &dof) // level constraints: std::vector mg_constrained_dofs(dof.size()); for (unsigned int i = 0; i < dof.size(); ++i) - mg_constrained_dofs[i].initialize(*dof[i], dirichlet_boundary); + { + mg_constrained_dofs[i].initialize(*dof[i]); + mg_constrained_dofs[i].make_zero_boundary_constraints(*dof[i], {0}); + } // set up multigrid in analogy to step-37 typedef BlockLaplace &dof) // level constraints: MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MappingQ mapping(fe_degree + 1); diff --git a/tests/matrix_free/parallel_multigrid_fullydistributed.cc b/tests/matrix_free/parallel_multigrid_fullydistributed.cc index 213d3f7555..cd7f36afdc 100644 --- a/tests/matrix_free/parallel_multigrid_fullydistributed.cc +++ b/tests/matrix_free/parallel_multigrid_fullydistributed.cc @@ -377,11 +377,9 @@ do_test(const DoFHandler &dof) mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level); } - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MGTransferPrebuiltMF mg_transfer(mg_matrices, mg_constrained_dofs); diff --git a/tests/matrix_free/parallel_multigrid_mf.cc b/tests/matrix_free/parallel_multigrid_mf.cc index 8fd453e8ca..8943074e68 100644 --- a/tests/matrix_free/parallel_multigrid_mf.cc +++ b/tests/matrix_free/parallel_multigrid_mf.cc @@ -373,11 +373,9 @@ do_test(const DoFHandler &dof) mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level); } - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); MGTransferPrebuiltMF mg_transfer(mg_matrices, mg_constrained_dofs); diff --git a/tests/matrix_free/parallel_multigrid_mf_02.cc b/tests/matrix_free/parallel_multigrid_mf_02.cc index 11c4947966..31f4362ca9 100644 --- a/tests/matrix_free/parallel_multigrid_mf_02.cc +++ b/tests/matrix_free/parallel_multigrid_mf_02.cc @@ -135,7 +135,8 @@ do_test(const DoFHandler &dof) // set up multigrid in analogy to step-37 MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(dof, dirichlet_boundary); + mg_constrained_dofs.initialize(dof); + mg_constrained_dofs.make_zero_boundary_constraints(dof, {0}); typedef MatrixFreeOperators::LaplaceOperator< dim, diff --git a/tests/mpi/multigrid_adaptive.cc b/tests/mpi/multigrid_adaptive.cc index 8f688b4013..abf722e920 100644 --- a/tests/mpi/multigrid_adaptive.cc +++ b/tests/mpi/multigrid_adaptive.cc @@ -209,7 +209,8 @@ namespace Step50 true); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/mpi/multigrid_uniform.cc b/tests/mpi/multigrid_uniform.cc index ccd1e44190..07d1818050 100644 --- a/tests/mpi/multigrid_uniform.cc +++ b/tests/mpi/multigrid_uniform.cc @@ -209,7 +209,8 @@ namespace Step50 true); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/constrained_dofs_01.cc b/tests/multigrid/constrained_dofs_01.cc index 61b24c402d..0a3797a5c0 100644 --- a/tests/multigrid/constrained_dofs_01.cc +++ b/tests/multigrid/constrained_dofs_01.cc @@ -124,20 +124,16 @@ check_fe(FiniteElement &fe) cell->update_cell_dof_indices_cache(); } - std::map *> dirichlet_boundary; - Functions::ZeroFunction homogeneous_dirichlet_bc(1); - dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - mg_constrained_dofs_ref.initialize(dofhref, dirichlet_boundary); + mg_constrained_dofs_ref.initialize(dofhref); + mg_constrained_dofs_ref.make_zero_boundary_constraints(dofhref, {0}); } MGConstrainedDoFs mg_constrained_dofs; - std::map *> dirichlet_boundary; - Functions::ZeroFunction homogeneous_dirichlet_bc(1); - dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - mg_constrained_dofs.initialize(dofh, dirichlet_boundary); + mg_constrained_dofs.initialize(dofh); + mg_constrained_dofs.make_zero_boundary_constraints(dofh, {0}); const unsigned int n_levels = tr.n_global_levels(); for (unsigned int level = 0; level < n_levels; ++level) diff --git a/tests/multigrid/constrained_dofs_02.cc b/tests/multigrid/constrained_dofs_02.cc index 1165f8251d..1b83f1c00f 100644 --- a/tests/multigrid/constrained_dofs_02.cc +++ b/tests/multigrid/constrained_dofs_02.cc @@ -185,20 +185,15 @@ check_fe(FiniteElement &fe) cell->update_cell_dof_indices_cache(); } - std::map *> dirichlet_boundary; - Functions::ZeroFunction homogeneous_dirichlet_bc(1); - dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - mg_constrained_dofs_ref.initialize(dofhref, dirichlet_boundary); + mg_constrained_dofs_ref.initialize(dofhref); + mg_constrained_dofs_ref.make_zero_boundary_constraints(dofhref, {0}); } MGConstrainedDoFs mg_constrained_dofs; - - std::map *> dirichlet_boundary; - Functions::ZeroFunction homogeneous_dirichlet_bc(1); - dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - mg_constrained_dofs.initialize(dofh, dirichlet_boundary); + mg_constrained_dofs.initialize(dofh); + mg_constrained_dofs.make_zero_boundary_constraints(dofh, {0}); const unsigned int n_levels = tr.n_global_levels(); for (unsigned int level = 0; level < n_levels; ++level) diff --git a/tests/multigrid/events_01.cc b/tests/multigrid/events_01.cc index 957a1fec17..02bd6b8486 100644 --- a/tests/multigrid/events_01.cc +++ b/tests/multigrid/events_01.cc @@ -170,7 +170,8 @@ namespace Step50 mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/mg_coarse_01.cc b/tests/multigrid/mg_coarse_01.cc index ca7c5da2a8..b344975e96 100644 --- a/tests/multigrid/mg_coarse_01.cc +++ b/tests/multigrid/mg_coarse_01.cc @@ -227,7 +227,8 @@ namespace Step50 mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/mg_output_dirichlet.cc b/tests/multigrid/mg_output_dirichlet.cc index a44c0b93eb..8de985f29d 100644 --- a/tests/multigrid/mg_output_dirichlet.cc +++ b/tests/multigrid/mg_output_dirichlet.cc @@ -204,10 +204,6 @@ check_simple(const FiniteElement &fe) Triangulation tr(Triangulation::limit_level_difference_at_vertices); GridGenerator::hyper_cube(tr, -1, 1); - std::map *> - dirichlet_boundary_functions; - Functions::ZeroFunction homogeneous_dirichlet_bc(1); - dirichlet_boundary_functions[0] = &homogeneous_dirichlet_bc; tr.refine_global(1); refine_mesh(tr); @@ -234,11 +230,13 @@ check_simple(const FiniteElement &fe) DoFRenumbering::component_wise(mgdof_renumbered, level, block_component); MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary_functions); + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); MGConstrainedDoFs mg_constrained_dofs_renumbered; - mg_constrained_dofs_renumbered.initialize(mgdof_renumbered, - dirichlet_boundary_functions); + mg_constrained_dofs_renumbered.initialize(mgdof_renumbered); + mg_constrained_dofs_renumbered.make_zero_boundary_constraints( + mgdof_renumbered, {0}); MGTransferPrebuilt> transfer(mg_constrained_dofs); transfer.build(mgdof); diff --git a/tests/multigrid/mg_output_neumann.cc b/tests/multigrid/mg_output_neumann.cc index 4b88e7900a..93c8e69289 100644 --- a/tests/multigrid/mg_output_neumann.cc +++ b/tests/multigrid/mg_output_neumann.cc @@ -204,8 +204,6 @@ check_simple(const FiniteElement &fe) Triangulation tr(Triangulation::limit_level_difference_at_vertices); GridGenerator::hyper_cube(tr, -1, 1); - std::map *> - dirichlet_boundary_functions; tr.refine_global(1); refine_mesh(tr); @@ -232,11 +230,10 @@ check_simple(const FiniteElement &fe) DoFRenumbering::component_wise(mgdof_renumbered, level, block_component); MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary_functions); + mg_constrained_dofs.initialize(mgdof); MGConstrainedDoFs mg_constrained_dofs_renumbered; - mg_constrained_dofs_renumbered.initialize(mgdof_renumbered, - dirichlet_boundary_functions); + mg_constrained_dofs_renumbered.initialize(mgdof_renumbered); MGTransferPrebuilt> transfer(mg_constrained_dofs); transfer.build(mgdof); diff --git a/tests/multigrid/mg_renumbered_01.cc b/tests/multigrid/mg_renumbered_01.cc index bddb63a5ae..c15107f1d6 100644 --- a/tests/multigrid/mg_renumbered_01.cc +++ b/tests/multigrid/mg_renumbered_01.cc @@ -339,10 +339,6 @@ template void LaplaceProblem::test() { - std::map *> dirichlet_boundary; - Functions::ZeroFunction dirichlet_bc(fe.n_components()); - dirichlet_boundary[0] = &dirichlet_bc; - const unsigned int min_l = mg_matrices.min_level(); const unsigned int max_l = mg_matrices.max_level(); for (unsigned int l = min_l; l < max_l; ++l) @@ -352,10 +348,12 @@ LaplaceProblem::test() } MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); MGConstrainedDoFs mg_constrained_dofs_renumbered; - mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered, - dirichlet_boundary); + mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered); + mg_constrained_dofs_renumbered.make_zero_boundary_constraints( + mg_dof_handler_renumbered, {0}); MGTransferPrebuilt> mg_transfer(mg_constrained_dofs); mg_transfer.build(mg_dof_handler); diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 91ca55d24b..60e3605791 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -348,15 +348,13 @@ template void LaplaceProblem::test() { - std::map *> dirichlet_boundary; - Functions::ZeroFunction dirichlet_bc(fe.n_components()); - dirichlet_boundary[0] = &dirichlet_bc; - MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); MGConstrainedDoFs mg_constrained_dofs_renumbered; - mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered, - dirichlet_boundary); + mg_constrained_dofs_renumbered.initialize(mg_dof_handler_renumbered); + mg_constrained_dofs_renumbered.make_zero_boundary_constraints( + mg_dof_handler_renumbered, {0}); MGTransferPrebuilt> mg_transfer(mg_constrained_dofs); mg_transfer.build(mg_dof_handler); diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index 0a70e6bc6c..1ccc1c8c8f 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -268,7 +268,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_in.resize(0, n_levels - 1); diff --git a/tests/multigrid/step-16-03.cc b/tests/multigrid/step-16-03.cc index 2c1bd0a1d7..8ee966bf5c 100644 --- a/tests/multigrid/step-16-03.cc +++ b/tests/multigrid/step-16-03.cc @@ -187,7 +187,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(min_level, n_levels - 1); diff --git a/tests/multigrid/step-16-04.cc b/tests/multigrid/step-16-04.cc index 9a2f1dad7b..832ba2c1a4 100644 --- a/tests/multigrid/step-16-04.cc +++ b/tests/multigrid/step-16-04.cc @@ -191,7 +191,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(min_level, n_levels - 1); diff --git a/tests/multigrid/step-16-05.cc b/tests/multigrid/step-16-05.cc index 33d64c13c4..9319d1b687 100644 --- a/tests/multigrid/step-16-05.cc +++ b/tests/multigrid/step-16-05.cc @@ -192,7 +192,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(min_level, n_levels - 1); diff --git a/tests/multigrid/step-16-06.cc b/tests/multigrid/step-16-06.cc index a9813fdf51..6f4ccece2e 100644 --- a/tests/multigrid/step-16-06.cc +++ b/tests/multigrid/step-16-06.cc @@ -192,7 +192,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(min_level, n_levels - 1); diff --git a/tests/multigrid/step-16-07.cc b/tests/multigrid/step-16-07.cc index af8efc35eb..e39c49c165 100644 --- a/tests/multigrid/step-16-07.cc +++ b/tests/multigrid/step-16-07.cc @@ -193,7 +193,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(0, n_levels - 1); diff --git a/tests/multigrid/step-16-50-mpi-linear-operator.cc b/tests/multigrid/step-16-50-mpi-linear-operator.cc index 8b06521f60..8304a8f551 100644 --- a/tests/multigrid/step-16-50-mpi-linear-operator.cc +++ b/tests/multigrid/step-16-50-mpi-linear-operator.cc @@ -221,7 +221,8 @@ namespace Step50 mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/step-16-50-mpi-smoother.cc b/tests/multigrid/step-16-50-mpi-smoother.cc index 4e6fe6a3c3..3c3a6caad3 100644 --- a/tests/multigrid/step-16-50-mpi-smoother.cc +++ b/tests/multigrid/step-16-50-mpi-smoother.cc @@ -221,8 +221,8 @@ namespace Step50 mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); - + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/step-16-50-mpi.cc b/tests/multigrid/step-16-50-mpi.cc index d6ed95de0f..085f191062 100644 --- a/tests/multigrid/step-16-50-mpi.cc +++ b/tests/multigrid/step-16-50-mpi.cc @@ -221,7 +221,8 @@ namespace Step50 mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/step-16-50-serial.cc b/tests/multigrid/step-16-50-serial.cc index 6e7b0a4f3b..cd4d0e0559 100644 --- a/tests/multigrid/step-16-50-serial.cc +++ b/tests/multigrid/step-16-50-serial.cc @@ -191,7 +191,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(0, n_levels - 1); diff --git a/tests/multigrid/step-16-bdry1.cc b/tests/multigrid/step-16-bdry1.cc index 74bed1ed7e..9b0e7ac925 100644 --- a/tests/multigrid/step-16-bdry1.cc +++ b/tests/multigrid/step-16-bdry1.cc @@ -269,7 +269,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_in.resize(0, n_levels - 1); diff --git a/tests/multigrid/step-16.cc b/tests/multigrid/step-16.cc index 09bdb58b33..679697373f 100644 --- a/tests/multigrid/step-16.cc +++ b/tests/multigrid/step-16.cc @@ -193,7 +193,8 @@ LaplaceProblem::setup_system() system_matrix.reinit(sparsity_pattern); mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_levels(); mg_interface_matrices.resize(0, n_levels - 1); diff --git a/tests/multigrid/step-50_01.cc b/tests/multigrid/step-50_01.cc index a7493242b5..2d0b542ed4 100644 --- a/tests/multigrid/step-50_01.cc +++ b/tests/multigrid/step-50_01.cc @@ -224,7 +224,8 @@ namespace Step50 mg_constrained_dofs.clear(); - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {0}); const unsigned int n_levels = triangulation.n_global_levels(); diff --git a/tests/multigrid/transfer_05.cc b/tests/multigrid/transfer_05.cc index a720505812..94f0491a01 100644 --- a/tests/multigrid/transfer_05.cc +++ b/tests/multigrid/transfer_05.cc @@ -105,11 +105,9 @@ check(const unsigned int fe_degree) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); // build reference non-block MGTransferMatrixFree transfer_ref(mg_constrained_dofs); diff --git a/tests/multigrid/transfer_06.cc b/tests/multigrid/transfer_06.cc index 3ceceec179..4fe947f3c6 100644 --- a/tests/multigrid/transfer_06.cc +++ b/tests/multigrid/transfer_06.cc @@ -118,12 +118,12 @@ check(const unsigned int fe_degree) const std::vector *> mgdof_ptr{&mgdof_1, &mgdof_2}; std::vector mg_constrained_dofs_vector(2); - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; for (unsigned int i = 0; i < mgdof_ptr.size(); ++i) - mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i], - dirichlet_boundary); + { + mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i]); + mg_constrained_dofs_vector[i].make_zero_boundary_constraints( + *mgdof_ptr[i], {0}); + } // build reference non-block std::vector> transfer_ref; diff --git a/tests/multigrid/transfer_matrix_free_01.cc b/tests/multigrid/transfer_matrix_free_01.cc index bc013f198f..2a58d38fc1 100644 --- a/tests/multigrid/transfer_matrix_free_01.cc +++ b/tests/multigrid/transfer_matrix_free_01.cc @@ -67,11 +67,9 @@ check(const unsigned int fe_degree) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); // build reference MGTransferPrebuilt> diff --git a/tests/multigrid/transfer_matrix_free_02.cc b/tests/multigrid/transfer_matrix_free_02.cc index 5387acc103..35bc581031 100644 --- a/tests/multigrid/transfer_matrix_free_02.cc +++ b/tests/multigrid/transfer_matrix_free_02.cc @@ -96,11 +96,9 @@ check(const unsigned int fe_degree) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); // build reference MGTransferPrebuilt> diff --git a/tests/multigrid/transfer_matrix_free_02_block.cc b/tests/multigrid/transfer_matrix_free_02_block.cc index 11058c2c17..d898a4bc68 100644 --- a/tests/multigrid/transfer_matrix_free_02_block.cc +++ b/tests/multigrid/transfer_matrix_free_02_block.cc @@ -100,11 +100,9 @@ check(const unsigned int fe_degree) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); // build reference MGTransferMatrixFree transfer_ref(mg_constrained_dofs); diff --git a/tests/multigrid/transfer_matrix_free_02_block_02.cc b/tests/multigrid/transfer_matrix_free_02_block_02.cc index ed9b210c99..3d033f2227 100644 --- a/tests/multigrid/transfer_matrix_free_02_block_02.cc +++ b/tests/multigrid/transfer_matrix_free_02_block_02.cc @@ -112,12 +112,12 @@ check(const unsigned int fe_degree) const std::vector *> mgdof_ptr{&mgdof_1, &mgdof_2}; std::vector mg_constrained_dofs_vector(2); - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; for (unsigned int i = 0; i < mgdof_ptr.size(); ++i) - mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i], - dirichlet_boundary); + { + mg_constrained_dofs_vector[i].initialize(*mgdof_ptr[i]); + mg_constrained_dofs_vector[i].make_zero_boundary_constraints( + *mgdof_ptr[i], {0}); + } // build reference std::vector> transfer_ref; diff --git a/tests/multigrid/transfer_matrix_free_03.cc b/tests/multigrid/transfer_matrix_free_03.cc index 46bb7b8494..ac749fcbf0 100644 --- a/tests/multigrid/transfer_matrix_free_03.cc +++ b/tests/multigrid/transfer_matrix_free_03.cc @@ -65,11 +65,9 @@ check(const unsigned int fe_degree) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); // build reference MGTransferPrebuilt> diff --git a/tests/multigrid/transfer_matrix_free_06.cc b/tests/multigrid/transfer_matrix_free_06.cc index 29292636d0..c21af862f3 100644 --- a/tests/multigrid/transfer_matrix_free_06.cc +++ b/tests/multigrid/transfer_matrix_free_06.cc @@ -98,11 +98,9 @@ check(const unsigned int fe_degree) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); // build reference MGTransferPrebuilt> diff --git a/tests/multigrid/transfer_prebuilt_03.cc b/tests/multigrid/transfer_prebuilt_03.cc index 044bbd9ce9..a478eb2837 100644 --- a/tests/multigrid/transfer_prebuilt_03.cc +++ b/tests/multigrid/transfer_prebuilt_03.cc @@ -63,12 +63,9 @@ check_simple(const FiniteElement &fe) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - std::map *> dirichlet_boundary; - Functions::ZeroFunction homogeneous_dirichlet_bc(1); - dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); MGTransferPrebuilt> transfer(mg_constrained_dofs); transfer.build(mgdof); diff --git a/tests/multigrid/transfer_prebuilt_04.cc b/tests/multigrid/transfer_prebuilt_04.cc index d71b5a4316..38bcebdcf8 100644 --- a/tests/multigrid/transfer_prebuilt_04.cc +++ b/tests/multigrid/transfer_prebuilt_04.cc @@ -65,11 +65,9 @@ check() mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); - MGConstrainedDoFs mg_constrained_dofs; - Functions::ZeroFunction zero_function; - std::map *> dirichlet_boundary; - dirichlet_boundary[0] = &zero_function; - mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + MGConstrainedDoFs mg_constrained_dofs; + mg_constrained_dofs.initialize(mgdof); + mg_constrained_dofs.make_zero_boundary_constraints(mgdof, {0}); unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); diff --git a/tests/multigrid/transfer_system_adaptive_02.cc b/tests/multigrid/transfer_system_adaptive_02.cc index e85c3db606..7cabda4f3f 100644 --- a/tests/multigrid/transfer_system_adaptive_02.cc +++ b/tests/multigrid/transfer_system_adaptive_02.cc @@ -151,13 +151,9 @@ check(const FiniteElement &fe) for (unsigned int level = 0; level < tr.n_levels(); ++level) DoFRenumbering::component_wise(mg_dof_handler, level); - std::vector> boundary_indices(tr.n_levels()); - std::map *> dirichlet_boundary; - Functions::ZeroFunction dirichlet_bc(fe.n_components()); - dirichlet_boundary[3] = &dirichlet_bc; - MGConstrainedDoFs mg_constrained_dofs; - mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary); + mg_constrained_dofs.initialize(mg_dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(mg_dof_handler, {3}); MGTransferPrebuilt> transfer(mg_constrained_dofs); transfer.build(mg_dof_handler);