From: Wolfgang Bangerth Date: Thu, 13 Apr 2023 21:08:55 +0000 (-0600) Subject: Add a check and produce better errors in FEInterfaceValues::reinit(). X-Git-Tag: v9.5.0-rc1~330^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19c37844cab9a8f9b3acac3693f7b5db12a1508c;p=dealii.git Add a check and produce better errors in FEInterfaceValues::reinit(). --- 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);