From 37ed3c48b6de584fc945f528b93f42268671e987 Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 17 May 2018 18:00:42 -0400 Subject: [PATCH] Exit a function early if there are no DoFs. 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 0ce19502a8..b584743738 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -2832,11 +2832,12 @@ namespace internal void update_cell_dof_indices_cache (const DoFCellAccessor, 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 -- 2.39.5