From 4d99dd68a056082f9fba97e17c43db7a73315362 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 29 Jun 2022 09:48:01 +0200 Subject: [PATCH] Add assertions for fe_index in MG case --- include/deal.II/dofs/dof_accessor.templates.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index fdbb395ddf..982da7e0a0 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -997,11 +997,15 @@ namespace internal const dealii::DoFAccessor & accessor, const DoFIndicesType &const_dof_indices, - const unsigned int fe_index, + const unsigned int fe_index_, const DoFOperation & dof_operation, const DoFProcessor & dof_processor, const bool count_level_dofs) { + const unsigned int fe_index = + internal::DoFAccessorImplementation::get_fe_index_or_default( + accessor, fe_index_); + // we cannot rely on the template parameter level_dof_access here, since // the function get_mg_dof_indices()/set_mg_dof_indices() can be called // even if level_dof_access==false. @@ -1337,6 +1341,8 @@ namespace internal std::vector &dof_indices, const unsigned int fe_index) { + Assert((fe_index == DoFHandler::default_fe_index), + ExcMessage("MG DoF indices cannot be queried in hp case")); process_dof_indices( accessor, dof_indices, @@ -1357,6 +1363,9 @@ namespace internal const std::vector &dof_indices, const unsigned int fe_index) { + Assert((fe_index == DoFHandler::default_fe_index), + ExcMessage("MG DoF indices cannot be queried in hp case")); + // Note: this function is as general as `get_mg_dof_indices()`. This // assert is placed here since it is currently only used by the // function DoFCellAccessor::set_mg_dof_indices(), which is called by -- 2.39.5