From d1184093c7f48039d937ed92e4c4c6201da58099 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Thu, 9 Jul 2020 13:29:30 +0200 Subject: [PATCH] Be explicit about dimension. --- include/deal.II/meshworker/mesh_loop.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/deal.II/meshworker/mesh_loop.h b/include/deal.II/meshworker/mesh_loop.h index 2c2267de1c..3c9d143a7e 100644 --- a/include/deal.II/meshworker/mesh_loop.h +++ b/include/deal.II/meshworker/mesh_loop.h @@ -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 = -- 2.39.5