]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a check and produce better errors in FEInterfaceValues::reinit().
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 13 Apr 2023 21:08:55 +0000 (15:08 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 13 Apr 2023 21:08:55 +0000 (15:08 -0600)
include/deal.II/fe/fe_interface_values.h

index 27493ef784be10e5bf800c680d1f317acac7359f..f91695e57f00d7ce317622028cdd5c1221b95ccd 100644 (file)
@@ -2495,6 +2495,24 @@ FEInterfaceValues<dim, spacedim>::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);

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.