From: Martin Kronbichler Date: Thu, 9 Jun 2022 09:35:08 +0000 (+0200) Subject: Simplify access to number of raw objects X-Git-Tag: v9.5.0-rc1~1197^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfc2d5a01ab949ffb25ea4de3360ee7861fd3ed5;p=dealii.git Simplify access to number of raw objects --- 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(); }