]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Multigrid Transfer cleanup
authorTimo Heister <timo.heister@gmail.com>
Thu, 9 Jan 2020 22:53:25 +0000 (17:53 -0500)
committerTimo Heister <timo.heister@gmail.com>
Sat, 11 Jan 2020 16:28:32 +0000 (11:28 -0500)
- rename mg_dof argument to dof_handler everywhere
- deprecate build_matrices() in favor of build() in MGTransferSelect,
MGTransferComponentBase, MGTransferPrebuilt, ... to be identical to
MGTransferMatrixFree
- remove redundant dof,mg_dof parameters

94 files changed:
examples/step-16/step-16.cc
examples/step-16b/step-16b.cc
examples/step-39/step-39.cc
examples/step-56/step-56.cc
examples/step-63/step-63.cc
include/deal.II/multigrid/mg_transfer.h
include/deal.II/multigrid/mg_transfer.templates.h
include/deal.II/multigrid/mg_transfer_block.h
include/deal.II/multigrid/mg_transfer_block.templates.h
include/deal.II/multigrid/mg_transfer_component.h
include/deal.II/multigrid/mg_transfer_internal.h
include/deal.II/multigrid/mg_transfer_matrix_free.h
include/deal.II/multigrid/multigrid.h
source/multigrid/mg_transfer_block.cc
source/multigrid/mg_transfer_block.inst.in
source/multigrid/mg_transfer_component.cc
source/multigrid/mg_transfer_component.inst.in
source/multigrid/mg_transfer_internal.cc
source/multigrid/mg_transfer_matrix_free.cc
source/multigrid/mg_transfer_prebuilt.cc
source/multigrid/mg_transfer_prebuilt.inst.in
tests/bits/step-16.cc
tests/examples/step-56.cc
tests/fe/transfer.cc
tests/matrix_free/multigrid_dg_periodic.cc
tests/matrix_free/parallel_multigrid.cc
tests/matrix_free/parallel_multigrid_adaptive_01.cc
tests/matrix_free/step-37.cc
tests/meshworker/step-50-mesh_loop.cc
tests/mpi/multigrid_adaptive.cc
tests/mpi/multigrid_uniform.cc
tests/mpi/step-39-block.cc
tests/mpi/step-39.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-39-02.cc
tests/multigrid/step-39-02a.cc
tests/multigrid/step-39-03.cc
tests/multigrid/step-39.cc
tests/multigrid/step-50_01.cc
tests/multigrid/step-50_02.cc
tests/multigrid/transfer_01.cc
tests/multigrid/transfer_02.cc
tests/multigrid/transfer_03.cc
tests/multigrid/transfer_04.cc
tests/multigrid/transfer_04a.cc
tests/multigrid/transfer_04b.cc
tests/multigrid/transfer_block.cc
tests/multigrid/transfer_block_select.cc
tests/multigrid/transfer_compare_01.cc
tests/multigrid/transfer_matrix_free_01.cc
tests/multigrid/transfer_matrix_free_02.cc
tests/multigrid/transfer_matrix_free_03.cc
tests/multigrid/transfer_matrix_free_04.cc
tests/multigrid/transfer_matrix_free_05.cc
tests/multigrid/transfer_matrix_free_06.cc
tests/multigrid/transfer_matrix_free_07.cc
tests/multigrid/transfer_matrix_free_11.cc
tests/multigrid/transfer_prebuilt_01.cc
tests/multigrid/transfer_prebuilt_02.cc
tests/multigrid/transfer_prebuilt_03.cc
tests/multigrid/transfer_prebuilt_04.cc
tests/multigrid/transfer_select.cc
tests/multigrid/transfer_system_01.cc
tests/multigrid/transfer_system_02.cc
tests/multigrid/transfer_system_03.cc
tests/multigrid/transfer_system_04.cc
tests/multigrid/transfer_system_05.cc
tests/multigrid/transfer_system_adaptive_01.cc
tests/multigrid/transfer_system_adaptive_02.cc
tests/multigrid/transfer_system_adaptive_03.cc
tests/multigrid/transfer_system_adaptive_04.cc
tests/multigrid/transfer_system_adaptive_05.cc
tests/multigrid/transfer_system_adaptive_06.cc
tests/multigrid/transfer_system_adaptive_07.cc
tests/multigrid/transfer_system_adaptive_08.cc
tests/multigrid/transfer_system_adaptive_09.cc
tests/trilinos/mg_transfer_prebuilt_01.cc

index 55d2074d89ef57f2b654bbc3f0b9ad209a6780c9..c5a850d50082570341fa49bb1ee6f501392154a9 100644 (file)
@@ -523,7 +523,7 @@ namespace Step16
   void LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrices[0]);
index 3ce9c5d7d9003f8e41e874ddc8cbdfd3c91615b3..4c368a89ac04345f8591499cc56564c86033de47 100644 (file)
@@ -474,7 +474,7 @@ namespace Step16
   void LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrices[0]);
index 4cdb3b1887dd4ccfd00de0c21f762da83f924f6c..762c95a114e94ddf2a7703cdaca569acd95a5db5 100644 (file)
@@ -722,7 +722,7 @@ namespace Step39
     // preconditioner. First, we need transfer between grid levels. The object
     // we are using here generates sparse matrices for these transfers.
     MGTransferPrebuilt<Vector<double>> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     // Then, we need an exact solver for the matrix on the coarsest level.
     FullMatrix<double> coarse_matrix;
index 81126b1614216ba1ea493e2815babb1941d0c46b..3073d1419cebc67d58758594dee7a5e26e355cef 100644 (file)
@@ -880,7 +880,7 @@ namespace Step56
 
         // Transfer operators between levels
         MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-        mg_transfer.build_matrices(velocity_dof_handler);
+        mg_transfer.build(velocity_dof_handler);
 
         // Setup coarse grid solver
         FullMatrix<double> coarse_matrix;
index fe35743432ab0829ec8ec3f9d6fa13506ef6b0dc..e86dc5734d35d71ccc17ac060c681904e7acffd7 100644 (file)
@@ -1060,7 +1060,7 @@ namespace Step63
 
     using Transfer = MGTransferPrebuilt<Vector<double>>;
     Transfer mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrices[0]);
index 518d2441459cab4eaba4dea86cdff783c7611dbc..c40553aac320c9411e21088fe859ab69638b500c 100644 (file)
@@ -293,7 +293,7 @@ public:
    */
   template <int dim, class InVector, int spacedim>
   void
-  copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+  copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
              MGLevelObject<VectorType> &      dst,
              const InVector &                 src) const;
 
@@ -306,7 +306,7 @@ public:
    */
   template <int dim, class OutVector, int spacedim>
   void
-  copy_from_mg(const DoFHandler<dim, spacedim> &mg_dof,
+  copy_from_mg(const DoFHandler<dim, spacedim> &dof_handler,
                OutVector &                      dst,
                const MGLevelObject<VectorType> &src) const;
 
@@ -317,7 +317,7 @@ public:
    */
   template <int dim, class OutVector, int spacedim>
   void
-  copy_from_mg_add(const DoFHandler<dim, spacedim> &mg_dof,
+  copy_from_mg_add(const DoFHandler<dim, spacedim> &dof_handler,
                    OutVector &                      dst,
                    const MGLevelObject<VectorType> &src) const;
 
@@ -357,7 +357,8 @@ protected:
    */
   template <int dim, int spacedim>
   void
-  fill_and_communicate_copy_indices(const DoFHandler<dim, spacedim> &mg_dof);
+  fill_and_communicate_copy_indices(
+    const DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Sizes of the multi-level vectors.
@@ -450,7 +451,7 @@ public:
    */
   template <int dim, typename Number2, int spacedim>
   void
-  copy_to_mg(const DoFHandler<dim, spacedim> &                          mg_dof,
+  copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
              MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
              const LinearAlgebra::distributed::Vector<Number2> &src) const;
 
@@ -464,8 +465,8 @@ public:
   template <int dim, typename Number2, int spacedim>
   void
   copy_from_mg(
-    const DoFHandler<dim, spacedim> &                                mg_dof,
-    LinearAlgebra::distributed::Vector<Number2> &                    dst,
+    const DoFHandler<dim, spacedim> &            dof_handler,
+    LinearAlgebra::distributed::Vector<Number2> &dst,
     const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const;
 
   /**
@@ -476,8 +477,8 @@ public:
   template <int dim, typename Number2, int spacedim>
   void
   copy_from_mg_add(
-    const DoFHandler<dim, spacedim> &                                mg_dof,
-    LinearAlgebra::distributed::Vector<Number2> &                    dst,
+    const DoFHandler<dim, spacedim> &            dof_handler,
+    LinearAlgebra::distributed::Vector<Number2> &dst,
     const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const;
 
   /**
@@ -517,7 +518,7 @@ protected:
    */
   template <int dim, typename Number2, int spacedim>
   void
-  copy_to_mg(const DoFHandler<dim, spacedim> &                          mg_dof,
+  copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
              MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
              const LinearAlgebra::distributed::Vector<Number2> &        src,
              const bool solution_transfer) const;
@@ -527,7 +528,8 @@ protected:
    */
   template <int dim, int spacedim>
   void
-  fill_and_communicate_copy_indices(const DoFHandler<dim, spacedim> &mg_dof);
+  fill_and_communicate_copy_indices(
+    const DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Sizes of the multi-level vectors.
@@ -681,13 +683,13 @@ public:
   virtual ~MGTransferPrebuilt() override = default;
 
   /**
-   * Initialize the constraints to be used in build_matrices().
+   * Initialize the constraints to be used in build().
    */
   void
   initialize_constraints(const MGConstrainedDoFs &mg_constrained_dofs);
 
   /**
-   * Initialize the constraints to be used in build_matrices().
+   * Initialize the constraints to be used in build().
    *
    * @deprecated @p constraints is unused.
    */
@@ -702,12 +704,23 @@ public:
   void
   clear();
 
+  /**
+   * Actually build the information required for the transfer operations. Needs
+   * to be called before prolongate() or restrict_and_add() can be used.
+   */
+  template <int dim, int spacedim>
+  void
+  build(const DoFHandler<dim, spacedim> &dof_handler);
+
   /**
    * Actually build the prolongation matrices for each level.
+   *
+   * @deprecated use build() instead.
    */
+  DEAL_II_DEPRECATED
   template <int dim, int spacedim>
   void
-  build_matrices(const DoFHandler<dim, spacedim> &mg_dof);
+  build_matrices(const DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Prolongate a vector from level <tt>to_level-1</tt> to level
@@ -751,7 +764,7 @@ public:
   DeclException0(ExcNoProlongation);
 
   /**
-   * You have to call build_matrices() before using this object.
+   * You have to call build() before using this object.
    */
   DeclException0(ExcMatricesNotBuilt);
 
index a892118498fd59c24cb33890b0747431c708590a..7ed36eef19ccb85344687ca3c63d18d351b82351 100644 (file)
@@ -56,13 +56,13 @@ namespace internal
      */
     template <int dim, typename number, int spacedim>
     void
-    reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+    reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
                   const std::vector<unsigned int> &,
                   MGLevelObject<dealii::Vector<number>> &v)
     {
       for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
         {
-          unsigned int n = mg_dof.n_dofs(level);
+          unsigned int n = dof_handler.n_dofs(level);
           v[level].reinit(n);
         }
     }
@@ -75,11 +75,11 @@ namespace internal
      */
     template <int dim, typename number, int spacedim>
     void
-    reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+    reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
                   std::vector<unsigned int>                target_component,
                   MGLevelObject<BlockVector<number>> &     v)
     {
-      const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+      const unsigned int n_blocks = dof_handler.get_fe().n_blocks();
       if (target_component.size() == 0)
         {
           target_component.resize(n_blocks);
@@ -93,9 +93,9 @@ namespace internal
       const unsigned int n_target_blocks = max_block + 1;
 
       std::vector<std::vector<types::global_dof_index>> ndofs(
-        mg_dof.get_triangulation().n_levels(),
+        dof_handler.get_triangulation().n_levels(),
         std::vector<types::global_dof_index>(n_target_blocks));
-      MGTools::count_dofs_per_block(mg_dof, ndofs, target_component);
+      MGTools::count_dofs_per_block(dof_handler, ndofs, target_component);
 
       for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
         {
@@ -115,13 +115,13 @@ namespace internal
      */
     template <int dim, int spacedim>
     void
-    reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+    reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
                   const std::vector<unsigned int> &,
                   MGLevelObject<TrilinosWrappers::MPI::Vector> &v)
     {
       const dealii::parallel::TriangulationBase<dim, spacedim> *tria =
         (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-          &mg_dof.get_triangulation()));
+          &dof_handler.get_triangulation()));
       AssertThrow(
         tria != nullptr,
         ExcMessage(
@@ -129,7 +129,7 @@ namespace internal
 
       for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
         {
-          v[level].reinit(mg_dof.locally_owned_mg_dofs(level),
+          v[level].reinit(dof_handler.locally_owned_mg_dofs(level),
                           tria->get_communicator());
         }
     }
@@ -143,13 +143,13 @@ namespace internal
      */
     template <int dim, int spacedim>
     void
-    reinit_vector(const dealii::DoFHandler<dim, spacedim> &mg_dof,
+    reinit_vector(const dealii::DoFHandler<dim, spacedim> &dof_handler,
                   const std::vector<unsigned int> &,
                   MGLevelObject<PETScWrappers::MPI::Vector> &v)
     {
       const dealii::parallel::TriangulationBase<dim, spacedim> *tria =
         (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-          &mg_dof.get_triangulation()));
+          &dof_handler.get_triangulation()));
       AssertThrow(
         tria != nullptr,
         ExcMessage(
@@ -157,7 +157,7 @@ namespace internal
 
       for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
         {
-          v[level].reinit(mg_dof.locally_owned_mg_dofs(level),
+          v[level].reinit(dof_handler.locally_owned_mg_dofs(level),
                           tria->get_communicator());
         }
     }
@@ -206,16 +206,14 @@ template <typename VectorType>
 template <int dim, class InVector, int spacedim>
 void
 MGLevelGlobalTransfer<VectorType>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &mg_dof_handler,
+  const DoFHandler<dim, spacedim> &dof_handler,
   MGLevelObject<VectorType> &      dst,
   const InVector &                 src) const
 {
   AssertIndexRange(dst.max_level(),
-                   mg_dof_handler.get_triangulation().n_global_levels());
+                   dof_handler.get_triangulation().n_global_levels());
   AssertIndexRange(dst.min_level(), dst.max_level() + 1);
-  internal::MGTransfer::reinit_vector(mg_dof_handler,
-                                      component_to_block_map,
-                                      dst);
+  internal::MGTransfer::reinit_vector(dof_handler, component_to_block_map, dst);
 #ifdef DEBUG_OUTPUT
   std::cout << "copy_to_mg src " << src.l2_norm() << std::endl;
   int ierr = MPI_Barrier(MPI_COMM_WORLD);
@@ -277,13 +275,13 @@ template <typename VectorType>
 template <int dim, class OutVector, int spacedim>
 void
 MGLevelGlobalTransfer<VectorType>::copy_from_mg(
-  const DoFHandler<dim, spacedim> &mg_dof_handler,
+  const DoFHandler<dim, spacedim> &dof_handler,
   OutVector &                      dst,
   const MGLevelObject<VectorType> &src) const
 {
-  (void)mg_dof_handler;
+  (void)dof_handler;
   AssertIndexRange(src.max_level(),
-                   mg_dof_handler.get_triangulation().n_global_levels());
+                   dof_handler.get_triangulation().n_global_levels());
   AssertIndexRange(src.min_level(), src.max_level() + 1);
   if (perform_plain_copy)
     {
@@ -351,7 +349,7 @@ template <typename VectorType>
 template <int dim, class OutVector, int spacedim>
 void
 MGLevelGlobalTransfer<VectorType>::copy_from_mg_add(
-  const DoFHandler<dim, spacedim> & /*mg_dof_handler*/,
+  const DoFHandler<dim, spacedim> & /*dof_handler*/,
   OutVector &                      dst,
   const MGLevelObject<VectorType> &src) const
 {
@@ -400,11 +398,11 @@ template <typename Number>
 template <int dim, typename Number2, int spacedim>
 void
 MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &                          mg_dof_handler,
+  const DoFHandler<dim, spacedim> &                          dof_handler,
   MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
   const LinearAlgebra::distributed::Vector<Number2> &        src) const
 {
-  copy_to_mg(mg_dof_handler, dst, src, false);
+  copy_to_mg(dof_handler, dst, src, false);
 }
 
 
@@ -412,7 +410,7 @@ template <typename Number>
 template <int dim, typename Number2, int spacedim>
 void
 MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &                          mg_dof_handler,
+  const DoFHandler<dim, spacedim> &                          dof_handler,
   MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
   const LinearAlgebra::distributed::Vector<Number2> &        src,
   const bool solution_transfer) const
@@ -425,29 +423,29 @@ MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_to_mg(
     solution_transfer ? solution_copy_indices_level_mine :
                         copy_indices_level_mine;
 
-  (void)mg_dof_handler;
+  (void)dof_handler;
 
   AssertIndexRange(dst.max_level(),
-                   mg_dof_handler.get_triangulation().n_global_levels());
+                   dof_handler.get_triangulation().n_global_levels());
   AssertIndexRange(dst.min_level(), dst.max_level() + 1);
 
   for (unsigned int level = dst.min_level(); level <= dst.max_level(); ++level)
-    if (dst[level].size() != mg_dof_handler.n_dofs(level) ||
+    if (dst[level].size() != dof_handler.n_dofs(level) ||
         dst[level].local_size() !=
-          mg_dof_handler.locally_owned_mg_dofs(level).n_elements())
+          dof_handler.locally_owned_mg_dofs(level).n_elements())
       {
         // In case a ghosted level vector has been initialized, we can simply
         // use that as a template for the vector partitioning. If not, we
         // resort to the locally owned range of the dof handler.
         if (level <= ghosted_level_vector.max_level() &&
-            ghosted_level_vector[level].size() == mg_dof_handler.n_dofs(level))
+            ghosted_level_vector[level].size() == dof_handler.n_dofs(level))
           dst[level].reinit(ghosted_level_vector[level], false);
         else
           {
             const parallel::TriangulationBase<dim, spacedim> *tria =
               (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-                &mg_dof_handler.get_triangulation()));
-            dst[level].reinit(mg_dof_handler.locally_owned_mg_dofs(level),
+                &dof_handler.get_triangulation()));
+            dst[level].reinit(dof_handler.locally_owned_mg_dofs(level),
                               tria != nullptr ? tria->get_communicator() :
                                                 MPI_COMM_SELF);
           }
@@ -518,13 +516,13 @@ template <typename Number>
 template <int dim, typename Number2, int spacedim>
 void
 MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::copy_from_mg(
-  const DoFHandler<dim, spacedim> &            mg_dof_handler,
-  LinearAlgebra::distributed::Vector<Number2> &dst,
+  const DoFHandler<dim, spacedim> &                                dof_handler,
+  LinearAlgebra::distributed::Vector<Number2> &                    dst,
   const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const
 {
-  (void)mg_dof_handler;
+  (void)dof_handler;
   AssertIndexRange(src.max_level(),
-                   mg_dof_handler.get_triangulation().n_global_levels());
+                   dof_handler.get_triangulation().n_global_levels());
   AssertIndexRange(src.min_level(), src.max_level() + 1);
   if (perform_plain_copy)
     {
@@ -593,7 +591,7 @@ template <int dim, typename Number2, int spacedim>
 void
 MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::
   copy_from_mg_add(
-    const DoFHandler<dim, spacedim> & /*mg_dof_handler*/,
+    const DoFHandler<dim, spacedim> & /*dof_handler*/,
     LinearAlgebra::distributed::Vector<Number2> &                    dst,
     const MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &src) const
 {
index a6013123672e7d393cac79e471d82a2466e2b792..9ebc8fea590fa9fdd1c7171ceb1198aff6938358 100644 (file)
@@ -99,6 +99,20 @@ protected:
    */
   template <int dim, int spacedim>
   void
+  build(const DoFHandler<dim, spacedim> &dof_handler);
+
+  /**
+   * Actually build the prolongation matrices for each level.
+   *
+   * This function is only called by derived classes. These can also set the
+   * member variables #selected and others to restrict the transfer matrices
+   * to certain blocks.
+   *
+   * @deprecated Use build() instead.
+   */
+  DEAL_II_DEPRECATED
+  template <int dim, int spacedim>
+  void
   build_matrices(const DoFHandler<dim, spacedim> &dof,
                  const DoFHandler<dim, spacedim> &mg_dof);
 
@@ -143,7 +157,7 @@ protected:
   std::vector<std::vector<types::global_dof_index>> mg_block_start;
 
   /**
-   * Call build_matrices() function first.
+   * Call build() function first.
    */
   DeclException0(ExcMatricesNotBuilt);
 
@@ -225,6 +239,20 @@ public:
    */
   template <int dim, int spacedim>
   void
+  build(const DoFHandler<dim, spacedim> &dof_handler,
+        const std::vector<bool> &        selected);
+
+  /**
+   * Build the prolongation matrices for each level.
+   *
+   * This function is a front-end for the same function in
+   * MGTransferBlockBase.
+   *
+   * @deprecated Use the build() function instead.
+   */
+  DEAL_II_DEPRECATED
+  template <int dim, int spacedim>
+  void
   build_matrices(const DoFHandler<dim, spacedim> &dof,
                  const DoFHandler<dim, spacedim> &mg_dof,
                  const std::vector<bool> &        selected);
@@ -252,7 +280,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_to_mg(const DoFHandler<dim, spacedim> &   mg_dof,
+  copy_to_mg(const DoFHandler<dim, spacedim> &   dof_handler,
              MGLevelObject<BlockVector<number>> &dst,
              const BlockVector<number2> &        src) const;
 
@@ -264,7 +292,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_from_mg(const DoFHandler<dim, spacedim> &         mg_dof,
+  copy_from_mg(const DoFHandler<dim, spacedim> &         dof_handler,
                BlockVector<number2> &                    dst,
                const MGLevelObject<BlockVector<number>> &src) const;
 
@@ -275,7 +303,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_from_mg_add(const DoFHandler<dim, spacedim> &         mg_dof,
+  copy_from_mg_add(const DoFHandler<dim, spacedim> &         dof_handler,
                    BlockVector<number2> &                    dst,
                    const MGLevelObject<BlockVector<number>> &src) const;
 
@@ -346,12 +374,26 @@ public:
    * This function is a front-end for the same function in
    * MGTransferBlockBase.
    *
-   * @arg selected: Number of the block of the global vector to be copied from
+   * @param dof_handler The DoFHandler to use.
+   * @param selected Number of the block for which the transfer matrices
+   * should be built.
+   */
+  template <int dim, int spacedim>
+  void
+  build(const DoFHandler<dim, spacedim> &dof_handler, unsigned int selected);
+
+  /**
+   * Actually build the prolongation matrices for grouped blocks.
+   *
+   * This function is a front-end for the same function in
+   * MGTransferBlockBase.
+   *
+   * @param selected Number of the block of the global vector to be copied from
    * and to the multilevel vector.
    *
-   * @arg mg_selected: Number of the component for which the transfer matrices
-   * should be built.
+   * @deprecated Use build() instead.
    */
+  DEAL_II_DEPRECATED
   template <int dim, int spacedim>
   void
   build_matrices(const DoFHandler<dim, spacedim> &dof,
@@ -382,7 +424,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+  copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
              MGLevelObject<Vector<number>> &  dst,
              const Vector<number2> &          src) const;
 
@@ -394,7 +436,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_from_mg(const DoFHandler<dim, spacedim> &    mg_dof,
+  copy_from_mg(const DoFHandler<dim, spacedim> &    dof_handler,
                Vector<number2> &                    dst,
                const MGLevelObject<Vector<number>> &src) const;
 
@@ -405,7 +447,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_from_mg_add(const DoFHandler<dim, spacedim> &    mg_dof,
+  copy_from_mg_add(const DoFHandler<dim, spacedim> &    dof_handler,
                    Vector<number2> &                    dst,
                    const MGLevelObject<Vector<number>> &src) const;
 
@@ -418,7 +460,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+  copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
              MGLevelObject<Vector<number>> &  dst,
              const BlockVector<number2> &     src) const;
 
@@ -430,7 +472,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_from_mg(const DoFHandler<dim, spacedim> &    mg_dof,
+  copy_from_mg(const DoFHandler<dim, spacedim> &    dof_handler,
                BlockVector<number2> &               dst,
                const MGLevelObject<Vector<number>> &src) const;
 
@@ -441,7 +483,7 @@ public:
    */
   template <int dim, typename number2, int spacedim>
   void
-  copy_from_mg_add(const DoFHandler<dim, spacedim> &    mg_dof,
+  copy_from_mg_add(const DoFHandler<dim, spacedim> &    dof_handler,
                    BlockVector<number2> &               dst,
                    const MGLevelObject<Vector<number>> &src) const;
 
@@ -457,7 +499,7 @@ private:
    */
   template <int dim, class OutVector, int spacedim>
   void
-  do_copy_from_mg(const DoFHandler<dim, spacedim> &    mg_dof,
+  do_copy_from_mg(const DoFHandler<dim, spacedim> &    dof_handler,
                   OutVector &                          dst,
                   const MGLevelObject<Vector<number>> &src,
                   const unsigned int                   offset) const;
@@ -467,7 +509,7 @@ private:
    */
   template <int dim, class OutVector, int spacedim>
   void
-  do_copy_from_mg_add(const DoFHandler<dim, spacedim> &    mg_dof,
+  do_copy_from_mg_add(const DoFHandler<dim, spacedim> &    dof_handler,
                       OutVector &                          dst,
                       const MGLevelObject<Vector<number>> &src,
                       const unsigned int                   offset) const;
@@ -477,7 +519,7 @@ private:
    */
   template <int dim, class InVector, int spacedim>
   void
-  do_copy_to_mg(const DoFHandler<dim, spacedim> &mg_dof,
+  do_copy_to_mg(const DoFHandler<dim, spacedim> &dof_handler,
                 MGLevelObject<Vector<number>> &  dst,
                 const InVector &                 src,
                 const unsigned int               offset) const;
index 1a212459e39e436f24a1c923d1e0f3e5f0a0e5df..3a0cb93086a9569b9af365b8ef43d80404481912 100644 (file)
@@ -46,12 +46,12 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlockSelect<number>::copy_from_mg(
-  const DoFHandler<dim, spacedim> &    mg_dof_handler,
+  const DoFHandler<dim, spacedim> &    dof_handler,
   BlockVector<number2> &               dst,
   const MGLevelObject<Vector<number>> &src) const
 {
   for (unsigned int level = 0;
-       level < mg_dof_handler.get_triangulation().n_levels();
+       level < dof_handler.get_triangulation().n_levels();
        ++level)
     for (IT i = copy_indices[selected_block][level].begin();
          i != copy_indices[selected_block][level].end();
@@ -65,12 +65,12 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlockSelect<number>::copy_from_mg(
-  const DoFHandler<dim, spacedim> &    mg_dof_handler,
+  const DoFHandler<dim, spacedim> &    dof_handler,
   Vector<number2> &                    dst,
   const MGLevelObject<Vector<number>> &src) const
 {
   for (unsigned int level = 0;
-       level < mg_dof_handler.get_triangulation().n_levels();
+       level < dof_handler.get_triangulation().n_levels();
        ++level)
     for (IT i = copy_indices[selected_block][level].begin();
          i != copy_indices[selected_block][level].end();
@@ -84,12 +84,12 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlockSelect<number>::copy_from_mg_add(
-  const DoFHandler<dim, spacedim> &    mg_dof_handler,
+  const DoFHandler<dim, spacedim> &    dof_handler,
   BlockVector<number2> &               dst,
   const MGLevelObject<Vector<number>> &src) const
 {
   for (unsigned int level = 0;
-       level < mg_dof_handler.get_triangulation().n_levels();
+       level < dof_handler.get_triangulation().n_levels();
        ++level)
     for (IT i = copy_indices[selected_block][level].begin();
          i != copy_indices[selected_block][level].end();
@@ -103,12 +103,12 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlockSelect<number>::copy_from_mg_add(
-  const DoFHandler<dim, spacedim> &    mg_dof_handler,
+  const DoFHandler<dim, spacedim> &    dof_handler,
   Vector<number2> &                    dst,
   const MGLevelObject<Vector<number>> &src) const
 {
   for (unsigned int level = 0;
-       level < mg_dof_handler.get_triangulation().n_levels();
+       level < dof_handler.get_triangulation().n_levels();
        ++level)
     for (IT i = copy_indices[selected_block][level].begin();
          i != copy_indices[selected_block][level].end();
@@ -134,14 +134,14 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlock<number>::copy_from_mg(
-  const DoFHandler<dim, spacedim> &         mg_dof_handler,
+  const DoFHandler<dim, spacedim> &         dof_handler,
   BlockVector<number2> &                    dst,
   const MGLevelObject<BlockVector<number>> &src) const
 {
   for (unsigned int block = 0; block < selected.size(); ++block)
     if (selected[block])
       for (unsigned int level = 0;
-           level < mg_dof_handler.get_triangulation().n_levels();
+           level < dof_handler.get_triangulation().n_levels();
            ++level)
         for (IT i = copy_indices[block][level].begin();
              i != copy_indices[block][level].end();
@@ -156,14 +156,14 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlock<number>::copy_from_mg_add(
-  const DoFHandler<dim, spacedim> &         mg_dof_handler,
+  const DoFHandler<dim, spacedim> &         dof_handler,
   BlockVector<number2> &                    dst,
   const MGLevelObject<BlockVector<number>> &src) const
 {
   for (unsigned int block = 0; block < selected.size(); ++block)
     if (selected[block])
       for (unsigned int level = 0;
-           level < mg_dof_handler.get_triangulation().n_levels();
+           level < dof_handler.get_triangulation().n_levels();
            ++level)
         for (IT i = copy_indices[block][level].begin();
              i != copy_indices[block][level].end();
index 82dbe7f1acdd74f9ae8b568003cb167bdc57b3b4..6e1f390fc8a714d20569b1f929034182b00b55f3 100644 (file)
@@ -83,6 +83,23 @@ protected:
    */
   template <int dim, int spacedim>
   void
+  build(const DoFHandler<dim, spacedim> &dof_handler);
+
+  /**
+   * Actually build the prolongation matrices for each level.
+   *
+   * This function is only called by derived classes. These can also set the
+   * member variables <code>selected_component</code> and
+   * <code>mg_selected_component</code> member variables to restrict the
+   * transfer matrices to certain components. Furthermore, they use
+   * <code>target_component</code> and <code>mg_target_component</code> for
+   * re-ordering and grouping of components.
+   *
+   * @deprecated Use build() instead.
+   */
+  DEAL_II_DEPRECATED
+  template <int dim, int spacedim>
+  void
   build_matrices(const DoFHandler<dim, spacedim> &dof,
                  const DoFHandler<dim, spacedim> &mg_dof);
 
@@ -130,7 +147,7 @@ protected:
   std::vector<std::vector<types::global_dof_index>> mg_component_start;
 
   /**
-   * Call build_matrices() function first.
+   * Call build() function first.
    */
   DeclException0(ExcMatricesNotBuilt);
 
@@ -220,7 +237,10 @@ public:
    * It also affects the behavior of the <tt>selected</tt> argument
    *
    * @arg boundary_indices: holds the boundary indices on each level.
+   *
+   * @deprecated Use build() instead.
    */
+  DEAL_II_DEPRECATED
   template <int dim, int spacedim>
   void
   build_matrices(
@@ -235,6 +255,43 @@ public:
     const std::vector<std::set<types::global_dof_index>> &boundary_indices =
       std::vector<std::set<types::global_dof_index>>());
 
+  /**
+   * Actually build the prolongation matrices for grouped components.
+   *
+   * This function is a front-end for the same function in
+   * MGTransferComponentBase.
+   *
+   * @arg selected Number of the block of the global vector to be copied from
+   * and to the multilevel vector. This number refers to the renumbering by
+   * <tt>target_component</tt>.
+   *
+   * @arg mg_selected Number of the block for which the transfer matrices
+   * should be built.
+   *
+   * If <tt>mg_target_component</tt> is present, this refers to the renumbered
+   * components.
+   *
+   * @arg target_component this argument allows grouping and renumbering of
+   * components in the fine-level vector (see DoFRenumbering::component_wise).
+   *
+   * @arg mg_target_component this argument allows grouping and renumbering
+   * of components in the level vectors (see DoFRenumbering::component_wise).
+   * It also affects the behavior of the <tt>selected</tt> argument
+   *
+   * @arg boundary_indices holds the boundary indices on each level.
+   */
+  template <int dim, int spacedim>
+  void
+  build(const DoFHandler<dim, spacedim> &dof,
+        unsigned int                     selected,
+        unsigned int                     mg_selected,
+        const std::vector<unsigned int> &target_component =
+          std::vector<unsigned int>(),
+        const std::vector<unsigned int> &mg_target_component =
+          std::vector<unsigned int>(),
+        const std::vector<std::set<types::global_dof_index>> &boundary_indices =
+          std::vector<std::set<types::global_dof_index>>());
+
   /**
    * Change selected component. Handle with care!
    */
index b196d2d53e9b9417d0f44982025f683ceaac5e6d..9aa52089c646be6e76d3c9ba060c5a437e69f912 100644 (file)
@@ -44,7 +44,7 @@ namespace internal
     template <int dim, int spacedim>
     void
     fill_copy_indices(
-      const DoFHandler<dim, spacedim> &mg_dof,
+      const DoFHandler<dim, spacedim> &dof_handler,
       const MGConstrainedDoFs *        mg_constrained_dofs,
       std::vector<std::vector<
         std::pair<types::global_dof_index, types::global_dof_index>>>
@@ -122,7 +122,7 @@ namespace internal
     template <int dim, typename Number>
     void
     setup_transfer(
-      const DoFHandler<dim> &  mg_dof,
+      const DoFHandler<dim> &  dof_handler,
       const MGConstrainedDoFs *mg_constrained_dofs,
       const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
         &                                     external_partitioners,
index a3d02ee30c05d5dde36edc594985326b28c98772..a44ce2e600c0abca00475296a70ad815b0c1492b 100644 (file)
@@ -103,7 +103,7 @@ public:
    * ignored and internal variants are used instead.
    */
   void
-  build(const DoFHandler<dim, dim> &mg_dof,
+  build(const DoFHandler<dim, dim> &dof_handler,
         const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
           &external_partitioners =
             std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>());
@@ -153,7 +153,7 @@ public:
     const LinearAlgebra::distributed::Vector<Number> &src) const override;
 
   /**
-   * Restrict fine-mesh field @p src to each multigrid level in @p mg_dof and
+   * Restrict fine-mesh field @p src to each multigrid level in @p dof_handler and
    * store the result in @p dst.
    *
    * If @p dst is empty or has incorrect locally owned size, it will be
@@ -162,7 +162,7 @@ public:
   template <typename Number2, int spacedim>
   void
   interpolate_to_mg(
-    const DoFHandler<dim, spacedim> &                          mg_dof,
+    const DoFHandler<dim, spacedim> &                          dof_handler,
     MGLevelObject<LinearAlgebra::distributed::Vector<Number>> &dst,
     const LinearAlgebra::distributed::Vector<Number2> &        src) const;
 
@@ -357,13 +357,13 @@ public:
    * Actually build the information for the prolongation for each level.
    */
   void
-  build(const DoFHandler<dim, dim> &mg_dof);
+  build(const DoFHandler<dim, dim> &dof_handler);
 
   /**
    * Same as above for the case that each block has its own DoFHandler.
    */
   void
-  build(const std::vector<const DoFHandler<dim, dim> *> &mg_dof);
+  build(const std::vector<const DoFHandler<dim, dim> *> &dof_handler);
 
   /**
    * Prolongate a vector from level <tt>to_level-1</tt> to level
@@ -422,7 +422,7 @@ public:
   template <typename Number2, int spacedim>
   void
   copy_to_mg(
-    const DoFHandler<dim, spacedim> &                               mg_dof,
+    const DoFHandler<dim, spacedim> &                               dof_handler,
     MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
     const LinearAlgebra::distributed::BlockVector<Number2> &        src) const;
 
@@ -432,7 +432,7 @@ public:
   template <typename Number2, int spacedim>
   void
   copy_to_mg(
-    const std::vector<const DoFHandler<dim, spacedim> *> &          mg_dof,
+    const std::vector<const DoFHandler<dim, spacedim> *> &          dof_handler,
     MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
     const LinearAlgebra::distributed::BlockVector<Number2> &        src) const;
 
@@ -442,7 +442,7 @@ public:
   template <typename Number2, int spacedim>
   void
   copy_from_mg(
-    const DoFHandler<dim, spacedim> &                 mg_dof,
+    const DoFHandler<dim, spacedim> &                 dof_handler,
     LinearAlgebra::distributed::BlockVector<Number2> &dst,
     const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
     const;
@@ -453,7 +453,7 @@ public:
   template <typename Number2, int spacedim>
   void
   copy_from_mg(
-    const std::vector<const DoFHandler<dim, spacedim> *> &mg_dof,
+    const std::vector<const DoFHandler<dim, spacedim> *> &dof_handler,
     LinearAlgebra::distributed::BlockVector<Number2> &    dst,
     const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
     const;
@@ -594,7 +594,7 @@ template <int dim, typename Number>
 template <typename Number2, int spacedim>
 void
 MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &                               mg_dof,
+  const DoFHandler<dim, spacedim> &                               dof_handler,
   MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
   const LinearAlgebra::distributed::BlockVector<Number2> &        src) const
 {
@@ -605,7 +605,7 @@ MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
            "DoFHandler for each block, but this method assumes that "
            "the same DoFHandler is used for all the blocks!"));
   const std::vector<const DoFHandler<dim, spacedim> *> mg_dofs(src.n_blocks(),
-                                                               &mg_dof);
+                                                               &dof_handler);
 
   copy_to_mg(mg_dofs, dst, src);
 }
@@ -614,12 +614,12 @@ template <int dim, typename Number>
 template <typename Number2, int spacedim>
 void
 MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
-  const std::vector<const DoFHandler<dim, spacedim> *> &          mg_dof,
+  const std::vector<const DoFHandler<dim, spacedim> *> &          dof_handler,
   MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &dst,
   const LinearAlgebra::distributed::BlockVector<Number2> &        src) const
 {
   const unsigned int n_blocks = src.n_blocks();
-  AssertDimension(mg_dof.size(), n_blocks);
+  AssertDimension(dof_handler.size(), n_blocks);
 
   if (n_blocks == 0)
     return;
@@ -633,11 +633,11 @@ MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
   {
     const parallel::TriangulationBase<dim, spacedim> *tria =
       (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-        &(mg_dof[0]->get_triangulation())));
+        &(dof_handler[0]->get_triangulation())));
     for (unsigned int i = 1; i < n_blocks; ++i)
       AssertThrow(
         (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-           &(mg_dof[0]->get_triangulation())) == tria),
+           &(dof_handler[0]->get_triangulation())) == tria),
         ExcMessage("The DoFHandler use different Triangulations!"));
 
     MGLevelObject<bool> do_reinit;
@@ -653,9 +653,10 @@ MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
         for (unsigned int b = 0; b < n_blocks; ++b)
           {
             LinearAlgebra::distributed::Vector<Number> &v = dst[level].block(b);
-            if (v.size() != mg_dof[b]->locally_owned_mg_dofs(level).size() ||
+            if (v.size() !=
+                  dof_handler[b]->locally_owned_mg_dofs(level).size() ||
                 v.local_size() !=
-                  mg_dof[b]->locally_owned_mg_dofs(level).n_elements())
+                  dof_handler[b]->locally_owned_mg_dofs(level).n_elements())
               {
                 do_reinit[level] = true;
                 break; // b
@@ -672,7 +673,7 @@ MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
               {
                 LinearAlgebra::distributed::Vector<Number> &v =
                   dst[level].block(b);
-                v.reinit(mg_dof[b]->locally_owned_mg_dofs(level),
+                v.reinit(dof_handler[b]->locally_owned_mg_dofs(level),
                          tria != nullptr ? tria->get_communicator() :
                                            MPI_COMM_SELF);
               }
@@ -692,7 +693,7 @@ MGTransferBlockMatrixFree<dim, Number>::copy_to_mg(
       for (unsigned int l = min_level; l <= max_level; ++l)
         dst_non_block[l].reinit(dst[l].block(b));
       const unsigned int data_block = same_for_all ? 0 : b;
-      matrix_free_transfer_vector[data_block].copy_to_mg(*mg_dof[b],
+      matrix_free_transfer_vector[data_block].copy_to_mg(*dof_handler[b],
                                                          dst_non_block,
                                                          src.block(b));
 
@@ -705,14 +706,14 @@ template <int dim, typename Number>
 template <typename Number2, int spacedim>
 void
 MGTransferBlockMatrixFree<dim, Number>::copy_from_mg(
-  const DoFHandler<dim, spacedim> &                                     mg_dof,
-  LinearAlgebra::distributed::BlockVector<Number2> &                    dst,
+  const DoFHandler<dim, spacedim> &                 dof_handler,
+  LinearAlgebra::distributed::BlockVector<Number2> &dst,
   const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
   const
 {
   AssertDimension(matrix_free_transfer_vector.size(), 1);
   const std::vector<const DoFHandler<dim, spacedim> *> mg_dofs(dst.n_blocks(),
-                                                               &mg_dof);
+                                                               &dof_handler);
 
   copy_from_mg(mg_dofs, dst, src);
 }
@@ -721,13 +722,13 @@ template <int dim, typename Number>
 template <typename Number2, int spacedim>
 void
 MGTransferBlockMatrixFree<dim, Number>::copy_from_mg(
-  const std::vector<const DoFHandler<dim, spacedim> *> &                mg_dof,
-  LinearAlgebra::distributed::BlockVector<Number2> &                    dst,
+  const std::vector<const DoFHandler<dim, spacedim> *> &dof_handler,
+  LinearAlgebra::distributed::BlockVector<Number2> &    dst,
   const MGLevelObject<LinearAlgebra::distributed::BlockVector<Number>> &src)
   const
 {
   const unsigned int n_blocks = dst.n_blocks();
-  AssertDimension(mg_dof.size(), n_blocks);
+  AssertDimension(dof_handler.size(), n_blocks);
 
   if (n_blocks == 0)
     return;
@@ -750,7 +751,7 @@ MGTransferBlockMatrixFree<dim, Number>::copy_from_mg(
           src_non_block[l] = src[l].block(b);
         }
       const unsigned int data_block = same_for_all ? 0 : b;
-      matrix_free_transfer_vector[data_block].copy_from_mg(*mg_dof[b],
+      matrix_free_transfer_vector[data_block].copy_from_mg(*dof_handler[b],
                                                            dst.block(b),
                                                            src_non_block);
     }
index 7c738ea95df5dc8843cb276add32b24b64e2765c..0a9d3984dc349fdd9031bc6ef982c70423f85ef9 100644 (file)
@@ -172,7 +172,7 @@ public:
 #ifndef _MSC_VER
   DEAL_II_DEPRECATED
 #endif
-  Multigrid(const DoFHandler<dim> &             mg_dof_handler,
+  Multigrid(const DoFHandler<dim> &             dof_handler,
             const MGMatrixBase<VectorType> &    matrix,
             const MGCoarseGridBase<VectorType> &coarse,
             const MGTransferBase<VectorType> &  transfer,
@@ -638,7 +638,7 @@ private:
 
 template <typename VectorType>
 template <int dim>
-Multigrid<VectorType>::Multigrid(const DoFHandler<dim> &         mg_dof_handler,
+Multigrid<VectorType>::Multigrid(const DoFHandler<dim> &         dof_handler,
                                  const MGMatrixBase<VectorType> &matrix,
                                  const MGCoarseGridBase<VectorType> &coarse,
                                  const MGTransferBase<VectorType> &  transfer,
@@ -659,7 +659,7 @@ Multigrid<VectorType>::Multigrid(const DoFHandler<dim> &         mg_dof_handler,
   , debug(0)
 {
   const unsigned int dof_handler_max_level =
-    mg_dof_handler.get_triangulation().n_global_levels() - 1;
+    dof_handler.get_triangulation().n_global_levels() - 1;
   if (max_level == numbers::invalid_unsigned_int)
     maxlevel = dof_handler_max_level;
   else
index 8680f9cd1cf389dea6094ea495b46de7c8533dfe..388718b0bc556c0d0d49d01becdeaeb77974d0e8 100644 (file)
@@ -52,7 +52,7 @@ namespace
   template <int dim, typename number, int spacedim>
   void
   reinit_vector_by_blocks(
-    const dealii::DoFHandler<dim, spacedim> &          mg_dof,
+    const dealii::DoFHandler<dim, spacedim> &          dof_handler,
     MGLevelObject<BlockVector<number>> &               v,
     const std::vector<bool> &                          sel,
     std::vector<std::vector<types::global_dof_index>> &ndofs)
@@ -65,10 +65,10 @@ namespace
     if (ndofs.size() == 0)
       {
         std::vector<std::vector<types::global_dof_index>> new_dofs(
-          mg_dof.get_triangulation().n_levels(),
+          dof_handler.get_triangulation().n_levels(),
           std::vector<types::global_dof_index>(selected.size()));
         std::swap(ndofs, new_dofs);
-        MGTools::count_dofs_per_block(mg_dof, ndofs);
+        MGTools::count_dofs_per_block(dof_handler, ndofs);
       }
 
     for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
@@ -98,12 +98,12 @@ namespace
   template <int dim, typename number, int spacedim>
   void
   reinit_vector_by_blocks(
-    const dealii::DoFHandler<dim, spacedim> &          mg_dof,
+    const dealii::DoFHandler<dim, spacedim> &          dof_handler,
     MGLevelObject<dealii::Vector<number>> &            v,
     const unsigned int                                 selected_block,
     std::vector<std::vector<types::global_dof_index>> &ndofs)
   {
-    const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
+    const unsigned int n_blocks = dof_handler.get_fe().n_blocks();
     AssertIndexRange(selected_block, n_blocks);
 
     std::vector<bool> selected(n_blocks, false);
@@ -112,10 +112,10 @@ namespace
     if (ndofs.size() == 0)
       {
         std::vector<std::vector<types::global_dof_index>> new_dofs(
-          mg_dof.get_triangulation().n_levels(),
+          dof_handler.get_triangulation().n_levels(),
           std::vector<types::global_dof_index>(selected.size()));
         std::swap(ndofs, new_dofs);
-        MGTools::count_dofs_per_block(mg_dof, ndofs);
+        MGTools::count_dofs_per_block(dof_handler, ndofs);
       }
 
     for (unsigned int level = v.min_level(); level <= v.max_level(); ++level)
@@ -130,16 +130,16 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlockSelect<number>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &mg_dof_handler,
+  const DoFHandler<dim, spacedim> &dof_handler,
   MGLevelObject<Vector<number>> &  dst,
   const BlockVector<number2> &     src) const
 {
-  reinit_vector_by_blocks(mg_dof_handler, dst, selected_block, sizes);
+  reinit_vector_by_blocks(dof_handler, dst, selected_block, sizes);
   // For MGTransferBlockSelect, the
   // multilevel block is always the
   // first, since only one block is
   // selected.
-  for (unsigned int level = mg_dof_handler.get_triangulation().n_levels();
+  for (unsigned int level = dof_handler.get_triangulation().n_levels();
        level != 0;)
     {
       --level;
@@ -156,15 +156,15 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlockSelect<number>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &mg_dof_handler,
+  const DoFHandler<dim, spacedim> &dof_handler,
   MGLevelObject<Vector<number>> &  dst,
   const Vector<number2> &          src) const
 {
-  reinit_vector_by_blocks(mg_dof_handler, dst, selected_block, sizes);
+  reinit_vector_by_blocks(dof_handler, dst, selected_block, sizes);
   // For MGTransferBlockSelect, the
   // multilevel block is always the
   // first, since only one block is selected.
-  for (unsigned int level = mg_dof_handler.get_triangulation().n_levels();
+  for (unsigned int level = dof_handler.get_triangulation().n_levels();
        level != 0;)
     {
       --level;
@@ -181,12 +181,12 @@ template <typename number>
 template <int dim, typename number2, int spacedim>
 void
 MGTransferBlock<number>::copy_to_mg(
-  const DoFHandler<dim, spacedim> &   mg_dof_handler,
+  const DoFHandler<dim, spacedim> &   dof_handler,
   MGLevelObject<BlockVector<number>> &dst,
   const BlockVector<number2> &        src) const
 {
-  reinit_vector_by_blocks(mg_dof_handler, dst, selected, sizes);
-  for (unsigned int level = mg_dof_handler.get_triangulation().n_levels();
+  reinit_vector_by_blocks(dof_handler, dst, selected, sizes);
+  for (unsigned int level = dof_handler.get_triangulation().n_levels();
        level != 0;)
     {
       --level;
@@ -204,13 +204,23 @@ MGTransferBlock<number>::copy_to_mg(
 
 template <int dim, int spacedim>
 void
-MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
-                                    const DoFHandler<dim, spacedim> &mg_dof)
+MGTransferBlockBase::build_matrices(
+  const DoFHandler<dim, spacedim> &dof,
+  const DoFHandler<dim, spacedim> &mg_dof_handler)
+{
+  build(mg_dof_handler);
+}
+
+
+
+template <int dim, int spacedim>
+void
+MGTransferBlockBase::build(const DoFHandler<dim, spacedim> &dof_handler)
 {
-  const FiniteElement<dim> &fe            = mg_dof.get_fe();
+  const FiniteElement<dim> &fe            = dof_handler.get_fe();
   const unsigned int        n_blocks      = fe.n_blocks();
   const unsigned int        dofs_per_cell = fe.dofs_per_cell;
-  const unsigned int        n_levels = mg_dof.get_triangulation().n_levels();
+  const unsigned int n_levels = dof_handler.get_triangulation().n_levels();
 
   Assert(selected.size() == n_blocks,
          ExcDimensionMismatch(selected.size(), n_blocks));
@@ -229,7 +239,7 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
   // Compute the lengths of all blocks
   sizes.clear();
   sizes.resize(n_levels, std::vector<types::global_dof_index>(fe.n_blocks()));
-  MGTools::count_dofs_per_block(mg_dof, sizes);
+  MGTools::count_dofs_per_block(dof_handler, sizes);
 
   // Fill some index vectors
   // for later use.
@@ -248,7 +258,7 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
 
   block_start.resize(n_blocks);
   DoFTools::count_dofs_per_block(
-    static_cast<const DoFHandler<dim, spacedim> &>(mg_dof), block_start);
+    static_cast<const DoFHandler<dim, spacedim> &>(dof_handler), block_start);
 
   types::global_dof_index k = 0;
   for (types::global_dof_index &first_index : block_start)
@@ -328,8 +338,8 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
       prolongation_sparsities[level]->collect_sizes();
 
       for (typename DoFHandler<dim, spacedim>::cell_iterator cell =
-             mg_dof.begin(level);
-           cell != mg_dof.end(level);
+             dof_handler.begin(level);
+           cell != dof_handler.end(level);
            ++cell)
         if (cell->has_children())
           {
@@ -344,7 +354,7 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
                 // prolongation matrix for
                 // this child
                 const FullMatrix<double> &prolongation =
-                  mg_dof.get_fe().get_prolongation_matrix(
+                  dof_handler.get_fe().get_prolongation_matrix(
                     child, cell->refinement_case());
 
                 cell->child(child)->get_mg_dof_indices(dof_indices_child);
@@ -371,8 +381,8 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
       prolongation_matrices[level]->reinit(*prolongation_sparsities[level]);
       // now actually build the matrices
       for (typename DoFHandler<dim, spacedim>::cell_iterator cell =
-             mg_dof.begin(level);
-           cell != mg_dof.end(level);
+             dof_handler.begin(level);
+           cell != dof_handler.end(level);
            ++cell)
         if (cell->has_children())
           {
@@ -387,7 +397,7 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
                 // prolongation matrix for
                 // this child
                 const FullMatrix<double> &prolongation =
-                  mg_dof.get_fe().get_prolongation_matrix(
+                  dof_handler.get_fe().get_prolongation_matrix(
                     child, cell->refinement_case());
 
                 cell->child(child)->get_mg_dof_indices(dof_indices_child);
@@ -468,35 +478,44 @@ MGTransferBlockBase::build_matrices(const DoFHandler<dim, spacedim> &,
     }
 }
 
-
-
 template <typename number>
 template <int dim, int spacedim>
 void
 MGTransferBlockSelect<number>::build_matrices(
-  const DoFHandler<dim, spacedim> &dof,
+  const DoFHandler<dim, spacedim> & /*dof*/,
   const DoFHandler<dim, spacedim> &mg_dof,
   unsigned int                     select)
 {
-  const FiniteElement<dim> &fe       = mg_dof.get_fe();
-  unsigned int              n_blocks = mg_dof.get_fe().n_blocks();
+  build(mg_dof, select);
+}
+
+template <typename number>
+template <int dim, int spacedim>
+void
+MGTransferBlockSelect<number>::build(
+  const DoFHandler<dim, spacedim> &dof_handler,
+  unsigned int                     select)
+{
+  const FiniteElement<dim> &fe       = dof_handler.get_fe();
+  unsigned int              n_blocks = dof_handler.get_fe().n_blocks();
 
   selected_block = select;
   selected.resize(n_blocks, false);
   selected[select] = true;
 
-  MGTransferBlockBase::build_matrices(dof, mg_dof);
+  MGTransferBlockBase::build(dof_handler);
 
   std::vector<types::global_dof_index> temp_copy_indices;
   std::vector<types::global_dof_index> global_dof_indices(fe.dofs_per_cell);
   std::vector<types::global_dof_index> level_dof_indices(fe.dofs_per_cell);
 
-  for (int level = dof.get_triangulation().n_levels() - 1; level >= 0; --level)
+  for (int level = dof_handler.get_triangulation().n_levels() - 1; level >= 0;
+       --level)
     {
       typename DoFHandler<dim, spacedim>::active_cell_iterator level_cell =
-        mg_dof.begin_active(level);
+        dof_handler.begin_active(level);
       const typename DoFHandler<dim, spacedim>::active_cell_iterator level_end =
-        mg_dof.end_active(level);
+        dof_handler.end_active(level);
 
       temp_copy_indices.resize(0);
       temp_copy_indices.resize(sizes[level][selected_block],
@@ -558,16 +577,25 @@ MGTransferBlockSelect<number>::build_matrices(
 }
 
 
+template <typename number>
+template <int dim, int spacedim>
+void
+MGTransferBlock<number>::build_matrices(
+  const DoFHandler<dim, spacedim> & /*dof*/,
+  const DoFHandler<dim, spacedim> &mg_dof,
+  const std::vector<bool> &        sel)
+{
+  build(mg_dof, sel);
+}
 
 template <typename number>
 template <int dim, int spacedim>
 void
-MGTransferBlock<number>::build_matrices(const DoFHandler<dim, spacedim> &dof,
-                                        const DoFHandler<dim, spacedim> &mg_dof,
-                                        const std::vector<bool> &        sel)
+MGTransferBlock<number>::build(const DoFHandler<dim, spacedim> &dof_handler,
+                               const std::vector<bool> &        sel)
 {
-  const FiniteElement<dim> &fe       = mg_dof.get_fe();
-  unsigned int              n_blocks = mg_dof.get_fe().n_blocks();
+  const FiniteElement<dim> &fe       = dof_handler.get_fe();
+  unsigned int              n_blocks = dof_handler.get_fe().n_blocks();
 
   if (sel.size() != 0)
     {
@@ -578,17 +606,18 @@ MGTransferBlock<number>::build_matrices(const DoFHandler<dim, spacedim> &dof,
   if (selected.size() == 0)
     selected = std::vector<bool>(n_blocks, true);
 
-  MGTransferBlockBase::build_matrices(dof, mg_dof);
+  MGTransferBlockBase::build(dof_handler);
 
   std::vector<std::vector<types::global_dof_index>> temp_copy_indices(n_blocks);
   std::vector<types::global_dof_index> global_dof_indices(fe.dofs_per_cell);
   std::vector<types::global_dof_index> level_dof_indices(fe.dofs_per_cell);
-  for (int level = dof.get_triangulation().n_levels() - 1; level >= 0; --level)
+  for (int level = dof_handler.get_triangulation().n_levels() - 1; level >= 0;
+       --level)
     {
       typename DoFHandler<dim, spacedim>::active_cell_iterator level_cell =
-        mg_dof.begin_active(level);
+        dof_handler.begin_active(level);
       const typename DoFHandler<dim, spacedim>::active_cell_iterator level_end =
-        mg_dof.end_active(level);
+        dof_handler.end_active(level);
 
       for (unsigned int block = 0; block < n_blocks; ++block)
         if (selected[block])
index c6637bb7288980978cef7c6ef735d1b5c5e2606f..9d14e8adb6b3f828ee16f4b939b9877f998d6d82 100644 (file)
 
 for (deal_II_dimension : DIMENSIONS)
   {
+    template void MGTransferBlock<float>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &, const std::vector<bool> &);
+
+    template void MGTransferBlock<double>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &, const std::vector<bool> &);
+
+    template void MGTransferBlockSelect<float>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &, const unsigned int);
+
+    template void MGTransferBlockSelect<double>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &, const unsigned int);
+
+    // deprecated:
     template void MGTransferBlock<float>::build_matrices<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &,
       const DoFHandler<deal_II_dimension> &,
       const std::vector<bool> &);
 
+    // deprecated:
     template void MGTransferBlock<double>::build_matrices<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &,
       const DoFHandler<deal_II_dimension> &,
       const std::vector<bool> &);
 
+    // deprecated:
     template void MGTransferBlockSelect<float>::build_matrices<
       deal_II_dimension>(const DoFHandler<deal_II_dimension> &,
                          const DoFHandler<deal_II_dimension> &,
                          const unsigned int);
 
+    // deprecated:
     template void MGTransferBlockSelect<double>::build_matrices<
       deal_II_dimension>(const DoFHandler<deal_II_dimension> &,
                          const DoFHandler<deal_II_dimension> &,
index cdca7e47a6652bddc8841039edfe44904804e52c..6bfe926ffd9b6e4e62f91693afc456ead66f55f5 100644 (file)
@@ -253,10 +253,20 @@ MGTransferSelect<number>::do_copy_to_mg(
 }
 
 
+
 template <int dim, int spacedim>
 void
 MGTransferComponentBase::build_matrices(const DoFHandler<dim, spacedim> &,
                                         const DoFHandler<dim, spacedim> &mg_dof)
+{
+  build(mg_dof);
+}
+
+
+
+template <int dim, int spacedim>
+void
+MGTransferComponentBase::build(const DoFHandler<dim, spacedim> &mg_dof)
 {
   // Fill target component with
   // standard values (identity) if it
@@ -561,11 +571,28 @@ MGTransferComponentBase::build_matrices(const DoFHandler<dim, spacedim> &,
 }
 
 
+
 template <typename number>
 template <int dim, int spacedim>
 void
 MGTransferSelect<number>::build_matrices(
-  const DoFHandler<dim, spacedim> &                     dof,
+  const DoFHandler<dim, spacedim> & /*dof*/,
+  const DoFHandler<dim, spacedim> &                     mg_dof,
+  unsigned int                                          select,
+  unsigned int                                          mg_select,
+  const std::vector<unsigned int> &                     t_component,
+  const std::vector<unsigned int> &                     mg_t_component,
+  const std::vector<std::set<types::global_dof_index>> &bdry_indices)
+{
+  build(mg_dof, select, mg_select, t_component, mg_t_component, bdry_indices);
+}
+
+
+
+template <typename number>
+template <int dim, int spacedim>
+void
+MGTransferSelect<number>::build(
   const DoFHandler<dim, spacedim> &                     mg_dof,
   unsigned int                                          select,
   unsigned int                                          mg_select,
@@ -621,7 +648,7 @@ MGTransferSelect<number>::build_matrices(
         }
     }
 
-  MGTransferComponentBase::build_matrices(dof, mg_dof);
+  MGTransferComponentBase::build(mg_dof);
 
   interface_dofs.resize(mg_dof.get_triangulation().n_levels());
   for (unsigned int l = 0; l < mg_dof.get_triangulation().n_levels(); ++l)
@@ -636,7 +663,8 @@ MGTransferSelect<number>::build_matrices(
   std::vector<types::global_dof_index> temp_copy_indices;
   std::vector<types::global_dof_index> global_dof_indices(fe.dofs_per_cell);
   std::vector<types::global_dof_index> level_dof_indices(fe.dofs_per_cell);
-  for (int level = dof.get_triangulation().n_levels() - 1; level >= 0; --level)
+  for (int level = mg_dof.get_triangulation().n_levels() - 1; level >= 0;
+       --level)
     {
       copy_to_and_from_indices[level].clear();
       typename DoFHandler<dim, spacedim>::active_cell_iterator level_cell =
index c52392b83f0a473334bc5455c079492b45c5a253..156b170073fc18e95212feb9682361098c0a9880 100644 (file)
 
 for (deal_II_dimension : DIMENSIONS)
   {
+    template void MGTransferSelect<float>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &,
+      unsigned int,
+      unsigned int,
+      const std::vector<unsigned int> &,
+      const std::vector<unsigned int> &,
+      const std::vector<std::set<types::global_dof_index>> &);
+
+    template void MGTransferSelect<double>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &,
+      unsigned int,
+      unsigned int,
+      const std::vector<unsigned int> &,
+      const std::vector<unsigned int> &,
+      const std::vector<std::set<types::global_dof_index>> &);
+
+    // deprecated:
     template void MGTransferSelect<float>::build_matrices<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &d,
       const DoFHandler<deal_II_dimension> &,
@@ -26,6 +43,7 @@ for (deal_II_dimension : DIMENSIONS)
       const std::vector<unsigned int> &,
       const std::vector<std::set<types::global_dof_index>> &);
 
+    // deprecated:
     template void MGTransferSelect<double>::build_matrices<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &d,
       const DoFHandler<deal_II_dimension> &,
index 604b346d9bd5f1609f3b34498f4ef9ec051f56a0..cf947df52ba0902fe615c00dec631992bd1807f0 100644 (file)
@@ -57,7 +57,7 @@ namespace internal
     template <int dim, int spacedim>
     void
     fill_copy_indices(
-      const dealii::DoFHandler<dim, spacedim> &mg_dof,
+      const dealii::DoFHandler<dim, spacedim> &dof_handler,
       const MGConstrainedDoFs *                mg_constrained_dofs,
       std::vector<std::vector<
         std::pair<types::global_dof_index, types::global_dof_index>>>
@@ -84,14 +84,14 @@ namespace internal
       std::vector<DoFPair> send_data_temp;
 
       const unsigned int n_levels =
-        mg_dof.get_triangulation().n_global_levels();
+        dof_handler.get_triangulation().n_global_levels();
       copy_indices.resize(n_levels);
       copy_indices_global_mine.resize(n_levels);
       copy_indices_level_mine.resize(n_levels);
       IndexSet globally_relevant;
-      DoFTools::extract_locally_relevant_dofs(mg_dof, globally_relevant);
+      DoFTools::extract_locally_relevant_dofs(dof_handler, globally_relevant);
 
-      const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
+      const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
       std::vector<types::global_dof_index> global_dof_indices(dofs_per_cell);
       std::vector<types::global_dof_index> level_dof_indices(dofs_per_cell);
 
@@ -109,9 +109,9 @@ namespace internal
           copy_indices_global_mine[level].clear();
 
           for (const auto &level_cell :
-               mg_dof.active_cell_iterators_on_level(level))
+               dof_handler.active_cell_iterators_on_level(level))
             {
-              if (mg_dof.get_triangulation().locally_owned_subdomain() !=
+              if (dof_handler.get_triangulation().locally_owned_subdomain() !=
                     numbers::invalid_subdomain_id &&
                   (level_cell->level_subdomain_id() ==
                      numbers::artificial_subdomain_id ||
@@ -120,7 +120,7 @@ namespace internal
                 continue;
 
               unrolled_copy_indices.resize(
-                mg_dof.locally_owned_dofs().n_elements(),
+                dof_handler.locally_owned_dofs().n_elements(),
                 numbers::invalid_dof_index);
 
               // get the dof numbers of this cell for the global and the
@@ -141,10 +141,11 @@ namespace internal
                   // and the level one. This check involves locally owned
                   // indices which often consist only of a single range, so
                   // they are cheap to look up.
-                  bool global_mine = mg_dof.locally_owned_dofs().is_element(
-                    global_dof_indices[i]);
+                  bool global_mine =
+                    dof_handler.locally_owned_dofs().is_element(
+                      global_dof_indices[i]);
                   bool level_mine =
-                    mg_dof.locally_owned_mg_dofs(level).is_element(
+                    dof_handler.locally_owned_mg_dofs(level).is_element(
                       level_dof_indices[i]);
 
                   if (global_mine && level_mine)
@@ -152,7 +153,7 @@ namespace internal
                       // we own both the active dof index and the level one ->
                       // set them into the vector, indexed by the local index
                       // range of the active dof
-                      unrolled_copy_indices[mg_dof.locally_owned_dofs()
+                      unrolled_copy_indices[dof_handler.locally_owned_dofs()
                                               .index_within_set(
                                                 global_dof_indices[i])] =
                         level_dof_indices[i];
@@ -204,18 +205,18 @@ namespace internal
 
               // locally_owned_dofs().nth_index_in_set(i) in this query is
               // usually cheap to look up as there are few ranges in
-              // mg_dof.locally_owned_dofs()
+              // dof_handler.locally_owned_dofs()
               for (unsigned int i = 0; i < unrolled_copy_indices.size(); ++i)
                 if (unrolled_copy_indices[i] != numbers::invalid_dof_index)
                   copy_indices[level].emplace_back(
-                    mg_dof.locally_owned_dofs().nth_index_in_set(i),
+                    dof_handler.locally_owned_dofs().nth_index_in_set(i),
                     unrolled_copy_indices[i]);
             }
         }
 
       const dealii::parallel::TriangulationBase<dim, spacedim> *tria =
         (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-          &mg_dof.get_triangulation()));
+          &dof_handler.get_triangulation()));
       AssertThrow(
         send_data_temp.size() == 0 || tria != nullptr,
         ExcMessage(
@@ -259,7 +260,8 @@ namespace internal
 
           for (unsigned int level = 0; level < n_levels; ++level)
             {
-              const IndexSet &is_local = mg_dof.locally_owned_mg_dofs(level);
+              const IndexSet &is_local =
+                dof_handler.locally_owned_mg_dofs(level);
 
               std::vector<unsigned int> level_dof_indices;
               std::vector<unsigned int> global_dof_indices;
@@ -581,14 +583,14 @@ namespace internal
     void
     setup_element_info(ElementInfo<Number> &          elem_info,
                        const FiniteElement<1> &       fe,
-                       const dealii::DoFHandler<dim> &mg_dof)
+                       const dealii::DoFHandler<dim> &dof_handler)
     {
       // currently, we have only FE_Q and FE_DGQ type elements implemented
-      elem_info.n_components = mg_dof.get_fe().element_multiplicity(0);
+      elem_info.n_components = dof_handler.get_fe().element_multiplicity(0);
       AssertDimension(Utilities::fixed_power<dim>(fe.dofs_per_cell) *
                         elem_info.n_components,
-                      mg_dof.get_fe().dofs_per_cell);
-      AssertDimension(fe.degree, mg_dof.get_fe().degree);
+                      dof_handler.get_fe().dofs_per_cell);
+      AssertDimension(fe.degree, dof_handler.get_fe().degree);
       elem_info.fe_degree             = fe.degree;
       elem_info.element_is_continuous = fe.dofs_per_vertex > 0;
       Assert(fe.dofs_per_vertex < 2, ExcNotImplemented());
@@ -622,7 +624,7 @@ namespace internal
       const Quadrature<1> dummy_quadrature(
         std::vector<Point<1>>(1, Point<1>()));
       internal::MatrixFreeFunctions::ShapeInfo<Number> shape_info;
-      shape_info.reinit(dummy_quadrature, mg_dof.get_fe(), 0);
+      shape_info.reinit(dummy_quadrature, dof_handler.get_fe(), 0);
       elem_info.lexicographic_numbering = shape_info.lexicographic_numbering;
 
       // step 1.4: get the 1d prolongation matrix and combine from both children
@@ -677,7 +679,7 @@ namespace internal
     template <int dim, typename Number>
     void
     setup_transfer(
-      const dealii::DoFHandler<dim> &mg_dof,
+      const dealii::DoFHandler<dim> &dof_handler,
       const MGConstrainedDoFs *      mg_constrained_dofs,
       const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
         &                                     external_partitioners,
@@ -702,13 +704,13 @@ namespace internal
       // tensorized operations, we align the degrees of freedom
       // lexicographically. We distinguish FE_Q elements and FE_DGQ elements
 
-      const dealii::Triangulation<dim> &tria = mg_dof.get_triangulation();
+      const dealii::Triangulation<dim> &tria = dof_handler.get_triangulation();
 
       // ---------------------------- 1. Extract 1D info about the finite
       // element step 1.1: create a 1D copy of the finite element from FETools
       // where we substitute the template argument
-      AssertDimension(mg_dof.get_fe().n_base_elements(), 1);
-      std::string fe_name = mg_dof.get_fe().base_element(0).get_name();
+      AssertDimension(dof_handler.get_fe().n_base_elements(), 1);
+      std::string fe_name = dof_handler.get_fe().base_element(0).get_name();
       {
         const std::size_t template_starts = fe_name.find_first_of('<');
         Assert(fe_name[template_starts + 1] ==
@@ -719,7 +721,7 @@ namespace internal
       const std::unique_ptr<FiniteElement<1>> fe(
         FETools::get_fe_by_name<1, 1>(fe_name));
 
-      setup_element_info(elem_info, *fe, mg_dof);
+      setup_element_info(elem_info, *fe, dof_handler);
 
 
       // -------------- 2. Extract and match dof indices between child and
@@ -735,7 +737,7 @@ namespace internal
         coarse_level_indices[level].resize(tria.n_raw_cells(level),
                                            numbers::invalid_unsigned_int);
       std::vector<types::global_dof_index> local_dof_indices(
-        mg_dof.get_fe().dofs_per_cell);
+        dof_handler.get_fe().dofs_per_cell);
       dirichlet_indices.resize(n_levels - 1);
 
       AssertDimension(target_partitioners.max_level(), n_levels - 1);
@@ -754,8 +756,8 @@ namespace internal
 
           // step 2.1: loop over the cells on the coarse side
           typename dealii::DoFHandler<dim>::cell_iterator cell,
-            endc = mg_dof.end(level - 1);
-          for (cell = mg_dof.begin(level - 1); cell != endc; ++cell)
+            endc = dof_handler.end(level - 1);
+          for (cell = dof_handler.begin(level - 1); cell != endc; ++cell)
             {
               // need to look into a cell if it has children and it is locally
               // owned
@@ -811,7 +813,7 @@ namespace internal
                   replace(mg_constrained_dofs, level, local_dof_indices);
 
                   const IndexSet &owned_level_dofs =
-                    mg_dof.locally_owned_mg_dofs(level);
+                    dof_handler.locally_owned_mg_dofs(level);
                   for (const auto local_dof_index : local_dof_indices)
                     if (!owned_level_dofs.is_element(local_dof_index))
                       ghosted_level_dofs.push_back(local_dof_index);
@@ -848,14 +850,14 @@ namespace internal
                           tria.n_cells(level);
                       parent_child_connect[level][child_index] =
                         std::make_pair(parent_index, c);
-                      AssertIndexRange(mg_dof.get_fe().dofs_per_cell,
+                      AssertIndexRange(dof_handler.get_fe().dofs_per_cell,
                                        static_cast<unsigned short>(-1));
 
                       // set Dirichlet boundary conditions (as a list of
                       // constrained DoFs) for the child
                       if (mg_constrained_dofs != nullptr)
                         for (unsigned int i = 0;
-                             i < mg_dof.get_fe().dofs_per_cell;
+                             i < dof_handler.get_fe().dofs_per_cell;
                              ++i)
                           if (mg_constrained_dofs->is_boundary_index(
                                 level,
@@ -882,7 +884,7 @@ namespace internal
                   replace(mg_constrained_dofs, level - 1, local_dof_indices);
 
                   const IndexSet &owned_level_dofs_l0 =
-                    mg_dof.locally_owned_mg_dofs(0);
+                    dof_handler.locally_owned_mg_dofs(0);
                   for (const auto local_dof_index : local_dof_indices)
                     if (!owned_level_dofs_l0.is_element(local_dof_index))
                       ghosted_level_dofs_l0.push_back(local_dof_index);
@@ -902,7 +904,8 @@ namespace internal
 
                   dirichlet_indices[0].emplace_back();
                   if (mg_constrained_dofs != nullptr)
-                    for (unsigned int i = 0; i < mg_dof.get_fe().dofs_per_cell;
+                    for (unsigned int i = 0;
+                         i < dof_handler.get_fe().dofs_per_cell;
                          ++i)
                       if (mg_constrained_dofs->is_boundary_index(
                             0,
@@ -950,7 +953,7 @@ namespace internal
           const MPI_Comm communicator =
             ptria != nullptr ? ptria->get_communicator() : MPI_COMM_SELF;
 
-          reinit_level_partitioner(mg_dof.locally_owned_mg_dofs(level),
+          reinit_level_partitioner(dof_handler.locally_owned_mg_dofs(level),
                                    ghosted_level_dofs,
                                    external_partitioners.empty() ?
                                      nullptr :
@@ -969,7 +972,7 @@ namespace internal
               for (unsigned int i = 0; i < parent_child_connect[0].size(); ++i)
                 parent_child_connect[0][i] = std::make_pair(i, 0U);
 
-              reinit_level_partitioner(mg_dof.locally_owned_mg_dofs(0),
+              reinit_level_partitioner(dof_handler.locally_owned_mg_dofs(0),
                                        ghosted_level_dofs_l0,
                                        external_partitioners.empty() ?
                                          nullptr :
index e7e087e2b13cc0160ab2d8371e71304db27264c9..894b4c7a4aa8339d13f507e43864a21b4c5a270a 100644 (file)
@@ -95,14 +95,15 @@ MGTransferMatrixFree<dim, Number>::clear()
 template <int dim, typename Number>
 void
 MGTransferMatrixFree<dim, Number>::build(
-  const DoFHandler<dim, dim> &mg_dof,
+  const DoFHandler<dim, dim> &dof_handler,
   const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
     &external_partitioners)
 {
-  this->fill_and_communicate_copy_indices(mg_dof);
+  this->fill_and_communicate_copy_indices(dof_handler);
 
   vector_partitioners.resize(0,
-                             mg_dof.get_triangulation().n_global_levels() - 1);
+                             dof_handler.get_triangulation().n_global_levels() -
+                               1);
   for (unsigned int level = 0; level <= this->ghosted_level_vector.max_level();
        ++level)
     vector_partitioners[level] =
@@ -113,7 +114,7 @@ MGTransferMatrixFree<dim, Number>::build(
   internal::MGTransfer::ElementInfo<Number> elem_info;
 
   internal::MGTransfer::setup_transfer<dim, Number>(
-    mg_dof,
+    dof_handler,
     this->mg_constrained_dofs,
     external_partitioners,
     elem_info,
@@ -149,7 +150,8 @@ MGTransferMatrixFree<dim, Number>::build(
 
   // reshuffle into aligned vector of vectorized arrays
   const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
-  const unsigned int n_levels = mg_dof.get_triangulation().n_global_levels();
+  const unsigned int n_levels =
+    dof_handler.get_triangulation().n_global_levels();
 
   const unsigned int n_weights_per_cell = Utilities::fixed_power<dim>(3);
   weights_on_refined.resize(n_levels - 1);
@@ -717,10 +719,10 @@ MGTransferBlockMatrixFree<dim, Number>::clear()
 template <int dim, typename Number>
 void
 MGTransferBlockMatrixFree<dim, Number>::build(
-  const DoFHandler<dim, dim> &mg_dof)
+  const DoFHandler<dim, dim> &dof_handler)
 {
   AssertDimension(matrix_free_transfer_vector.size(), 1);
-  matrix_free_transfer_vector[0].build(mg_dof);
+  matrix_free_transfer_vector[0].build(dof_handler);
 }
 
 
@@ -728,11 +730,11 @@ MGTransferBlockMatrixFree<dim, Number>::build(
 template <int dim, typename Number>
 void
 MGTransferBlockMatrixFree<dim, Number>::build(
-  const std::vector<const DoFHandler<dim, dim> *> &mg_dof)
+  const std::vector<const DoFHandler<dim, dim> *> &dof_handler)
 {
-  AssertDimension(matrix_free_transfer_vector.size(), mg_dof.size());
-  for (unsigned int i = 0; i < mg_dof.size(); ++i)
-    matrix_free_transfer_vector[i].build(*mg_dof[i]);
+  AssertDimension(matrix_free_transfer_vector.size(), dof_handler.size());
+  for (unsigned int i = 0; i < dof_handler.size(); ++i)
+    matrix_free_transfer_vector[i].build(*dof_handler[i]);
 }
 
 
index 0eceb6b356e6257405185a1ae2d26b1d5387b2cb..e4bb863167c977b280a0ce54bb71806d8dcc44e8 100644 (file)
@@ -136,7 +136,7 @@ MGTransferPrebuilt<VectorType>::restrict_and_add(const unsigned int from_level,
 namespace
 {
   /**
-   * Helper function for build_matrices. Checks for identity constrained dofs
+   * Helper function for build. Checks for identity constrained dofs
    * and replace with the indices of the dofs to which they are constrained
    */
   void
@@ -165,15 +165,16 @@ namespace
 template <typename VectorType>
 template <int dim, int spacedim>
 void
-MGTransferPrebuilt<VectorType>::build_matrices(
-  const DoFHandler<dim, spacedim> &mg_dof)
+MGTransferPrebuilt<VectorType>::build(
+  const DoFHandler<dim, spacedim> &dof_handler)
 {
-  const unsigned int n_levels = mg_dof.get_triangulation().n_global_levels();
-  const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
+  const unsigned int n_levels =
+    dof_handler.get_triangulation().n_global_levels();
+  const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
   this->sizes.resize(n_levels);
   for (unsigned int l = 0; l < n_levels; ++l)
-    this->sizes[l] = mg_dof.n_dofs(l);
+    this->sizes[l] = dof_handler.n_dofs(l);
 
   // reset the size of the array of
   // matrices. call resize(0) first,
@@ -220,19 +221,20 @@ MGTransferPrebuilt<VectorType>::build_matrices(
       // increment dofs_per_cell since a useless diagonal element will be
       // stored
       IndexSet level_p1_relevant_dofs;
-      DoFTools::extract_locally_relevant_level_dofs(mg_dof,
+      DoFTools::extract_locally_relevant_level_dofs(dof_handler,
                                                     level + 1,
                                                     level_p1_relevant_dofs);
       DynamicSparsityPattern                  dsp(this->sizes[level + 1],
                                  this->sizes[level],
                                  level_p1_relevant_dofs);
-      typename DoFHandler<dim>::cell_iterator cell, endc = mg_dof.end(level);
-      for (cell = mg_dof.begin(level); cell != endc; ++cell)
+      typename DoFHandler<dim>::cell_iterator cell,
+        endc = dof_handler.end(level);
+      for (cell = dof_handler.begin(level); cell != endc; ++cell)
         if (cell->has_children() &&
-            (mg_dof.get_triangulation().locally_owned_subdomain() ==
+            (dof_handler.get_triangulation().locally_owned_subdomain() ==
                numbers::invalid_subdomain_id ||
              cell->level_subdomain_id() ==
-               mg_dof.get_triangulation().locally_owned_subdomain()))
+               dof_handler.get_triangulation().locally_owned_subdomain()))
           {
             cell->get_mg_dof_indices(dof_indices_parent);
 
@@ -245,7 +247,7 @@ MGTransferPrebuilt<VectorType>::build_matrices(
               {
                 // set an alias to the prolongation matrix for this child
                 const FullMatrix<double> &prolongation =
-                  mg_dof.get_fe().get_prolongation_matrix(
+                  dof_handler.get_fe().get_prolongation_matrix(
                     child, cell->refinement_case());
 
                 Assert(prolongation.n() != 0, ExcNoProlongation());
@@ -283,7 +285,7 @@ MGTransferPrebuilt<VectorType>::build_matrices(
           // Retrieve communicator from triangulation if it is parallel
           const parallel::TriangulationBase<dim, spacedim> *dist_tria =
             dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
-              &(mg_dof.get_triangulation()));
+              &(dof_handler.get_triangulation()));
 
           MPI_Comm communicator = dist_tria != nullptr ?
                                     dist_tria->get_communicator() :
@@ -292,7 +294,8 @@ MGTransferPrebuilt<VectorType>::build_matrices(
           // Compute # of locally owned MG dofs / processor for distribution
           const std::vector<::dealii::IndexSet>
             locally_owned_mg_dofs_per_processor =
-              mg_dof.compute_locally_owned_mg_dofs_per_processor(level + 1);
+              dof_handler.compute_locally_owned_mg_dofs_per_processor(level +
+                                                                      1);
           std::vector<::dealii::types::global_dof_index>
             n_locally_owned_mg_dofs_per_processor(
               locally_owned_mg_dofs_per_processor.size(), 0);
@@ -319,7 +322,7 @@ MGTransferPrebuilt<VectorType>::build_matrices(
         *prolongation_sparsities[level],
         level,
         dsp,
-        mg_dof);
+        dof_handler);
       dsp.reinit(0, 0);
 
       // In the end, the entries in this object will only be real valued.
@@ -333,12 +336,12 @@ MGTransferPrebuilt<VectorType>::build_matrices(
       FullMatrix<typename VectorType::value_type> prolongation;
 
       // now actually build the matrices
-      for (cell = mg_dof.begin(level); cell != endc; ++cell)
+      for (cell = dof_handler.begin(level); cell != endc; ++cell)
         if (cell->has_children() &&
-            (mg_dof.get_triangulation().locally_owned_subdomain() ==
+            (dof_handler.get_triangulation().locally_owned_subdomain() ==
                numbers::invalid_subdomain_id ||
              cell->level_subdomain_id() ==
-               mg_dof.get_triangulation().locally_owned_subdomain()))
+               dof_handler.get_triangulation().locally_owned_subdomain()))
           {
             cell->get_mg_dof_indices(dof_indices_parent);
 
@@ -350,7 +353,7 @@ MGTransferPrebuilt<VectorType>::build_matrices(
             for (unsigned int child = 0; child < cell->n_children(); ++child)
               {
                 // set an alias to the prolongation matrix for this child
-                prolongation = mg_dof.get_fe().get_prolongation_matrix(
+                prolongation = dof_handler.get_fe().get_prolongation_matrix(
                   child, cell->refinement_case());
 
                 if (this->mg_constrained_dofs != nullptr &&
@@ -379,7 +382,18 @@ MGTransferPrebuilt<VectorType>::build_matrices(
       prolongation_matrices[level]->compress(VectorOperation::insert);
     }
 
-  this->fill_and_communicate_copy_indices(mg_dof);
+  this->fill_and_communicate_copy_indices(dof_handler);
+}
+
+
+
+template <typename VectorType>
+template <int dim, int spacedim>
+void
+MGTransferPrebuilt<VectorType>::build_matrices(
+  const DoFHandler<dim, spacedim> &dof_handler)
+{
+  build(dof_handler);
 }
 
 
index 959e4ede9242223225daaa85dad4b6dc48d247b9..cafcc608a0bbbd030d140eabe0d0b9414db2145e 100644 (file)
@@ -22,6 +22,9 @@ for (V1 : VECTORS_WITH_MATRIX)
 
 for (deal_II_dimension : DIMENSIONS; V1 : VECTORS_WITH_MATRIX)
   {
+    template void MGTransferPrebuilt<V1>::build<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &mg_dof);
+
     template void MGTransferPrebuilt<V1>::build_matrices<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &mg_dof);
   }
index be1e62be883614164001ec0687f432845d91dc51..6a9a0a6274202665ca6f74981def89ce294febe1 100644 (file)
@@ -255,7 +255,7 @@ void
 LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<Vector<double>> mg_transfer;
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   FullMatrix<float> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[0]);
index a5eee5fc99aecc74cb859d455e9c710a95359f1c..1af69b445c0a145773017e4b3ab7a2c5fdd22bbb 100644 (file)
@@ -900,7 +900,7 @@ namespace Step56
 
         // Transfer operators between levels
         MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-        mg_transfer.build_matrices(velocity_dof_handler);
+        mg_transfer.build(velocity_dof_handler);
 
         // Setup coarse grid solver
         FullMatrix<double> coarse_matrix;
index 71f77eb5c6b6b1eb4569c67024ff3205b983b2a9..5bc6fcc9befbfd9957fed95047d6784587a95ffc 100644 (file)
@@ -57,7 +57,7 @@ print_matrix(Triangulation<dim> &      tr,
   dof.distribute_mg_dofs();
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(dof);
+  transfer.build(dof);
 
   unsigned int   n_coarse = dof.n_dofs(level - 1);
   unsigned int   n_fine   = dof.n_dofs(level);
index 2009ce4c56f8d99cebd859953a915ad0746e35c0..a7c846b086cad22d0192c158b5cdd4b4b4a13f57 100644 (file)
@@ -580,7 +580,7 @@ do_test(const DoFHandler<dim> &dof)
   mg_smoother.initialize(mg_matrices, smoother_data);
 
   MGTransferMF<LevelMatrixType> mg_transfer(mg_matrices);
-  mg_transfer.build_matrices(dof);
+  mg_transfer.build(dof);
 
   mg::Matrix<LinearAlgebra::distributed::Vector<double>> mg_matrix(mg_matrices);
 
index a574a58661f20fa034ceeea83301f6a6aa4795eb..a9b9a5774465290b46b5beb66a467a948dad382d 100644 (file)
@@ -379,7 +379,7 @@ do_test(const DoFHandler<dim> &dof)
     }
 
   MGTransferPrebuiltMF<LevelMatrixType> mg_transfer(mg_matrices);
-  mg_transfer.build_matrices(dof);
+  mg_transfer.build(dof);
 
   MGCoarseIterative<LevelMatrixType, number> mg_coarse;
   mg_coarse.initialize(mg_matrices[0]);
index bc981df7d64bd8876fc577b101cafaa26ee75630..554b5ab6c0e8d6573a3382ab861f5ee418eecb93 100644 (file)
@@ -560,7 +560,7 @@ do_test(const DoFHandler<dim> &dof)
     mg_interface_matrices[level].initialize(mg_matrices[level]);
 
   MGTransferMF<LevelMatrixType> mg_transfer(mg_matrices, mg_constrained_dofs);
-  mg_transfer.build_matrices(dof);
+  mg_transfer.build(dof);
 
   MGCoarseIterative<LevelMatrixType, number> mg_coarse;
   mg_coarse.initialize(mg_matrices[0]);
index a3b445ae16f740ec0bc32f3bfcacd4793589d867..257f6679041dc08aca5706597d1f7e64a0811a8c 100644 (file)
@@ -575,7 +575,7 @@ namespace Step37
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<Vector<double>> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     MGCoarseGridHouseholder<float, Vector<double>> mg_coarse;
     mg_coarse.initialize(coarse_matrix);
index 061d3844f0516a38a0674e07e920e3abd456528b..11a43b574ca3ebc672a2895aeb1961b1ec5247ab 100644 (file)
@@ -452,7 +452,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t &coarse_matrix = mg_matrices[0];
 
index f3b4765260ba7c8556bf6528b00bc51b1165281b..cc30e4fd53fc7bd36b71b155e6edeedbd1015ee9 100644 (file)
@@ -404,7 +404,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t coarse_matrix;
     coarse_matrix.copy_from(mg_matrices[0]);
index c59f656bd82c5f7e822daf51cbbc6aeae36d6dd1..53ec77da8e72504f67be74d23d297a130bbfc3d8 100644 (file)
@@ -391,7 +391,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t coarse_matrix;
     coarse_matrix.copy_from(mg_matrices[0]);
index fdd195ceed86619ee85d6b45e9cdeb5d9f71f15a..85e27dc7eeae0f6d6f4156df353d64ab1c6a428d 100644 (file)
@@ -630,7 +630,7 @@ namespace Step39
     SolverCG<TrilinosWrappers::MPI::Vector> solver(control);
 
     MGTransferPrebuilt<TrilinosWrappers::MPI::Vector> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     SolverControl coarse_solver_control(1000, 1e-10, false, false);
     SolverCG<TrilinosWrappers::MPI::Vector> coarse_solver(
index cb94a8471eb7de587b2a92a6cd0b36aa5ff373e8..c491433962a5cf91489a160ae6baecbd4cd332c1 100644 (file)
@@ -631,7 +631,7 @@ namespace Step39
     SolverCG<TrilinosWrappers::MPI::Vector> solver(control);
 
     MGTransferPrebuilt<TrilinosWrappers::MPI::Vector> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     SolverControl coarse_solver_control(1000, 1e-10, false, false);
     SolverCG<TrilinosWrappers::MPI::Vector> coarse_solver(
index 54b977e940b69bcfdf6caa26f22af7142e14fcf5..ae1e7aa619fa0c21fd033fec22a5ad70ca5c8286 100644 (file)
@@ -390,7 +390,7 @@ namespace Step50
     const MGCoarseGridBase<vector_t> &coarse_grid_solver)
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     typedef LA::MPI::PreconditionJacobi                  Smoother;
     MGSmootherPrecondition<matrix_t, Smoother, vector_t> mg_smoother;
index 4d7ec9fca4afb94219efa24e241aaeeeeddf15c3..f5b126d3f4dd7c47fe6eadfc50f1d63ffb6e96b8 100644 (file)
@@ -461,7 +461,7 @@ namespace Step50
     const MGCoarseGridBase<vector_t> &coarse_grid_solver)
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     typedef LA::MPI::PreconditionJacobi                  Smoother;
     MGSmootherPrecondition<matrix_t, Smoother, vector_t> mg_smoother;
index 188a534a52d322afa1a713ae7c52ec2ed6f498e2..0f64d717f84b734404f06079d9160dfc2c5b82a8 100644 (file)
@@ -243,11 +243,11 @@ check_simple(const FiniteElement<dim> &fe)
                                             dirichlet_boundary_functions);
 
   MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   MGTransferPrebuilt<Vector<double>> transfer_renumbered(
     mg_constrained_dofs_renumbered);
-  transfer_renumbered.build_matrices(mgdof_renumbered);
+  transfer_renumbered.build(mgdof_renumbered);
 
   Vector<double> u(mgdof.n_dofs());
   initialize(mgdof, u);
index 703a7f07688f9805c6a0971d5a3b351d05122707..66016f252a403b195f5e952e7a46d1754d5ef82f 100644 (file)
@@ -241,11 +241,11 @@ check_simple(const FiniteElement<dim> &fe)
                                             dirichlet_boundary_functions);
 
   MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   MGTransferPrebuilt<Vector<double>> transfer_renumbered(
     mg_constrained_dofs_renumbered);
-  transfer_renumbered.build_matrices(mgdof_renumbered);
+  transfer_renumbered.build(mgdof_renumbered);
 
   // Fill vector u with some cell based numbering
   Vector<double> u(mgdof.n_dofs());
index e79ea0d620fc02c91936e0bfca097c4b4c1ff90e..02a1568a76543ff0e606f2586916f91ac2289ff0 100644 (file)
@@ -359,10 +359,10 @@ LaplaceProblem<dim>::test()
                                             dirichlet_boundary);
 
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
   MGTransferPrebuilt<Vector<double>> mg_transfer_renumbered(
     mg_constrained_dofs_renumbered);
-  mg_transfer_renumbered.build_matrices(mg_dof_handler_renumbered);
+  mg_transfer_renumbered.build(mg_dof_handler_renumbered);
 
   FullMatrix<double> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[0]);
index 703f21efd7c9d44ef5ad8797808d7f52c4efe046..15925d54fb160ed6e975277597f2420866b5a5a8 100644 (file)
@@ -360,10 +360,10 @@ LaplaceProblem<dim>::test()
                                             dirichlet_boundary);
 
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
   MGTransferPrebuilt<Vector<double>> mg_transfer_renumbered(
     mg_constrained_dofs_renumbered);
-  mg_transfer_renumbered.build_matrices(mg_dof_handler_renumbered);
+  mg_transfer_renumbered.build(mg_dof_handler_renumbered);
 
   Vector<double> test;
   test.reinit(mg_dof_handler.n_dofs());
index a0ec9e6599afd79f2586ca58b063a31d9e6ccbcb..8f056457596dec5f0cb2c1b580164ebad9ef8dbd 100644 (file)
@@ -474,7 +474,7 @@ void
 LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   FullMatrix<double> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[0]);
index 8b17190ce7186493b4e56ba0caa8adcae66c68d9..f3d2e9d343c1785537403c509395ba4ccc405b0b 100644 (file)
@@ -365,7 +365,7 @@ void
 LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   FullMatrix<double> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[min_level]);
index ae8257bf1a6ef8d83e2df3b5b8a5760ac2bd45a9..03fe52a520499efcc451020f0ec20f9796f96cd6 100644 (file)
@@ -375,7 +375,7 @@ LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> mg_transfer(
     mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   SolverControl coarse_solver_control(1000, 1e-10, false, false);
   SolverCG<LinearAlgebra::distributed::Vector<double>> coarse_solver(
index e0ccc7820002bc91f5b8271782d393feebd17861..d9ae93ef1fcea2be2cc2e738957a41252c040bd7 100644 (file)
@@ -376,7 +376,7 @@ LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> mg_transfer(
     hanging_node_constraints, mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   SolverControl coarse_solver_control(1000, 1e-10, false, false);
   SolverCG<LinearAlgebra::distributed::Vector<double>> coarse_solver(
index b0748e26f7fb20c3ac0d2aac94495fb9c7ed7b9f..d0ce88b1e6b2b5aed00de28a3f1e81411e799ab0 100644 (file)
@@ -376,7 +376,7 @@ LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> mg_transfer(
     hanging_node_constraints, mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   SolverControl coarse_solver_control(1000, 1e-10, false, false);
   SolverCG<LinearAlgebra::distributed::Vector<double>> coarse_solver(
index 7369f58437b9825550657efaab9b3fa8d0d36744..dfbba0998369f6cb2006ddc626e509715bdfc33d 100644 (file)
@@ -448,7 +448,7 @@ void
 LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   FullMatrix<double> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[0]);
index ed8769119337fb01108a176ae0fe104dcd2c67b8..9435e93d785de7d71f10b32798d12b31365a392b 100644 (file)
@@ -439,7 +439,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t &coarse_matrix = mg_matrices[0];
 
index f8365f1dd67bf72a5c312c519d255791760d433b..38210156f9c6ea85d869fa22690571f491fa7d58 100644 (file)
@@ -439,7 +439,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     // pre and post smoothers:
     typedef LA::MPI::PreconditionJacobi                  Smoother;
index 4a369c65e84475dc96461cd9800be72712b6349a..d58ace576904b663045a040366fe7b92d5fd8f2c 100644 (file)
@@ -439,7 +439,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t &coarse_matrix = mg_matrices[0];
 
index 733fb1034dcc62f35db1bd59d1c3e3c777d12b06..93de6399b1f478e96d81508f4f7f09d213d0df08 100644 (file)
@@ -369,7 +369,7 @@ LaplaceProblem<dim>::solve()
   typedef Vector<double>       vector_t;
 
   MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   matrix_t &coarse_matrix = mg_matrices[0];
 
index 8e39e8031ac4cc8f1a2b4c232580ac99f1468fb9..4973316f658285bbe1f73007badd13a1761c40d9 100644 (file)
@@ -491,7 +491,7 @@ void
 LaplaceProblem<dim>::solve(bool use_mw)
 {
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   FullMatrix<double> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[0]);
index 6a27dc0893387ef51ed4123ddc4f78f50872a1b1..c3f3cf02b5203d99416c3a93d26e9a87377218f6 100644 (file)
@@ -448,7 +448,7 @@ void
 LaplaceProblem<dim>::solve()
 {
   MGTransferPrebuilt<Vector<double>> mg_transfer(mg_constrained_dofs);
-  mg_transfer.build_matrices(mg_dof_handler);
+  mg_transfer.build(mg_dof_handler);
 
   FullMatrix<double> coarse_matrix;
   coarse_matrix.copy_from(mg_matrices[0]);
index 8f7d862ddaff42239526eda83a87a6b32f6ca5d1..e9a2e9b0053f3b62e7fbfd90b5c4918e48da4cce 100644 (file)
@@ -591,7 +591,7 @@ namespace Step39
     SolverCG<Vector<double>> solver(control);
 
     MGTransferPrebuilt<Vector<double>> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrix[0]);
index 4d6a3ec3d4bf442cd3a26c0904c30c76944a911f..e32ba9087f3f77c322183893c1b597b657f1cb19 100644 (file)
@@ -598,7 +598,7 @@ namespace Step39
     SolverCG<Vector<double>> solver(control);
 
     MGTransferPrebuilt<Vector<double>> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrix[0]);
index 439c841c531f6bd5a0f21bc5cf8f711754519cec..e7263ddf3676b2789693bb4e7d28b8f08ea0dedf 100644 (file)
@@ -597,7 +597,7 @@ namespace Step39
     SolverGMRES<Vector<double>> solver(control);
 
     MGTransferPrebuilt<Vector<double>> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrix[0]);
index 9160fc1c8c79a7dc6fa40c33346dbcaf39c23a9f..5abdc14c0148e7f255b2e156ec68c3f78346f4dc 100644 (file)
@@ -581,7 +581,7 @@ namespace Step39
     SolverCG<Vector<double>> solver(control);
 
     MGTransferPrebuilt<Vector<double>> mg_transfer;
-    mg_transfer.build_matrices(dof_handler);
+    mg_transfer.build(dof_handler);
 
     FullMatrix<double> coarse_matrix;
     coarse_matrix.copy_from(mg_matrix[0]);
index 0daaf3d4fe160bd8d413a1c5449dcdd9a73e88bc..260a7dd26ab5f407c967cce24303d0ba161e9315 100644 (file)
@@ -438,7 +438,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t &coarse_matrix = mg_matrices[0];
 
index 58e1c3b951ce3147d1c79bdc10f469f57b123c2d..d3d693ed3a5a1e34b6985ce8f25fa5de4db79568 100644 (file)
@@ -448,7 +448,7 @@ namespace Step50
   LaplaceProblem<dim>::solve()
   {
     MGTransferPrebuilt<vector_t> mg_transfer(mg_constrained_dofs);
-    mg_transfer.build_matrices(mg_dof_handler);
+    mg_transfer.build(mg_dof_handler);
 
     matrix_t &coarse_matrix = mg_matrices[0];
 
index b25d2221432085dd5a60704a17b07788e4f937e8..f6b4047c7af119cde2fbc338ad92cda18df37875 100644 (file)
@@ -70,7 +70,7 @@ check_simple(const FiniteElement<dim> &fe)
   mgdof.distribute_mg_dofs();
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   MGLevelObject<Vector<double>> u(0, tr.n_levels() - 1);
   reinit_vector(mgdof, u);
index 02e33a3e0f9ad3490d30f4bd5c95ca77caa95218..0f96af7013b3e768bfc762c7a49cc116ff376601 100644 (file)
@@ -103,7 +103,7 @@ check_simple(const FiniteElement<dim> &fe)
   mgdof.distribute_mg_dofs();
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   MGLevelObject<Vector<double>> u(0, tr.n_levels() - 1);
   reinit_vector(mgdof, u);
index 0d9c03c685f5055a2929682e75815e825a3b4318..554adbd9d5ab43c32cd04d52ad4ace069ac715bd 100644 (file)
@@ -208,10 +208,10 @@ check_simple(const FiniteElement<dim> &fe)
     DoFRenumbering::component_wise(mgdof_renumbered, level, block_component);
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   MGTransferPrebuilt<Vector<double>> transfer_renumbered;
-  transfer_renumbered.build_matrices(mgdof_renumbered);
+  transfer_renumbered.build(mgdof_renumbered);
 
   Vector<double> u(mgdof.n_dofs());
   initialize(mgdof, u);
index 326e597f40d18b268739a18b61abc362ec31760b..f777882ffed5070431b9bf230c800bdb247e04e7 100644 (file)
@@ -136,7 +136,7 @@ check_fe(FiniteElement<dim> &fe)
   hanging_node_constraints.close();
 
   MGTransferPrebuilt<vector_t> transfer(mg_constrained_dofs);
-  transfer.build_matrices(dofh);
+  transfer.build(dofh);
   // transfer.print_indices(deallog.get_file_stream());
 
   MGLevelObject<vector_t> u(0, tr.n_global_levels() - 1);
index ed71663c24d828193d8411e0b3b6fb728fdf8974..118b19d6413c560a1f8a91bb047e5c1e413e2006 100644 (file)
@@ -130,7 +130,7 @@ check_fe(FiniteElement<dim> &fe)
   typedef TrilinosWrappers::MPI::Vector vector_t;
   {}
   MGTransferPrebuilt<vector_t> transfer;
-  transfer.build_matrices(dofh);
+  transfer.build(dofh);
   transfer.print_indices(deallog.get_file_stream());
 
   MGLevelObject<vector_t> u(0, tr.n_global_levels() - 1);
index 42994dbdfbbea40f746db529d67e4a297035806d..eb6a1366bf925578fb9524ee4cd3e79cf87fe375 100644 (file)
@@ -130,7 +130,7 @@ check_fe(FiniteElement<dim> &fe)
   typedef PETScWrappers::MPI::Vector vector_t;
   {}
   MGTransferPrebuilt<vector_t> transfer;
-  transfer.build_matrices(dofh);
+  transfer.build(dofh);
   transfer.print_indices(deallog.get_file_stream());
 
   MGLevelObject<vector_t> u(0, tr.n_global_levels() - 1);
index abb10618d1d52b49a52f74b4ad3eb4ee7e4b2c6b..8fdaa259bb45510b0f6e480801eaef7f56fea7fc 100644 (file)
@@ -96,8 +96,7 @@ check_block(const FiniteElement<dim> &fe,
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
 
-  DoFHandler<dim>  mgdof(tr);
-  DoFHandler<dim> &dof = mgdof;
+  DoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
   DoFRenumbering::component_wise(mgdof);
@@ -125,7 +124,7 @@ check_block(const FiniteElement<dim> &fe,
 
   PrimitiveVectorMemory<Vector<double>> mem;
   MGTransferBlock<double>               transfer;
-  transfer.build_matrices(dof, mgdof, selected);
+  transfer.build(mgdof, selected);
   if (factors.size() > 0)
     transfer.initialize(factors, mem);
 
index a1d0f4e0ad50fb7201486cad93424ac4f11ad8dd..55ad85dc32c71bfb5793e9cc8217d53fa79dccae 100644 (file)
@@ -82,8 +82,7 @@ check_select(const FiniteElement<dim> &fe, unsigned int selected)
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
 
-  DoFHandler<dim>  mgdof(tr);
-  DoFHandler<dim> &dof = mgdof;
+  DoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
   DoFRenumbering::component_wise(mgdof);
@@ -110,7 +109,7 @@ check_select(const FiniteElement<dim> &fe, unsigned int selected)
     }
 
   MGTransferBlockSelect<double> transfer;
-  transfer.build_matrices(dof, mgdof, selected);
+  transfer.build(mgdof, selected);
 
   // First, prolongate the constant
   // function from the coarsest mesh
index 4e97c2223e960dc6e7a07a4f24ed0ed9bd9453df..a1f1003a753ebfc4c00a18d1b129509c4adee75b 100644 (file)
@@ -126,8 +126,7 @@ check_block(const FiniteElement<dim> &fe)
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
 
-  DoFHandler<dim>  mgdof(tr);
-  DoFHandler<dim> &dof = mgdof;
+  DoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
 
@@ -136,8 +135,8 @@ check_block(const FiniteElement<dim> &fe)
   Tensor<1, dim> direction;
   for (unsigned int d = 0; d < dim; ++d)
     direction[d] = d * d * d;
-  DoFRenumbering::downstream(dof, direction);
-  DoFRenumbering::component_wise(dof);
+  DoFRenumbering::downstream(mgdof, direction);
+  DoFRenumbering::component_wise(mgdof);
   for (unsigned int l = 0; l < tr.n_levels(); ++l)
     {
       DoFRenumbering::downstream(mgdof, l, direction);
@@ -155,9 +154,9 @@ check_block(const FiniteElement<dim> &fe)
   MGTransferPrebuilt<BlockVector<double>> transfer;
   MGTransferBlock<double>                 transfer_block;
   MGTransferBlockSelect<double>           transfer_select;
-  transfer.build_matrices(mgdof);
-  transfer_block.build_matrices(dof, mgdof, selected);
-  transfer_select.build_matrices(dof, mgdof, 0);
+  transfer.build(mgdof);
+  transfer_block.build(mgdof, selected);
+  transfer_select.build(mgdof, 0);
 
   BlockVector<double> u2(mg_ndofs[2]);
   BlockVector<double> u1(mg_ndofs[1]);
index 3345e52d99136ed5e38e1f3ec5894885bd874187..d0fdc7ae4dbd7cb981c83e6244bd356837d4737b 100644 (file)
@@ -76,7 +76,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref(mg_constrained_dofs);
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
index 94413aa6f379be89613a9c441d22c4552a8461aa..6cf3843aaf13338b080db14ba964c1ffd11b3c10 100644 (file)
@@ -105,7 +105,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref(mg_constrained_dofs);
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
index 9ffb0853512ebed0ae28670be044c08b7e05e61f..2c8369395f4bd6a2f4dd715c986535befc861ba2 100644 (file)
@@ -74,7 +74,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref(mg_constrained_dofs);
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
index 41431608587f5d9eaf3eb3e4b731c085dffdd61c..4ec1f7e5045ef7fc349fff461defcead28f95b72 100644 (file)
@@ -71,7 +71,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref;
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer;
index 73b429074e66559ce1f2aa064dc1c8050a6d619d..344a1aee68e5cd22e406f4c31273dc96e91611e9 100644 (file)
@@ -98,7 +98,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref;
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer;
index e3206fa262ade8ea559c7bde1b840fc2348e91df..4410881eb3b1a3ac8183c1f4d4be9e145b8c4af3 100644 (file)
@@ -107,7 +107,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref(mg_constrained_dofs);
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer(mg_constrained_dofs);
index f6b118bb46d630224ca53aae8fbd5451d362d918..9859db1e6302dbcb371f6cb9447b61d1c5993454 100644 (file)
@@ -98,7 +98,7 @@ check(const unsigned int fe_degree)
       // build reference
       MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
         transfer_ref;
-      transfer_ref.build_matrices(mgdof);
+      transfer_ref.build(mgdof);
 
       // build matrix-free transfer
       MGTransferMatrixFree<dim, Number> transfer;
index 2d618d1bdad979fa28e674ffbb6124689a762f35..c459db1fb40d3ad9752a1710b8bbcd754e868f2b 100644 (file)
@@ -63,7 +63,7 @@ check(const unsigned int fe_degree)
   // build reference
   MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>> transfer_ref(
     mg_constrained_dofs);
-  transfer_ref.build_matrices(mgdof);
+  transfer_ref.build(mgdof);
   deallog << "Transfer matrices: " << std::endl;
   transfer_ref.print_matrices(deallog.get_file_stream());
   deallog << std::endl;
index b5432676c89eb2d8ba6edb8a51cbaa4e2a3a9b03..e428f0dfebfb2a231d03cc28731075a3fd9e10ce 100644 (file)
@@ -61,7 +61,7 @@ check_simple(const FiniteElement<dim> &fe)
   mgdof.distribute_mg_dofs();
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   transfer.print_matrices(deallog.get_file_stream());
   transfer.print_indices(deallog.get_file_stream());
index 9c6df5076807b33b82d3088e2e5a75b312e2fdf3..f0c0f465723db25e6c7199e5e8f7bee84fcc5a2c 100644 (file)
@@ -66,7 +66,7 @@ check_simple(const FiniteElement<dim> &fe)
   mg_constrained_dofs.initialize(mgdof);
 
   MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   transfer.print_matrices(deallog.get_file_stream());
   transfer.print_indices(deallog.get_file_stream());
index 0c4806b1305703ca342482a2c81e3a9a89264a4f..bc05a0ebe09a65593f882d25f6905ed8300606ef 100644 (file)
@@ -71,7 +71,7 @@ check_simple(const FiniteElement<dim> &fe)
   mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
 
   MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   transfer.print_matrices(deallog.get_file_stream());
   transfer.print_indices(deallog.get_file_stream());
index 074ff7f50383e8b1d62e1df6d7c042c4866f6cbb..0e18187c877ee8fd9258eb2095012d89774572f0 100644 (file)
@@ -92,7 +92,7 @@ check()
         // create this if we have Trilinos
         MGTransferPrebuilt<LinearAlgebra::distributed::Vector<double>>
           transfer_ref(mg_constrained_dofs);
-        transfer_ref.build_matrices(mgdof);
+        transfer_ref.build(mgdof);
       }
 #endif
       {
index 8fc70872f228def1a256f3279a92710451d96230..426c8167109d0e2cf470caa4ef349a4c0a7ce027 100644 (file)
@@ -55,14 +55,13 @@ check_select(const FiniteElement<dim> &fe,
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
 
-  DoFHandler<dim>  mgdof(tr);
-  DoFHandler<dim> &dof = mgdof;
+  DoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
   DoFRenumbering::component_wise(mgdof, target_component);
   vector<types::global_dof_index> ndofs(
     *std::max_element(target_component.begin(), target_component.end()) + 1);
-  DoFTools::count_dofs_per_component(dof, ndofs, true, target_component);
+  DoFTools::count_dofs_per_component(mgdof, ndofs, true, target_component);
 
   for (unsigned int l = 0; l < tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l, mg_target_component);
@@ -85,8 +84,8 @@ check_select(const FiniteElement<dim> &fe,
 
 
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(
-    dof, mgdof, selected, mg_selected, target_component, mg_target_component);
+  transfer.build(
+    mgdof, selected, mg_selected, target_component, mg_target_component);
 
   Vector<double> u2(mg_ndofs[2][mg_selected]);
   Vector<double> u1(mg_ndofs[1][mg_selected]);
index 6835847470e4373b9ba3c6711232039c34a71c7b..dbf3144115b2165c833e9aec613a82901fad60aa 100644 (file)
@@ -104,7 +104,7 @@ check(const FiniteElement<dim> &fe)
     DoFRenumbering::component_wise(mg_dof_handler, level);
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(mg_dof_handler);
+  transfer.build(mg_dof_handler);
 
   FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
                                  mg_dof_handler.n_dofs(0));
index 8a82dec48942487640ff3391510970fcad3855c7..948c1028ff8720c98afa6591ef0d3d3b38403d5b 100644 (file)
@@ -109,12 +109,11 @@ check(const FiniteElement<dim> &fe)
   // group all components into one
   // block, and do the transfer
   // matrices on this block
-  transfer.build_matrices(mg_dof_handler,
-                          mg_dof_handler,
-                          0,
-                          0,
-                          std::vector<unsigned int>(2, 0U),
-                          std::vector<unsigned int>(2, 0U));
+  transfer.build(mg_dof_handler,
+                 0,
+                 0,
+                 std::vector<unsigned int>(2, 0U),
+                 std::vector<unsigned int>(2, 0U));
 
   FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
                                  mg_dof_handler.n_dofs(0));
index 00eee4d5ce9585c59dfaf1f518d8cd3eeec6161a..c77556fa2e35bcd776d237746d0e1c39836d9b51 100644 (file)
@@ -110,7 +110,7 @@ check(const FiniteElement<dim> &fe)
   std::vector<unsigned int> mask(2);
   mask[0] = 0;
   mask[1] = 1;
-  transfer.build_matrices(mg_dof_handler, mg_dof_handler, 0, 0, mask, mask);
+  transfer.build(mg_dof_handler, 0, 0, mask, mask);
 
   // use only the first half of all
   // components
index 9d6c8f7fa9ca10bc01971777fc53430dcc9ff7e8..7e8b361c9787568954bd83910eb14027665da419 100644 (file)
@@ -110,8 +110,7 @@ check(const FiniteElement<dim> &fe)
 
   MGTransferSelect<double> transfer;
 
-  transfer.build_matrices(
-    mg_dof_handler, mg_dof_handler, 0, 0, block_component, block_component);
+  transfer.build(mg_dof_handler, 0, 0, block_component, block_component);
 
   std::vector<std::vector<types::global_dof_index>> dofs_per_block(
     tr.n_levels(), std::vector<types::global_dof_index>(2));
index cc9a6e7264ea782891505e762ef59bcc79a3f65f..fd5c45e38bdde5f8530c415dcc13f2a67d0f733c 100644 (file)
@@ -67,12 +67,11 @@ check(const FiniteElement<dim> &fe, const unsigned int selected_block)
 
   MGTransferSelect<double> transfer;
 
-  transfer.build_matrices(mg_dof_handler,
-                          mg_dof_handler,
-                          selected_block,
-                          selected_block,
-                          block_component,
-                          block_component);
+  transfer.build(mg_dof_handler,
+                 selected_block,
+                 selected_block,
+                 block_component,
+                 block_component);
 
   std::vector<types::global_dof_index> dofs_per_block(3);
   DoFTools::count_dofs_per_block(mg_dof_handler,
index c908ae1b62f3e3f719698f87bc8cd61eae0dafd4..f05ff2c70b7f27a023fb1e9b468c567c505a9f0f 100644 (file)
@@ -152,7 +152,7 @@ check(const FiniteElement<dim> &fe)
     DoFRenumbering::component_wise(mg_dof_handler, level);
 
   MGTransferPrebuilt<Vector<double>> transfer;
-  transfer.build_matrices(mg_dof_handler);
+  transfer.build(mg_dof_handler);
 
   FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
                                  mg_dof_handler.n_dofs(0));
index fd6b86cea196f11bb94a46e8c02ada96b96cdf0e..66c16704fcb1075307af8bef29553bb8a595c90b 100644 (file)
@@ -160,7 +160,7 @@ check(const FiniteElement<dim> &fe)
   mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary);
 
   MGTransferPrebuilt<Vector<double>> transfer(mg_constrained_dofs);
-  transfer.build_matrices(mg_dof_handler);
+  transfer.build(mg_dof_handler);
 
   FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
                                  mg_dof_handler.n_dofs(0));
index 700ee7d78492264336f3d481d216484cb44b1851..28dc238c5afece3649726cd4ead6faf9b28731de 100644 (file)
@@ -154,8 +154,7 @@ check(const FiniteElement<dim> &fe)
 
   std::vector<unsigned int> block_selected(2, 0U);
   MGTransferSelect<double>  transfer;
-  transfer.build_matrices(
-    mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
+  transfer.build(mg_dof_handler, 0, 0, block_selected, block_selected);
 
   FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
                                  mg_dof_handler.n_dofs(0));
index a504d459340cc082ca48fdd8de0a7da5734dee8d..2f2767a1c39eba084b4fcdad262b6a103c7544f2 100644 (file)
@@ -163,13 +163,8 @@ check(const FiniteElement<dim> &fe)
 
   std::vector<unsigned int> block_selected(2, 0U);
   MGTransferSelect<double>  transfer;
-  transfer.build_matrices(mg_dof_handler,
-                          mg_dof_handler,
-                          0,
-                          0,
-                          block_selected,
-                          block_selected,
-                          boundary_indices);
+  transfer.build(
+    mg_dof_handler, 0, 0, block_selected, block_selected, boundary_indices);
 
   FullMatrix<double> prolong_0_1(mg_dof_handler.n_dofs(1),
                                  mg_dof_handler.n_dofs(0));
index 8318af82bd717ca9c071c5bc9061542d2d638630..e7d45735857631fe92deabbdd9ddeb8fe18bd996 100644 (file)
@@ -157,8 +157,7 @@ check(const FiniteElement<dim> &fe)
   block_selected[0] = 0;
   block_selected[1] = 1;
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(
-    mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
+  transfer.build(mg_dof_handler, 0, 0, block_selected, block_selected);
 
   // use only the first half of all
   // components
index c9804a34e27dd659e9a2afa3b9d82a3f533759fa..82ec612805e12c3f55cc5d9e6a2cba52308ee865 100644 (file)
@@ -165,13 +165,8 @@ check(const FiniteElement<dim> &fe)
   block_selected[0] = 0;
   block_selected[1] = 1;
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(mg_dof_handler,
-                          mg_dof_handler,
-                          0,
-                          0,
-                          block_selected,
-                          block_selected,
-                          boundary_indices);
+  transfer.build(
+    mg_dof_handler, 0, 0, block_selected, block_selected, boundary_indices);
 
   // use only the first half of all
   // components
index da5d56403a0efdfab19b26b8d0bd4724a5e51e0f..89681a91fcebff4509f4acb3dbe0fe501bb1b8db 100644 (file)
@@ -157,8 +157,7 @@ check(const FiniteElement<dim> &fe)
     DoFRenumbering::component_wise(mg_dof_handler, level, block_selected);
 
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(
-    mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
+  transfer.build(mg_dof_handler, 0, 0, block_selected, block_selected);
 
   std::vector<std::vector<types::global_dof_index>> dofs_per_block(
     tr.n_levels(), std::vector<types::global_dof_index>(2));
index 179b12a858ba812227ac28a6bc35fa70f9f86986..6221788444d80eb4e5fe6cb80a4636acedd13237 100644 (file)
@@ -166,13 +166,8 @@ check(const FiniteElement<dim> &fe)
                               boundary_indices);
 
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(mg_dof_handler,
-                          mg_dof_handler,
-                          0,
-                          0,
-                          block_selected,
-                          block_selected,
-                          boundary_indices);
+  transfer.build(
+    mg_dof_handler, 0, 0, block_selected, block_selected, boundary_indices);
 
   std::vector<std::vector<types::global_dof_index>> dofs_per_block(
     tr.n_levels(), std::vector<types::global_dof_index>(2));
index 9954b618b641bca6822060aac06b8f540e0fddad..b8b338406a82aee454863376dc9c27f8b5180f93 100644 (file)
@@ -113,12 +113,11 @@ check(const FiniteElement<dim> &fe, const unsigned int selected_block)
 
   MGTransferSelect<double> transfer;
 
-  transfer.build_matrices(mg_dof_handler,
-                          mg_dof_handler,
-                          selected_block,
-                          selected_block,
-                          block_component,
-                          block_component);
+  transfer.build(mg_dof_handler,
+                 selected_block,
+                 selected_block,
+                 block_component,
+                 block_component);
 
   std::vector<types::global_dof_index> dofs_per_block(3);
   DoFTools::count_dofs_per_block(mg_dof_handler,
index 54a8357b2a0cb67c3501fc0cc52235cefa4cf79d..c41afe3eecba76760bb6650b8474eddedbaa304f 100644 (file)
@@ -81,7 +81,7 @@ check_simple(const FiniteElement<dim> &fe)
   mgdof.distribute_mg_dofs();
 
   MGTransferPrebuilt<TrilinosWrappers::MPI::Vector> transfer;
-  transfer.build_matrices(mgdof);
+  transfer.build(mgdof);
 
   MGLevelObject<TrilinosWrappers::MPI::Vector> u(0, tr.n_levels() - 1);
   reinit_vector(mgdof, u);

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.