From 372c81dc1f6bd13f26a49fa3d2d248714af3259d Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 7 Nov 2020 18:22:50 +0100 Subject: [PATCH] Fix compute_shared_memory_contiguous_indices --- include/deal.II/matrix_free/matrix_free.templates.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 311f8b8a74..03f224613c 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -1553,8 +1553,9 @@ MatrixFree::initialize_indices( const auto cell_iterator = get_cell_iterator(cell, v, di_index); // determine global cell index - const unsigned int local_dof_index = - di.dof_indices_contiguous[2][index]; + const unsigned int local_cell_index = + di.dof_indices_contiguous[2][index] / + this->get_dofs_per_cell(di_index); const types::global_cell_index global_cell_index = (additional_data.mg_level == numbers::invalid_unsigned_int) ? @@ -1567,7 +1568,8 @@ MatrixFree::initialize_indices( if (cell < n_cell_batches()) { // locally-owned cell - cells_locally_owned.emplace_back(index, global_cell_index); + cells_locally_owned.emplace_back(local_cell_index, + global_cell_index); } else { @@ -1595,8 +1597,7 @@ MatrixFree::initialize_indices( } // write back result - cells[cell * n_lanes + v] = { - sm_rank, local_dof_index / this->get_dofs_per_cell(di_index)}; + cells[cell * n_lanes + v] = {sm_rank, local_cell_index}; } std::sort(cells_locally_owned.begin(), -- 2.39.5