]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify assertion by AssertIndexRange 14062/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 27 Jun 2022 15:52:04 +0000 (17:52 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 27 Jun 2022 15:52:09 +0000 (17:52 +0200)
include/deal.II/dofs/dof_objects.h

index 151ba7551b80ccfa39fe2414a5d9462effb080ba..c9c3444fdd2b9235be27bb0698a0fc9966f0b225 100644 (file)
@@ -182,20 +182,16 @@ namespace internal
       const unsigned int                          local_index)
     {
       (void)fe_index;
-      Assert(
-        (fe_index == dealii::DoFHandler<dh_dim, spacedim>::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<dim>(),
-        ExcIndexRange(local_index,
-                      0,
-                      dof_handler.get_fe().template n_dofs_per_object<dim>()));
-      Assert(obj_index *
-                   dof_handler.get_fe().template n_dofs_per_object<dim>() +
-                 local_index <
-               dofs.size(),
-             ExcInternalError());
+      Assert((fe_index ==
+              dealii::DoFHandler<dh_dim, spacedim>::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<dim>());
+      AssertIndexRange(
+        obj_index * dof_handler.get_fe().template n_dofs_per_object<dim>() +
+          local_index,
+        dofs.size());
 
       return dofs[obj_index *
                     dof_handler.get_fe().template n_dofs_per_object<dim>() +

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.