From: Peter Munch Date: Fri, 12 Mar 2021 10:38:07 +0000 (+0100) Subject: Add assert that DoFCellAccessor::get/set_mg_dof_indices() X-Git-Tag: v9.3.0-rc1~334^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68ee482d0b4ae66c34000fc6372a7d63c727f713;p=dealii.git Add assert that DoFCellAccessor::get/set_mg_dof_indices() --- 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; }