From: Martin Kronbichler Date: Mon, 27 Jun 2022 15:52:04 +0000 (+0200) Subject: Simplify assertion by AssertIndexRange X-Git-Tag: v9.5.0-rc1~1145^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14062%2Fhead;p=dealii.git Simplify assertion by AssertIndexRange --- diff --git a/include/deal.II/dofs/dof_objects.h b/include/deal.II/dofs/dof_objects.h index 151ba7551b..c9c3444fdd 100644 --- a/include/deal.II/dofs/dof_objects.h +++ b/include/deal.II/dofs/dof_objects.h @@ -182,20 +182,16 @@ namespace internal const unsigned int local_index) { (void)fe_index; - Assert( - (fe_index == dealii::DoFHandler::default_fe_index), - ExcMessage( - "Only the default FE index is allowed for non-hp-DoFHandler objects")); - Assert( - local_index < dof_handler.get_fe().template n_dofs_per_object(), - ExcIndexRange(local_index, - 0, - dof_handler.get_fe().template n_dofs_per_object())); - Assert(obj_index * - dof_handler.get_fe().template n_dofs_per_object() + - local_index < - dofs.size(), - ExcInternalError()); + Assert((fe_index == + dealii::DoFHandler::default_fe_index), + ExcMessage("Only the default FE index is allowed for DoFHandler " + "objects without hp capability")); + AssertIndexRange(local_index, + dof_handler.get_fe().template n_dofs_per_object()); + AssertIndexRange( + obj_index * dof_handler.get_fe().template n_dofs_per_object() + + local_index, + dofs.size()); return dofs[obj_index * dof_handler.get_fe().template n_dofs_per_object() +