From faa850a0b94b59a38cb7a65ad2b836fdd12ed0f9 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 7 May 2020 17:08:18 +0200 Subject: [PATCH] Fix bug in FEFaceEvaluation::read_dof_values_plain --- include/deal.II/matrix_free/fe_evaluation.h | 65 +++++---------------- 1 file changed, 15 insertions(+), 50 deletions(-) diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 838565b81a..217ae6f242 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3983,53 +3983,30 @@ FEEvaluationBase:: operation.process_empty(values_dofs[comp][i]); for (unsigned int v = 0; v < n_vectorization_actual; ++v) { - unsigned int index_indicators, next_index_indicators; + const unsigned int cell_index = is_face ? cells[v] : cell * n_lanes + v; + const unsigned int cell_dof_index = + cell_index * n_fe_components + first_selected_component; const unsigned int n_components_read = n_fe_components > 1 ? n_components : 1; - if (is_face) - { - index_indicators = dof_info - ->row_starts[cells[v] * n_fe_components + - first_selected_component] - .second; - next_index_indicators = dof_info - ->row_starts[cells[v] * n_fe_components + - first_selected_component + 1] - .second; - } - else - { - index_indicators = - dof_info - ->row_starts[(cell * n_lanes + v) * n_fe_components + - first_selected_component] - .second; - next_index_indicators = - dof_info - ->row_starts[(cell * n_lanes + v) * n_fe_components + - first_selected_component + 1] - .second; - } + unsigned int index_indicators = + dof_info->row_starts[cell_dof_index].second; + unsigned int next_index_indicators = + dof_info->row_starts[cell_dof_index + 1].second; + // For read_dof_values_plain, redirect the dof_indices field to the + // unconstrained indices if (apply_constraints == false && - dof_info - ->row_starts[(cell * n_lanes + v) * n_fe_components + - first_selected_component] - .second != - dof_info - ->row_starts[(cell * n_lanes + v) * n_fe_components + - first_selected_component + n_components_read] - .second) + dof_info->row_starts[cell_dof_index].second != + dof_info->row_starts[cell_dof_index + n_components_read].second) { - Assert(dof_info->row_starts_plain_indices[cell * n_lanes + v] != + Assert(dof_info->row_starts_plain_indices[cell_index] != numbers::invalid_unsigned_int, ExcNotInitialized()); dof_indices[v] = dof_info->plain_dof_indices.data() + dof_info->component_dof_indices_offset[active_fe_index] [first_selected_component] + - (is_face ? dof_info->row_starts_plain_indices[cells[v]] : - dof_info->row_starts_plain_indices[cell * n_lanes + v]); + dof_info->row_starts_plain_indices[cell_index]; next_index_indicators = index_indicators; } @@ -4143,20 +4120,8 @@ FEEvaluationBase:: } if (apply_constraints == true && comp + 1 < n_components) - { - if (is_face) - next_index_indicators = - dof_info - ->row_starts[cells[v] * n_fe_components + - first_selected_component + comp + 2] - .second; - else - next_index_indicators = - dof_info - ->row_starts[(cell * n_lanes + v) * n_fe_components + - first_selected_component + comp + 2] - .second; - } + next_index_indicators = + dof_info->row_starts[cell_dof_index + comp + 2].second; } } } -- 2.39.5