]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix step-75: Call `get_fe()` only on locally owned cells. 12367/head
authorMarc Fehling <mafehling.git@gmail.com>
Mon, 31 May 2021 17:59:25 +0000 (11:59 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Mon, 31 May 2021 18:11:09 +0000 (12:11 -0600)
examples/step-75/step-75.cc

index 1c4f4691652f75dcf6277980ace0544ac1730836..b946d3455a093d54466ce19e50898460260fb13a 100644 (file)
@@ -745,17 +745,20 @@ namespace Step75
             auto cell_other = dof_handler_fine.begin_active();
             for (auto &cell : dof_handler_coarse.active_cell_iterators())
               {
-                const unsigned int next_degree =
-                  MGTransferGlobalCoarseningTools::
-                    create_next_polynomial_coarsening_degree(
-                      cell_other->get_fe().degree, mg_data.transfer.p_sequence);
-                Assert(fe_index_for_degree.find(next_degree) !=
-                         fe_index_for_degree.end(),
-                       ExcMessage("Next polynomial degree in sequence "
-                                  "does not exist in FECollection."));
-
                 if (cell->is_locally_owned())
-                  cell->set_active_fe_index(fe_index_for_degree[next_degree]);
+                  {
+                    const unsigned int next_degree =
+                      MGTransferGlobalCoarseningTools::
+                        create_next_polynomial_coarsening_degree(
+                          cell_other->get_fe().degree,
+                          mg_data.transfer.p_sequence);
+                    Assert(fe_index_for_degree.find(next_degree) !=
+                             fe_index_for_degree.end(),
+                           ExcMessage("Next polynomial degree in sequence "
+                                      "does not exist in FECollection."));
+
+                    cell->set_active_fe_index(fe_index_for_degree[next_degree]);
+                  }
                 cell_other++;
               }
           }

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.