]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix FE_Nothing in global coarsening p-transfer 15340/head
authorSebastian Proell <sebastian.proell@tum.de>
Sun, 11 Jun 2023 12:36:45 +0000 (14:36 +0200)
committerSebastian Proell <sebastian.proell@tum.de>
Tue, 13 Jun 2023 07:30:42 +0000 (09:30 +0200)
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h

index e006b130fd00bb29d3ddcc3350358bfbfd8b64eb..f2c77c7d51237e460b7686382da24dff358c5722 100644 (file)
@@ -2673,8 +2673,13 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
         (scheme.prolongation_matrix.size() == 0 &&
          scheme.prolongation_matrix_1d.size() == 0) == false;
 
-      evaluation_data_fine.resize(scheme.n_dofs_per_cell_fine);
-      evaluation_data_coarse.resize(scheme.n_dofs_per_cell_fine);
+      evaluation_data_fine.clear();
+      evaluation_data_coarse.clear();
+
+      const unsigned int max_n_dofs_per_cell =
+        std::max(scheme.n_dofs_per_cell_fine, scheme.n_dofs_per_cell_coarse);
+      evaluation_data_fine.resize(max_n_dofs_per_cell);
+      evaluation_data_coarse.resize(max_n_dofs_per_cell);
 
       CellTransferFactory cell_transfer(scheme.degree_fine,
                                         scheme.degree_coarse);
@@ -2844,8 +2849,13 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
         (scheme.prolongation_matrix.size() == 0 &&
          scheme.prolongation_matrix_1d.size() == 0) == false;
 
-      evaluation_data_fine.resize(scheme.n_dofs_per_cell_fine);
-      evaluation_data_coarse.resize(scheme.n_dofs_per_cell_fine);
+      evaluation_data_fine.clear();
+      evaluation_data_coarse.clear();
+
+      const unsigned int max_n_dofs_per_cell =
+        std::max(scheme.n_dofs_per_cell_fine, scheme.n_dofs_per_cell_coarse);
+      evaluation_data_fine.resize(max_n_dofs_per_cell);
+      evaluation_data_coarse.resize(max_n_dofs_per_cell);
 
       CellTransferFactory cell_transfer(scheme.degree_fine,
                                         scheme.degree_coarse);

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.