From: Luca Heltai Date: Sat, 12 Aug 2017 16:30:29 +0000 (-0600) Subject: Make sure interfaces of CellAccessor and DoFCellAccessor match. X-Git-Tag: v9.0.0-rc1~1271^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a28a859c48cb715edd545f762fcd9854e7a2be59;p=dealii.git Make sure interfaces of CellAccessor and DoFCellAccessor match. --- 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 ||