]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Be explicit about dimension. 10672/head
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 9 Jul 2020 11:29:30 +0000 (13:29 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Thu, 9 Jul 2020 11:29:30 +0000 (13:29 +0200)
include/deal.II/meshworker/mesh_loop.h

index 2c2267de1cc6d3b6dfe643f5a02a0aabd07a3bdc..3c9d143a7e6f7f40fb1baa6378dba8d64518b2d3 100644 (file)
@@ -317,6 +317,9 @@ namespace MeshWorker
       // user.
       copy = sample_copy_data;
 
+      // Store the dimension in which we are working for later use
+      const auto dim = cell->get_triangulation().dimension;
+
       const bool ignore_subdomain =
         (cell->get_triangulation().locally_owned_subdomain() ==
          numbers::invalid_subdomain_id);
@@ -390,10 +393,10 @@ namespace MeshWorker
                 const bool periodic_neighbor =
                   cell->has_periodic_neighbor(face_no);
 
-                if ((!periodic_neighbor &&
-                     cell->neighbor_is_coarser(face_no)) ||
-                    (periodic_neighbor &&
-                     cell->periodic_neighbor_is_coarser(face_no)))
+                if (dim > 1 && ((!periodic_neighbor &&
+                                 cell->neighbor_is_coarser(face_no)) ||
+                                (periodic_neighbor &&
+                                 cell->periodic_neighbor_is_coarser(face_no))))
                   {
                     Assert(cell->is_active(), ExcInternalError());
                     Assert(neighbor->is_active(), ExcInternalError());
@@ -435,8 +438,7 @@ namespace MeshWorker
                                     copy);
                       }
                   }
-                else if (CellIteratorType::AccessorType::dimension == 1 &&
-                         cell->level() > neighbor->level())
+                else if (dim == 1 && cell->level() > neighbor->level())
                   {
                     // In one dimension, there is no other check to do
                     const unsigned int neighbor_face_no =

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.