From df1c6f35908eed836934c1b783884f5a885ca07e Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Wed, 9 Dec 2020 10:49:15 +0100 Subject: [PATCH] Check reference-cell type of cell and FE --- include/deal.II/dofs/dof_accessor.templates.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- 2.39.5