]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove deprecated MGConstrainedDoFs::initialize overload 10694/head
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 10 Jul 2020 20:20:14 +0000 (16:20 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 10 Jul 2020 20:21:11 +0000 (16:21 -0400)
50 files changed:
include/deal.II/multigrid/mg_constrained_dofs.h
tests/matrix_free/multigrid_dg_sip_01.cc
tests/matrix_free/multigrid_dg_sip_02.cc
tests/matrix_free/parallel_multigrid_02.cc
tests/matrix_free/parallel_multigrid_adaptive_01.cc
tests/matrix_free/parallel_multigrid_adaptive_02.cc
tests/matrix_free/parallel_multigrid_adaptive_03.cc
tests/matrix_free/parallel_multigrid_adaptive_04.cc
tests/matrix_free/parallel_multigrid_adaptive_05.cc
tests/matrix_free/parallel_multigrid_adaptive_06.cc
tests/matrix_free/parallel_multigrid_adaptive_06ref.cc
tests/matrix_free/parallel_multigrid_adaptive_07.cc
tests/matrix_free/parallel_multigrid_adaptive_08.cc
tests/matrix_free/parallel_multigrid_fullydistributed.cc
tests/matrix_free/parallel_multigrid_mf.cc
tests/matrix_free/parallel_multigrid_mf_02.cc
tests/mpi/multigrid_adaptive.cc
tests/mpi/multigrid_uniform.cc
tests/multigrid/constrained_dofs_01.cc
tests/multigrid/constrained_dofs_02.cc
tests/multigrid/events_01.cc
tests/multigrid/mg_coarse_01.cc
tests/multigrid/mg_output_dirichlet.cc
tests/multigrid/mg_output_neumann.cc
tests/multigrid/mg_renumbered_01.cc
tests/multigrid/mg_renumbered_03.cc
tests/multigrid/step-16-02.cc
tests/multigrid/step-16-03.cc
tests/multigrid/step-16-04.cc
tests/multigrid/step-16-05.cc
tests/multigrid/step-16-06.cc
tests/multigrid/step-16-07.cc
tests/multigrid/step-16-50-mpi-linear-operator.cc
tests/multigrid/step-16-50-mpi-smoother.cc
tests/multigrid/step-16-50-mpi.cc
tests/multigrid/step-16-50-serial.cc
tests/multigrid/step-16-bdry1.cc
tests/multigrid/step-16.cc
tests/multigrid/step-50_01.cc
tests/multigrid/transfer_05.cc
tests/multigrid/transfer_06.cc
tests/multigrid/transfer_matrix_free_01.cc
tests/multigrid/transfer_matrix_free_02.cc
tests/multigrid/transfer_matrix_free_02_block.cc
tests/multigrid/transfer_matrix_free_02_block_02.cc
tests/multigrid/transfer_matrix_free_03.cc
tests/multigrid/transfer_matrix_free_06.cc
tests/multigrid/transfer_prebuilt_03.cc
tests/multigrid/transfer_prebuilt_04.cc
tests/multigrid/transfer_system_adaptive_02.cc

index beddf94a7152a4ae875e1fafd0e9dbc1f1b86a9b..eb5e2dd90710e3d9b2a15da4c0b568bdff479671 100644 (file)
@@ -69,23 +69,6 @@ public:
   void
   initialize(const DoFHandler<dim, spacedim> &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 <int dim, int spacedim>
-  DEAL_II_DEPRECATED void
-  initialize(const DoFHandler<dim, spacedim> &dof,
-             const std::map<types::boundary_id, const Function<spacedim> *>
-               &                  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<dim, spacedim> &dof)
 }
 
 
-template <int dim, int spacedim>
-inline void
-MGConstrainedDoFs::initialize(
-  const DoFHandler<dim, spacedim> &                               dof,
-  const std::map<types::boundary_id, const Function<spacedim> *> &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 <int dim, int spacedim>
 inline void
index 46f019922637f4ef96dd1103733344537627e984..16b418521911b70e394eeeecf786b797ec02d532 100644 (file)
@@ -593,11 +593,9 @@ do_test(const DoFHandler<dim> &dof, const bool also_test_parallel = false)
     }
   mg_smoother.initialize(mg_matrices, smoother_data);
 
-  MGConstrainedDoFs                                   mg_constrained_dofs;
-  Functions::ZeroFunction<dim>                        zero_function;
-  std::map<types::boundary_id, const Function<dim> *> 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<dim, LevelMatrixType> mg_transfer(mg_matrices,
                                                  mg_constrained_dofs);
index 93bb327e3c4f1b7add25d8fafd617a5815d218fd..f515e2a59f3d694b224d41b600a0fda4314da4c4 100644 (file)
@@ -500,11 +500,9 @@ do_test(const DoFHandler<dim> &dof, const bool also_test_parallel = false)
     }
   mg_smoother.initialize(mg_matrices, smoother_data);
 
-  MGConstrainedDoFs                                   mg_constrained_dofs;
-  Functions::ZeroFunction<dim>                        zero_function;
-  std::map<types::boundary_id, const Function<dim> *> 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<dim, LevelMatrixType> mg_transfer(mg_matrices,
                                                  mg_constrained_dofs);
index 001ac71bd68e3e87a63f1b128602e32d546d0cba..502521d8a0e7e60f157290d4c0ebbb067de8cd8d 100644 (file)
@@ -116,7 +116,8 @@ do_test(const DoFHandler<dim> &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<dim> mapping(fe_degree + 1);
 
index 989d86af05843e91ce85cdd1274a2f0591275771..112bdbcee09135af4ed10a367ea38fda6b913057 100644 (file)
@@ -517,7 +517,8 @@ do_test(const DoFHandler<dim> &dof)
   Functions::ZeroFunction<dim>                        zero_function;
   std::map<types::boundary_id, const Function<dim> *> 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<dim>                                          mapping(fe_degree + 1);
   LaplaceOperator<dim, fe_degree, n_q_points_1d, number> fine_matrix;
index 5d5479275a3cfd333ca6fd23af48d08b14ce2a14..ab5be7e8286173f505f3d6570d557af9d6bbd776 100644 (file)
@@ -154,7 +154,8 @@ do_test(const DoFHandler<dim> &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<dim> mapping(fe_degree + 1);
 
index 578fad89ed524c9b42e53b926355538b4b339a91..69a95e3863142ccc0b65097071b1d596dab35d40 100644 (file)
@@ -525,7 +525,8 @@ do_test(const DoFHandler<dim> &dof, const bool threaded)
   Functions::ZeroFunction<dim>                        zero_function;
   std::map<types::boundary_id, const Function<dim> *> 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<dim>                                          mapping(fe_degree + 1);
   LaplaceOperator<dim, fe_degree, n_q_points_1d, double> fine_matrix;
index 76a6127fde07059d9e9a0930d4b2011accf0d0fa..f4ff27044fa059bb1f179c7972946109ad560894 100644 (file)
@@ -154,7 +154,8 @@ do_test(const DoFHandler<dim> &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<dim> mapping(fe_degree + 1);
 
index 707c0c5f3a343f8b3f045efeaf8d1e462f88f2d8..10af8b4820f6172b1c77ebd2e4b22ea86a14aafe 100644 (file)
@@ -522,7 +522,8 @@ do_test(const DoFHandler<dim> &dof, const bool threaded)
   Functions::ZeroFunction<dim>                        zero_function;
   std::map<types::boundary_id, const Function<dim> *> 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<dim>                                          mapping(fe_degree + 1);
   LaplaceOperator<dim, fe_degree, n_q_points_1d, double> fine_matrix;
index c7035df983cb9e9b085e3527ccb8b7755cb195e9..b17a08d117b409406355a9e331101afc4533a41c 100644 (file)
@@ -239,7 +239,8 @@ do_test(const DoFHandler<dim> &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<dim> mapping(fe_degree + 1);
 
index 27c37551199c80be71561e9e14c2f009291f58e3..f83983f14977d57407a3b612cd334d428f6ed0db 100644 (file)
@@ -155,7 +155,8 @@ do_test(const DoFHandler<dim> &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<dim> mapping(fe_degree + 1);
 
index 90413c81fbaeebf9f530a8f56b692e9ccd13678a..d58cbb863a4e92a448a15b533bc234f7e07aab9f 100644 (file)
@@ -316,7 +316,10 @@ do_test(const std::vector<const DoFHandler<dim> *> &dof)
   // level constraints:
   std::vector<MGConstrainedDoFs> 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<dim,
index 156da67e867b6532a3b239e51892af43dd8c1a89..972cf28d9b7bb20133540afb8781e32a8d47fbb1 100644 (file)
@@ -236,7 +236,8 @@ do_test(const DoFHandler<dim> &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<dim> mapping(fe_degree + 1);
 
index 213d3f75551f5be4a953af6293fc28ad9c170f6f..cd7f36afdcec019acaea91f48c7769636fccf1c3 100644 (file)
@@ -377,11 +377,9 @@ do_test(const DoFHandler<dim> &dof)
       mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level);
     }
 
-  MGConstrainedDoFs                                   mg_constrained_dofs;
-  Functions::ZeroFunction<dim>                        zero_function;
-  std::map<types::boundary_id, const Function<dim> *> 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<dim, LevelMatrixType> mg_transfer(mg_matrices,
                                                          mg_constrained_dofs);
index 8fd453e8ca52159abaac1a1dd5eafda9ce2c185f..8943074e6818272d55dfb8d47c57c4d12a159553 100644 (file)
@@ -373,11 +373,9 @@ do_test(const DoFHandler<dim> &dof)
       mg_matrices[level].initialize(mapping, dof, dirichlet_boundaries, level);
     }
 
-  MGConstrainedDoFs                                   mg_constrained_dofs;
-  Functions::ZeroFunction<dim>                        zero_function;
-  std::map<types::boundary_id, const Function<dim> *> 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<dim, LevelMatrixType> mg_transfer(mg_matrices,
                                                          mg_constrained_dofs);
index 11c4947966fda867fbb08895011a9193c08a7bab..31f4362ca9e8ea5ec313a8d33f2774ea7119d6f1 100644 (file)
@@ -135,7 +135,8 @@ do_test(const DoFHandler<dim> &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,
index 8f688b401327b82d6bd024fb3812fead0959dc06..abf722e9207a44506bb5f1ac187d62ffbd636f7e 100644 (file)
@@ -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();
 
index ccd1e44190aa5b7305a40141f4b5c01296ffb052..07d1818050cd652c6bf8c8d8bc62c6ca3f56e0e7 100644 (file)
@@ -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();
 
index 61b24c402d66f5c21ca449cb75f7b44063456bc2..0a3797a5c046852279ece5db5c857d56e61139a5 100644 (file)
@@ -124,20 +124,16 @@ check_fe(FiniteElement<dim> &fe)
         cell->update_cell_dof_indices_cache();
       }
 
-    std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-    Functions::ZeroFunction<dim> 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<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-  Functions::ZeroFunction<dim> 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)
index 1165f8251d9693fad61dac14958d0b6b9d8e0abb..1b83f1c00fa4c8911cfd7862ef8616b98ed15097 100644 (file)
@@ -185,20 +185,15 @@ check_fe(FiniteElement<dim> &fe)
         cell->update_cell_dof_indices_cache();
       }
 
-    std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-    Functions::ZeroFunction<dim> 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<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-  Functions::ZeroFunction<dim> 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)
index 957a1fec17a372c477a5b354909681f6a22b3ff6..02bd6b848668281149ee86410305846dec526420 100644 (file)
@@ -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();
 
index ca7c5da2a8d5cc4a96d31a8e1d6256030651434f..b344975e965cd1cde9e038eb3ab958738c9591ed 100644 (file)
@@ -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();
 
index a44c0b93ebb4b2eed229c53d2a8148537498f718..8de985f29da22d8591ce9068215475e023f5e808 100644 (file)
@@ -204,10 +204,6 @@ check_simple(const FiniteElement<dim> &fe)
 
   Triangulation<dim> tr(Triangulation<dim>::limit_level_difference_at_vertices);
   GridGenerator::hyper_cube(tr, -1, 1);
-  std::map<types::boundary_id, const Function<dim> *>
-                               dirichlet_boundary_functions;
-  Functions::ZeroFunction<dim> 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<dim> &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<Vector<double>> transfer(mg_constrained_dofs);
   transfer.build(mgdof);
index 4b88e7900a38a10f4763cb4e3343c65050149924..93c8e69289df1aa43b36dd233f7052165cd1b4ce 100644 (file)
@@ -204,8 +204,6 @@ check_simple(const FiniteElement<dim> &fe)
 
   Triangulation<dim> tr(Triangulation<dim>::limit_level_difference_at_vertices);
   GridGenerator::hyper_cube(tr, -1, 1);
-  std::map<types::boundary_id, const Function<dim> *>
-    dirichlet_boundary_functions;
 
   tr.refine_global(1);
   refine_mesh(tr);
@@ -232,11 +230,10 @@ check_simple(const FiniteElement<dim> &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<Vector<double>> transfer(mg_constrained_dofs);
   transfer.build(mgdof);
index bddb63a5ae7841e97049641d44ce30bf170fc1e7..c15107f1d6ac5abbe3a9359955911c482a822435 100644 (file)
@@ -339,10 +339,6 @@ template <int dim>
 void
 LaplaceProblem<dim>::test()
 {
-  std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-  Functions::ZeroFunction<dim> 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<dim>::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<Vector<double>> mg_transfer(mg_constrained_dofs);
   mg_transfer.build(mg_dof_handler);
index 91ca55d24b13e524708aa1f3456cc5e2aa7019ae..60e3605791fc317e51a0809781057fb3eea24704 100644 (file)
@@ -348,15 +348,13 @@ template <int dim>
 void
 LaplaceProblem<dim>::test()
 {
-  std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-  Functions::ZeroFunction<dim> 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<Vector<double>> mg_transfer(mg_constrained_dofs);
   mg_transfer.build(mg_dof_handler);
index 0a70e6bc6c20f86bb1d25d0983fbe31e12878d64..1ccc1c8c8f0e58a3e1a6173b44232157472137a0 100644 (file)
@@ -268,7 +268,8 @@ LaplaceProblem<dim>::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);
index 2c1bd0a1d76a0bb914cd2b41d11be52d3f99f538..8ee966bf5c9abb9a1f4d6872f68e108451aa193b 100644 (file)
@@ -187,7 +187,8 @@ LaplaceProblem<dim>::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);
index 9a2f1dad7b0227771a266c8aac78b2ff647fe81a..832ba2c1a41df16ca6d7cd9a17e7617a987402a3 100644 (file)
@@ -191,7 +191,8 @@ LaplaceProblem<dim>::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);
index 33d64c13c43a8768c2e1164655b7f5bfd87ae3c6..9319d1b6876840fc871d5645e22359d7261af24a 100644 (file)
@@ -192,7 +192,8 @@ LaplaceProblem<dim>::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);
index a9813fdf517c7616dfe4e5bdcaa070c48f7fc974..6f4ccece2e25ef1969547ac5eeab31cdededd1fe 100644 (file)
@@ -192,7 +192,8 @@ LaplaceProblem<dim>::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);
index af8efc35ebbbbcee3b8cf6ba1d3e38af050b3469..e39c49c16592e837d93b6e132372aa7a23e89ada 100644 (file)
@@ -193,7 +193,8 @@ LaplaceProblem<dim>::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);
index 8b06521f6080ea0eb0b47b817a5d427f06b58e1a..8304a8f551b295087147e7c3d48c4d6220572d0d 100644 (file)
@@ -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();
index 4e6fe6a3c3a85de2115e114d5715fbf27072642d..3c3a6caad315554a5aff40c2cf73690f83058892 100644 (file)
@@ -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();
 
index d6ed95de0f01afd37086f2cac901c216d72704e2..085f191062d4e50e3db701a8c47d4b222948a84c 100644 (file)
@@ -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();
index 6e7b0a4f3b3afaabceaec6120c403a5fbde352c2..cd4d0e0559845f610297c6d40d3bf2c376f09a3d 100644 (file)
@@ -191,7 +191,8 @@ LaplaceProblem<dim>::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);
index 74bed1ed7e6b4aba4dd738dfd1e27007fc410a76..9b0e7ac9257a859c7eebc3675ab3662e98eac4b6 100644 (file)
@@ -269,7 +269,8 @@ LaplaceProblem<dim>::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);
index 09bdb58b33fdc0f5c9fd3924ea36aceb4ed0c2ce..679697373fd7e9fc4017eeace53630988faf67d3 100644 (file)
@@ -193,7 +193,8 @@ LaplaceProblem<dim>::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);
index a7493242b5d729e111c2e8a83deec1094236f665..2d0b542ed4dc1f5c884f9671beb9c9de0da2967f 100644 (file)
@@ -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();
 
index a720505812b291c55de1ece076debe93892069ec..94f0491a0135cd494e9ac1da1cf4050360d18455 100644 (file)
@@ -105,11 +105,9 @@ check(const unsigned int fe_degree)
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<dim, Number> transfer_ref(mg_constrained_dofs);
index 3ceceec179697f0406d809d6c14f0905ec6c4d51..4fe947f3c6c2f539ffd35b33ce7ba95389838212 100644 (file)
@@ -118,12 +118,12 @@ check(const unsigned int fe_degree)
       const std::vector<const DoFHandler<dim> *> mgdof_ptr{&mgdof_1, &mgdof_2};
 
       std::vector<MGConstrainedDoFs> mg_constrained_dofs_vector(2);
-      Functions::ZeroFunction<dim>   zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<MGTransferMatrixFree<dim, Number>> transfer_ref;
index bc013f198fc10aaab8be69c6e02ba7f499611dcf..2a58d38fc1de77bd421ca84a9946523108a33d94 100644 (file)
@@ -67,11 +67,9 @@ check(const unsigned int fe_degree)
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<LinearAlgebra::distributed::Vector<double>>
index 5387acc103812de8b7a54ad509d8739c61750595..35bc581031a4f0ecb860dc51362951e735ea4355 100644 (file)
@@ -96,11 +96,9 @@ check(const unsigned int fe_degree)
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<LinearAlgebra::distributed::Vector<double>>
index 11058c2c17d5cbdcfb8a946503d798583755fc2a..d898a4bc68b2d57e09563ff9687514d7acf55585 100644 (file)
@@ -100,11 +100,9 @@ check(const unsigned int fe_degree)
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<dim, Number> transfer_ref(mg_constrained_dofs);
index ed9b210c9969278d8b86ad23a12258ff0be9e35f..3d033f2227dfd49f87a2cdc085586bbe9e65e268 100644 (file)
@@ -112,12 +112,12 @@ check(const unsigned int fe_degree)
       const std::vector<const DoFHandler<dim> *> mgdof_ptr{&mgdof_1, &mgdof_2};
 
       std::vector<MGConstrainedDoFs> mg_constrained_dofs_vector(2);
-      Functions::ZeroFunction<dim>   zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<MGTransferMatrixFree<dim, Number>> transfer_ref;
index 46bb7b84945c46fc1665edf045d096f037a0543c..ac749fcbf066aa35b22460f9754da8d80722bd1b 100644 (file)
@@ -65,11 +65,9 @@ check(const unsigned int fe_degree)
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<LinearAlgebra::distributed::Vector<double>>
index 29292636d0f899eb00c063c50bbba4e77d7aedab..c21af862f33d8b11a8015fbe46389c254aeed649 100644 (file)
@@ -98,11 +98,9 @@ check(const unsigned int fe_degree)
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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<LinearAlgebra::distributed::Vector<double>>
index 044bbd9ce9d0857093d9c0ed1dc88b6ced16b33f..a478eb2837c2dc55f4b00fc5c6d58dc2c40c8e73 100644 (file)
@@ -63,12 +63,9 @@ check_simple(const FiniteElement<dim> &fe)
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
 
-  std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-  Functions::ZeroFunction<dim> 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<Vector<double>> transfer(mg_constrained_dofs);
   transfer.build(mgdof);
index d71b5a4316d1743f8249c99ed3328f5f5fa7a6c0..38bcebdcf8cdc7b69734576f65a55d8a8106d5af 100644 (file)
@@ -65,11 +65,9 @@ check()
       mgdof.distribute_dofs(fe);
       mgdof.distribute_mg_dofs();
 
-      MGConstrainedDoFs                                   mg_constrained_dofs;
-      Functions::ZeroFunction<dim>                        zero_function;
-      std::map<types::boundary_id, const Function<dim> *> 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);
 
index e85c3db6063b169c81d966309b8824cc3d77d44f..7cabda4f3fda70ead494062a97e51f381e8fdc2c 100644 (file)
@@ -151,13 +151,9 @@ check(const FiniteElement<dim> &fe)
   for (unsigned int level = 0; level < tr.n_levels(); ++level)
     DoFRenumbering::component_wise(mg_dof_handler, level);
 
-  std::vector<std::set<unsigned int>> boundary_indices(tr.n_levels());
-  std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
-  Functions::ZeroFunction<dim> 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<Vector<double>> transfer(mg_constrained_dofs);
   transfer.build(mg_dof_handler);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.