From 68ee482d0b4ae66c34000fc6372a7d63c727f713 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 12 Mar 2021 11:38:07 +0100 Subject: [PATCH] Add assert that DoFCellAccessor::get/set_mg_dof_indices() --- include/deal.II/dofs/dof_accessor.templates.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 7abbbc79d1..17c60389a7 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -1337,7 +1337,8 @@ namespace internal Assert( dim == structdim, ExcMessage( - "This function is intended to be used for DoFCellAccessor, i.e., dimension == structdim.")); + "This function is intended to be used for DoFCellAccessor, i.e., " + "dimension == structdim.")); process_dof_indices( accessor, @@ -2600,6 +2601,9 @@ inline void DoFCellAccessor:: get_mg_dof_indices(std::vector &dof_indices) const { + Assert(this->dof_handler->mg_vertex_dofs.size() > 0, + ExcMessage("Multigrid DoF indices can only be accessed after " + "DoFHandler::distribute_mg_dofs() has been called!")); DoFAccessor:: get_mg_dof_indices(this->level(), dof_indices); } @@ -2611,6 +2615,9 @@ inline void DoFCellAccessor:: set_mg_dof_indices(const std::vector &dof_indices) { + Assert(this->dof_handler->mg_vertex_dofs.size() > 0, + ExcMessage("Multigrid DoF indices can only be accessed after " + "DoFHandler::distribute_mg_dofs() has been called!")); DoFAccessor:: set_mg_dof_indices(this->level(), dof_indices); } @@ -2759,10 +2766,10 @@ DoFCellAccessor::get_fe() const const auto &fe = this->dof_handler->get_fe(active_fe_index()); - Assert( - this->reference_cell() == fe.reference_cell(), - ExcMessage( - "The reference-cell type of the cell does not match the one of the finite element!")); + Assert(this->reference_cell() == fe.reference_cell(), + ExcMessage( + "The reference-cell type of the cell does not match the one of the " + "finite element!")); return fe; } -- 2.39.5