From: Martin Kronbichler Date: Tue, 1 May 2018 13:07:35 +0000 (+0200) Subject: Use vector::data() + offset in a few places. Add assertion. X-Git-Tag: v9.0.0-rc1~49^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6470df5e57cb23c4f557db7115b917540fe4fca1;p=dealii.git Use vector::data() + offset in a few places. Add assertion. --- diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index d13b8d46b6..caefb68399 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3695,7 +3695,8 @@ FEEvaluationBase internal::MatrixFreeFunctions::DoFInfo::IndexStorageVariants::interleaved) { const unsigned int *dof_indices = - &dof_info->dof_indices_interleaved[dof_info->row_starts[cell*n_fe_components*n_vectorization].first]+ + dof_info->dof_indices_interleaved.data() + + dof_info->row_starts[cell*n_fe_components*n_vectorization].first+ dof_info->component_dof_indices_offset[active_fe_index][first_selected_component]*n_vectorization; if (n_components == 1 || n_fe_components == 1) for (unsigned int i=0; i has_constraints = has_constraints && dof_info->row_starts[cells[v]*n_fe_components+first_selected_component+n_components].second != dof_info->row_starts[cells[v]*n_fe_components+first_selected_component].second; - dof_indices[v] = &dof_info->dof_indices[dof_info->row_starts[cells[v]*n_fe_components+first_selected_component].first]; + dof_indices[v] = dof_info->dof_indices.data() + + dof_info->row_starts[cells[v]*n_fe_components+first_selected_component].first; } for (unsigned int v=n_vectorization_actual; v if (dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+n_components_read].second != dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].second) has_constraints = true; - dof_indices[v] = &dof_info->dof_indices[dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first]; + Assert(dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+n_components_read].first == + dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first || + dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first < + dof_info->dof_indices.size(), + ExcIndexRange(0, dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first, + dof_info->dof_indices.size())); + dof_indices[v] = dof_info->dof_indices.data() + + dof_info->row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first; } for (unsigned int v=n_vectorization_actual; v Assert(dof_info->row_starts_plain_indices[cell*n_vectorization+v] != numbers::invalid_unsigned_int, ExcNotInitialized()); - dof_indices[v] = is_face ? - &dof_info->plain_dof_indices[dof_info->row_starts_plain_indices[cells[v]]] - : - &dof_info->plain_dof_indices[dof_info->row_starts_plain_indices[cell*n_vectorization+v]]; - dof_indices[v] += dof_info->component_dof_indices_offset[active_fe_index][first_selected_component]; + 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_vectorization+v]); next_index_indicators = index_indicators; }