]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check reference-cell type of cell and FE 11346/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 9 Dec 2020 09:49:15 +0000 (10:49 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Wed, 9 Dec 2020 09:49:15 +0000 (10:49 +0100)
include/deal.II/dofs/dof_accessor.templates.h

index 315152b8b83b2ab405c28ae7dfaa138be6c030a5..b564ce783c05186724608566c7e633b26e752485 100644 (file)
@@ -2757,7 +2757,14 @@ DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::get_fe() const
            "associated with active cells. Consequently, you can not ask "
            "for the active finite element on cells with children."));
 
-  return this->dof_handler->get_fe(active_fe_index());
+  const auto &fe = this->dof_handler->get_fe(active_fe_index());
+
+  Assert(
+    this->reference_cell_type() == fe.reference_cell_type(),
+    ExcMessage(
+      "The reference-cell type of the cell does not match the one of the finite element!"));
+
+  return fe;
 }
 
 

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.