From bfc2d5a01ab949ffb25ea4de3360ee7861fd3ed5 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 9 Jun 2022 11:35:08 +0200 Subject: [PATCH] Simplify access to number of raw objects --- include/deal.II/grid/grid_tools.h | 4 +--- include/deal.II/grid/tria_objects.h | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index d5a2f79661..e0cff7a5b2 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -4669,9 +4669,7 @@ namespace GridTools cell_filter, [&](const auto &process) { for (const auto &cell : mesh.cell_iterators()) - if (cell->level_subdomain_id() != - dealii::numbers::artificial_subdomain_id && - !cell->is_locally_owned_on_level()) + if (cell->is_ghost_on_level()) process(cell, cell->level_subdomain_id()); }, [](const auto &tria) { return tria.level_ghost_owners(); }); diff --git a/include/deal.II/grid/tria_objects.h b/include/deal.II/grid/tria_objects.h index f69ab9adad..0cebb2a953 100644 --- a/include/deal.II/grid/tria_objects.h +++ b/include/deal.II/grid/tria_objects.h @@ -373,9 +373,10 @@ namespace internal inline unsigned int TriaObjects::n_objects() const { - // assume that each cell has the same number of faces - const unsigned int faces_per_cell = 2 * this->structdim; - return cells.size() / faces_per_cell; + // ensure that sizes are consistent, and then return one that + // corresponds to the number of objects + AssertDimension(cells.size(), manifold_id.size() * 2 * this->structdim); + return manifold_id.size(); } -- 2.39.5