From: David Wells <drwells@email.unc.edu>
Date: Sat, 6 Apr 2024 17:15:47 +0000 (-0400)
Subject: execute_refinement_isotropic(): Add a loop.
X-Git-Tag: v9.6.0-rc1~382^2~5
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ce5d99b65feb3c3c263fc7f7d6af676d4c02162;p=dealii.git

execute_refinement_isotropic(): Add a loop.
---

diff --git a/source/grid/tria.cc b/source/grid/tria.cc
index 473c0c64b1..dc080be1e3 100644
--- a/source/grid/tria.cc
+++ b/source/grid/tria.cc
@@ -5078,21 +5078,17 @@ namespace internal
                 children[1]->set_bounding_object_indices(
                   {next_unused_vertex, line->vertex_index(1)});
 
-                children[0]->set_used_flag();
-                children[1]->set_used_flag();
-                children[0]->clear_children();
-                children[1]->clear_children();
-                children[0]->clear_user_data();
-                children[1]->clear_user_data();
-                children[0]->clear_user_flag();
-                children[1]->clear_user_flag();
-
-
-                children[0]->set_boundary_id_internal(line->boundary_id());
-                children[1]->set_boundary_id_internal(line->boundary_id());
-
-                children[0]->set_manifold_id(line->manifold_id());
-                children[1]->set_manifold_id(line->manifold_id());
+                for (auto &child : children)
+                  {
+                    child->set_used_flag();
+                    child->clear_children();
+                    child->clear_user_data();
+                    child->clear_user_flag();
+                    child->set_boundary_id_internal(line->boundary_id());
+                    child->set_manifold_id(line->manifold_id());
+                    // Line orientation is relative to the cell it is on so
+                    // those cannot be set at this point.
+                  }
 
                 line->clear_user_flag();
               }