]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use new transfer type in benchmark
authorMartin Kronbichler <martin.kronbichler@rub.de>
Wed, 26 Jun 2024 20:14:57 +0000 (22:14 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Thu, 18 Jul 2024 09:44:50 +0000 (11:44 +0200)
tests/performance/timing_mg_glob_coarsen.cc

index 5134f49f9577e0ec833fa95694d8c8c73ce9003a..5e900aada6698af06f9344f25f90a53cee4065e9 100644 (file)
@@ -402,7 +402,8 @@ private:
     PreconditionChebyshev<LaplaceOperator<dim, float>, VectorTypeMG>;
   mg::SmootherRelaxation<SmootherType, VectorTypeMG> mg_smoother;
 
-  MGLevelObject<MGTwoLevelTransfer<dim, VectorTypeMG>>           mg_transfers;
+  MGLevelObject<std::unique_ptr<MGTwoLevelTransferBase<VectorTypeMG>>>
+                                                                 mg_transfers;
   std::unique_ptr<MGTransferGlobalCoarsening<dim, VectorTypeMG>> mg_transfer;
 };
 
@@ -621,10 +622,19 @@ LaplaceProblem<dim>::setup_transfer()
   mg_transfers.resize(0, dof_handlers.max_level());
   for (unsigned int level = 1; level <= dof_handlers.max_level(); ++level)
     {
-      mg_transfers[level].reinit(dof_handlers[level],
-                                 dof_handlers[level - 1],
-                                 level_constraints[level],
-                                 level_constraints[level - 1]);
+      auto transfer = std::make_unique<MGTwoLevelTransfer<dim, VectorTypeMG>>();
+      if (level < triangulation.n_global_levels())
+        transfer->reinit(dof_handlers[level],
+                         dof_handlers[level - 1],
+                         level_constraints[level],
+                         level_constraints[level - 1]);
+      else
+        transfer->reinit(level_matrices[level].get_matrix_free(),
+                         0,
+                         level_matrices[level - 1].get_matrix_free(),
+                         0);
+
+      mg_transfers[level] = std::move(transfer);
     }
 
   mg_transfer = std::make_unique<MGTransferGlobalCoarsening<dim, VectorTypeMG>>(

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.