From: Peter Munch Date: Wed, 9 Dec 2020 09:49:15 +0000 (+0100) Subject: Check reference-cell type of cell and FE X-Git-Tag: v9.3.0-rc1~784^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11346%2Fhead;p=dealii.git Check reference-cell type of cell and FE --- diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 315152b8b8..b564ce783c 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -2757,7 +2757,14 @@ DoFCellAccessor::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; }