]> https://gitweb.dealii.org/ - dealii.git/commitdiff
squashing commits 17926/head
authorSean Johnson <sljohnson11@gmail.com>
Tue, 28 Jan 2025 20:48:36 +0000 (13:48 -0700)
committerSean Johnson <sljohnson11@gmail.com>
Tue, 28 Jan 2025 20:48:36 +0000 (13:48 -0700)
include/deal.II/matrix_free/face_setup_internal.h

index 6fe9850926a620c5abd811c85624e613360e7f6d..0f79808ae1320f189ea5a402288c5f182c9a53e9 100644 (file)
@@ -810,8 +810,11 @@ namespace internal
                       {
                         typename dealii::Triangulation<dim>::cell_iterator
                           neighbor = dcell->neighbor_or_periodic_neighbor(f);
-                        if (use_active_cells && neighbor->has_children())
+                        if (use_active_cells && neighbor->has_children() &&
+                            dim > 1)
                           {
+                            // dim > 1 because face()->n_children() = 0 when dim
+                            // == 1
                             for (unsigned int c = 0;
                                  c < dcell->face(f)->n_children();
                                  ++c)
@@ -879,6 +882,62 @@ namespace internal
                                   }
                               }
                           }
+                        else if (dim == 1)
+                          {
+                            // Follow much the same procedure of dim > 1 with
+                            // one large exception: Face is created on first
+                            // visitation as long as neighbor has no children
+                            // face_visited is used as a flag that a face has
+                            // already been created
+                            if (face_visited[dcell->face(f)->index()] == 0 &&
+                                !(neighbor->has_children()))
+                              {
+                                std::pair<unsigned int, unsigned int>
+                                  level_index(neighbor->level(),
+                                              neighbor->index());
+                                if (face_is_owned[dcell->face(f)->index()] ==
+                                    FaceCategory::locally_active_done_here)
+                                  {
+                                    Assert(use_active_cells ||
+                                             dcell->level() ==
+                                               neighbor->level(),
+                                           ExcInternalError());
+                                    ++inner_counter;
+                                    inner_faces.push_back(create_face(
+                                      f,
+                                      dcell,
+                                      cell,
+                                      neighbor,
+                                      map_to_vectorized[level_index],
+                                      is_mixed_mesh));
+                                    face_visited[dcell->face(f)->index()] = 1;
+                                  }
+                                else if (face_is_owned[dcell->face(f)
+                                                         ->index()] ==
+                                         FaceCategory::ghosted)
+                                  {
+                                    inner_ghost_faces.push_back(create_face(
+                                      f,
+                                      dcell,
+                                      cell,
+                                      neighbor,
+                                      map_to_vectorized[level_index],
+                                      is_mixed_mesh));
+                                    face_visited[dcell->face(f)->index()] = 1;
+                                  }
+                              }
+                            if (face_is_owned[dcell->face(f)->index()] ==
+                                FaceCategory::multigrid_refinement_edge)
+                              {
+                                refinement_edge_faces.push_back(
+                                  create_face(f,
+                                              dcell,
+                                              cell,
+                                              neighbor,
+                                              refinement_edge_faces.size(),
+                                              is_mixed_mesh));
+                              }
+                          }
                         else
                           {
                             const types::subdomain_id my_domain =
@@ -995,7 +1054,8 @@ namespace internal
             info.subface_index =
               cell->periodic_neighbor_of_coarser_periodic_neighbor(face_no)
                 .second;
-          else
+          // else if must be dim > 1 because dim == 1 adm creates no subfaces
+          else if (dim > 1)
             info.subface_index =
               cell->neighbor_of_coarser_neighbor(face_no).second;
         }

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.