From 4d98910397d6eeaee18172290c46e5966ef94d03 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 26 Nov 2019 08:43:22 +0100 Subject: [PATCH] Fix bug in access of dof indices without resolving constraints --- include/deal.II/matrix_free/matrix_free.templates.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 9738a7b6be..1ed724377a 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -1547,8 +1547,14 @@ MatrixFree::initialize_indices( ghost_indices.push_back( part.local_to_global(di.dof_indices[i])); + const unsigned int fe_index = di.dofs_per_cell.size() == 1 ? + 0 : + di.cell_active_fe_index[cell]; + const unsigned int dofs_this_cell = + di.dofs_per_cell[fe_index]; + for (unsigned int i = di.row_starts_plain_indices[cell]; - i < di.row_starts_plain_indices[cell + 1]; + i < di.row_starts_plain_indices[cell] + dofs_this_cell; ++i) if (di.plain_dof_indices[i] >= part.local_size()) ghost_indices.push_back( -- 2.39.5