]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add assertions. 13287/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 24 Jan 2022 19:07:32 +0000 (12:07 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 26 Jan 2022 18:34:00 +0000 (11:34 -0700)
source/grid/tria.cc

index 3547f4512347d470f20baadf2dc1b1ce4fc67ff7..d165aa24a2cf4ebb7e87daa4e182cb15d46c9a76 100644 (file)
@@ -5134,13 +5134,26 @@ namespace internal
                       Assert(false, ExcInternalError());
                     }
 
+                  // Also check whether we have to refine any of the faces and
+                  // edges that bound this cell. They may of course already be
+                  // refined, so we only *mark* them for refinement by setting
+                  // the user flags
                   for (const auto face : cell->face_indices())
-                    if (cell->face(face)->number_of_children() < 4)
+                    if (cell->face(face)->n_children() == 0)
                       cell->face(face)->set_user_flag();
+                    else
+                      Assert(cell->face(face)->n_children() ==
+                               cell->reference_cell()
+                                 .face_reference_cell(face)
+                                 .n_isotropic_children(),
+                             ExcInternalError());
 
                   for (const auto line : cell->line_indices())
                     if (cell->line(line)->has_children() == false)
                       cell->line(line)->set_user_flag();
+                    else
+                      Assert(cell->line(line)->n_children() == 2,
+                             ExcInternalError());
                 }
 
             const unsigned int used_cells =

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.