From a28a859c48cb715edd545f762fcd9854e7a2be59 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Sat, 12 Aug 2017 10:30:29 -0600 Subject: [PATCH] Make sure interfaces of CellAccessor and DoFCellAccessor match. --- include/deal.II/grid/tria_accessor.h | 5 +++++ include/deal.II/grid/tria_accessor.templates.h | 7 +++++++ include/deal.II/meshworker/mesh_loop.h | 12 ++++++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index dc5531a534..b8bb58f7e1 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -2613,6 +2613,11 @@ public: */ unsigned int neighbor_face_no (const unsigned int neighbor) const; + /** + * Compatibility interface with DoFCellAccessor. Returns always false. + */ + static bool is_level_cell(); + /** * @} */ diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 6529d22ab9..9bcac428b4 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -3679,6 +3679,13 @@ CellAccessor::neighbor_face_no (const unsigned int neighbor) const +template +inline +bool +CellAccessor::is_level_cell() +{ + return false; +} DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/meshworker/mesh_loop.h b/include/deal.II/meshworker/mesh_loop.h index 2036c7ded4..63dfe3ca99 100644 --- a/include/deal.II/meshworker/mesh_loop.h +++ b/include/deal.II/meshworker/mesh_loop.h @@ -73,9 +73,9 @@ namespace MeshWorker const bool ignore_subdomain = (cell->get_triangulation().locally_owned_subdomain() == numbers::invalid_subdomain_id); - types::subdomain_id current_subdomain_id = /*(cell->is_level_cell()) - ? cell->level_subdomain_id() - : */cell->subdomain_id(); + types::subdomain_id current_subdomain_id = (cell->is_level_cell() + ? cell->level_subdomain_id() + : cell->subdomain_id()); const bool own_cell = ignore_subdomain || (current_subdomain_id == cell->get_triangulation().locally_owned_subdomain()); @@ -105,10 +105,10 @@ namespace MeshWorker TriaIterator neighbor = cell->neighbor_or_periodic_neighbor(face_no); types::subdomain_id neighbor_subdomain_id = numbers::artificial_subdomain_id; -// if (neighbor->is_level_cell()) -// neighbid = neighbor->level_subdomain_id(); + if (neighbor->is_level_cell()) + neighbor_subdomain_id = neighbor->level_subdomain_id(); //subdomain id is only valid for active cells - /*else */if (neighbor->active()) + else if (neighbor->active()) neighbor_subdomain_id = neighbor->subdomain_id(); const bool own_neighbor = ignore_subdomain || -- 2.39.5