From 955c7def9130aa8043e3e6f98e0515403027ba74 Mon Sep 17 00:00:00 2001 From: Tileuzhan Mukhamet Date: Mon, 9 Dec 2024 12:50:27 +0100 Subject: [PATCH] Periodicity constraints: skip artificial cell face dofs --- source/dofs/dof_tools_constraints.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 4bc29db45a..b341f166b7 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -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 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 child_transformation(dofs_per_face, dofs_per_face); FullMatrix subface_interpolation(dofs_per_face, dofs_per_face); -- 2.39.5