From 19c37844cab9a8f9b3acac3693f7b5db12a1508c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 13 Apr 2023 15:08:55 -0600 Subject: [PATCH] Add a check and produce better errors in FEInterfaceValues::reinit(). --- include/deal.II/fe/fe_interface_values.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/deal.II/fe/fe_interface_values.h b/include/deal.II/fe/fe_interface_values.h index 27493ef784..f91695e57f 100644 --- a/include/deal.II/fe/fe_interface_values.h +++ b/include/deal.II/fe/fe_interface_values.h @@ -2495,6 +2495,24 @@ FEInterfaceValues::reinit( internal_hp_fe_face_values->get_fe_collection().find_dominated_fe( {cell->active_fe_index(), cell_neighbor->active_fe_index()}); + if (q_index == numbers::invalid_unsigned_int) + Assert(dominated_fe_index != numbers::invalid_fe_index, + ExcMessage("You called this function with 'q_index' left at its " + "default value, but this can only work if one of " + "the two finite elements adjacent to this face " + "dominates the other. See the documentation " + "of this function for more information of how " + "to deal with this situation.")); + if (mapping_index == numbers::invalid_unsigned_int) + Assert(dominated_fe_index != numbers::invalid_fe_index, + ExcMessage("You called this function with 'mapping_index' left " + "at its default value, but this can only work if one " + "of the two finite elements adjacent to this face " + "dominates the other. See the documentation " + "of this function for more information of how " + "to deal with this situation.")); + + const unsigned int used_q_index = (q_index == numbers::invalid_unsigned_int ? dominated_fe_index : q_index); -- 2.39.5