From: David Wells Date: Thu, 17 Apr 2025 17:29:44 +0000 (-0400) Subject: MatrixFree: refactor a face setup routine. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18362%2Fhead;p=dealii.git MatrixFree: refactor a face setup routine. --- diff --git a/include/deal.II/matrix_free/face_setup_internal.h b/include/deal.II/matrix_free/face_setup_internal.h index 37a8ebc16c..6435a93896 100644 --- a/include/deal.II/matrix_free/face_setup_internal.h +++ b/include/deal.II/matrix_free/face_setup_internal.h @@ -1071,37 +1071,39 @@ namespace internal .get_periodic_face_map() .at({cell, face_no}) .second; - - return info; - } - - info.face_orientation = 0; - const auto interior_face_orientation = - cell->combined_face_orientation(face_no); - const auto exterior_face_orientation = - neighbor->combined_face_orientation(info.exterior_face_no); - if (interior_face_orientation != numbers::default_geometric_orientation) - { - info.face_orientation = 8 + interior_face_orientation; - Assert( - exterior_face_orientation == numbers::default_geometric_orientation, - ExcMessage("Face seems to be wrongly oriented from both sides")); } else - info.face_orientation = exterior_face_orientation; - - // make sure to select correct subface index in case of non-standard - // orientation of the coarser neighbor face - if (cell->level() > neighbor->level() && exterior_face_orientation > 0) { - const Table<2, unsigned int> orientation = - ShapeInfo::compute_orientation_table(2); - const auto face_reference_cell = - cell->face(face_no)->reference_cell(); - info.subface_index = - orientation(face_reference_cell.get_inverse_combined_orientation( - exterior_face_orientation), - info.subface_index); + const auto interior_face_orientation = + cell->combined_face_orientation(face_no); + const auto exterior_face_orientation = + neighbor->combined_face_orientation(info.exterior_face_no); + if (interior_face_orientation != + numbers::default_geometric_orientation) + { + info.face_orientation = 8 + interior_face_orientation; + Assert(exterior_face_orientation == + numbers::default_geometric_orientation, + ExcMessage( + "Face seems to be wrongly oriented from both sides")); + } + else + info.face_orientation = exterior_face_orientation; + + // make sure to select correct subface index in case of non-standard + // orientation of the coarser neighbor face + if (cell->level() > neighbor->level() && + exterior_face_orientation > 0) + { + const Table<2, unsigned int> orientation = + ShapeInfo::compute_orientation_table(2); + const auto face_reference_cell = + cell->face(face_no)->reference_cell(); + info.subface_index = orientation( + face_reference_cell.get_inverse_combined_orientation( + exterior_face_orientation), + info.subface_index); + } } return info;