]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify access to number of raw objects 13946/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 9 Jun 2022 09:35:08 +0000 (11:35 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 9 Jun 2022 09:35:08 +0000 (11:35 +0200)
include/deal.II/grid/grid_tools.h
include/deal.II/grid/tria_objects.h

index d5a2f79661e73661399c9c43a93a722fe7c3a8ee..e0cff7a5b29fd931cf815eabe30f1e4b6544e5e2 100644 (file)
@@ -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(); });
index f69ab9adad1f06b8e0737aba8f3a6a3e851cee51..0cebb2a953d3cd9ae21dd61b4555fcf5ec492a27 100644 (file)
@@ -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();
     }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.