]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Periodicity constraints: skip artificial cell face dofs
authorTileuzhan Mukhamet <tileuzhan.mukhamet@rub.de>
Mon, 9 Dec 2024 11:50:27 +0000 (12:50 +0100)
committerTileuzhan Mukhamet <tileuzhan.mukhamet@rub.de>
Mon, 9 Dec 2024 13:34:58 +0000 (14:34 +0100)
source/dofs/dof_tools_constraints.cc

index 4bc29db45a0d09e7ed7641fb135eedcbbdbb2b4b..b341f166b718fe100d09600f7dac4b601573d6cd 100644 (file)
@@ -3146,6 +3146,17 @@ namespace DoFTools
           const unsigned int dofs_per_face =
             face_1->get_fe(face_1->nth_active_fe_index(0))
               .n_dofs_per_face(face_no);
+
+          // Skip further recursion if face_1 carries invalid dof indices,
+          // i.e., it is on an artificial cell.
+          std::vector<types::global_dof_index> dofs_1(dofs_per_face);
+          face_1->get_dof_indices(dofs_1, face_1->nth_active_fe_index(0));
+          for (unsigned int i = 0; i < dofs_per_face; ++i)
+            if (dofs_1[i] == numbers::invalid_dof_index)
+              {
+                return;
+              }
+
           FullMatrix<double> child_transformation(dofs_per_face, dofs_per_face);
           FullMatrix<double> subface_interpolation(dofs_per_face,
                                                    dofs_per_face);

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.