]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MatrixFree: Do not construct hanging nodes structure for non-adapted meshes 13872/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Tue, 31 May 2022 11:17:00 +0000 (13:17 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 1 Jun 2022 09:32:34 +0000 (11:32 +0200)
include/deal.II/matrix_free/hanging_nodes_internal.h

index c946ad43398e19d4cbfebc0307243aa80f47c395..d7bfbb3143b74dfbb788ece2fa13352f75bc6a1f 100644 (file)
@@ -376,6 +376,17 @@ namespace internal
     inline void
     HangingNodes<3>::setup_line_to_cell(const Triangulation<3> &triangulation)
     {
+      // Check if we there are no hanging nodes on the current MPI process,
+      // which we do by checking if the second finest level holds no active
+      // non-artificial cell
+      if (triangulation.n_levels() <= 1 ||
+          std::none_of(triangulation.begin_active(triangulation.n_levels() - 2),
+                       triangulation.end_active(triangulation.n_levels() - 2),
+                       [](const CellAccessor<3, 3> &cell) {
+                         return !cell.is_artificial();
+                       }))
+        return;
+
       const unsigned int n_raw_lines = triangulation.n_raw_lines();
       this->line_to_cells.resize(n_raw_lines);
 

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.