]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Exit a function early if there are no DoFs. 6621/head
authorDavid Wells <wellsd2@rpi.edu>
Thu, 17 May 2018 22:00:42 +0000 (18:00 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Thu, 17 May 2018 22:00:42 +0000 (18:00 -0400)
The debug mode of glibc complains that, with FE_Nothing, we end up doing
an invalid array access below. Avoid that by returning early if there is
nothing to do anyway.

include/deal.II/dofs/dof_accessor.templates.h

index 0ce19502a854729148ca638aa96e38dd36788764..b5847437388b43a53849d7c6c9d151aa75b1b235 100644 (file)
@@ -2832,11 +2832,12 @@ namespace internal
       void
       update_cell_dof_indices_cache (const DoFCellAccessor<dealii::hp::DoFHandler<dim,spacedim>, level_dof_access> &accessor)
       {
-        // caches are only for cells with DoFs, i.e., for active ones
+        // caches are only for cells with DoFs, i.e., for active ones and not FE_Nothing
         if (accessor.has_children())
           return;
-
         const unsigned int dofs_per_cell = accessor.get_fe().dofs_per_cell;
+        if (dofs_per_cell == 0)
+          return;
 
         // make sure the cache is at least
         // as big as we need it when

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.