From: Martin Kronbichler Date: Wed, 19 May 2021 10:46:23 +0000 (+0200) Subject: MappingQGeneric: Fix warning about array bounds X-Git-Tag: v9.3.0-rc1~33^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35ebf74cf8c1b884dd0c3aa6002078cbb2f47809;p=dealii.git MappingQGeneric: Fix warning about array bounds --- diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index e8b328364f..1db0f55cba 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -1267,10 +1267,10 @@ MappingQGeneric::fill_mapping_data_for_generic_points( Point> p_vec; for (unsigned int j = 0; j < n_lanes; ++j) if (i + j < n_points) - for (unsigned int d = 0; d < spacedim; ++d) + for (unsigned int d = 0; d < dim; ++d) p_vec[d][j] = unit_points[i + j][d]; else - for (unsigned int d = 0; d < spacedim; ++d) + for (unsigned int d = 0; d < dim; ++d) p_vec[d][j] = unit_points[i][d]; const auto result = @@ -1288,8 +1288,8 @@ MappingQGeneric::fill_mapping_data_for_generic_points( if (update_flags & update_jacobians) for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) - for (unsigned int d = 0; d < dim; ++d) - for (unsigned int e = 0; e < spacedim; ++e) + for (unsigned int d = 0; d < spacedim; ++d) + for (unsigned int e = 0; e < dim; ++e) output_data.jacobians[i + j][d][e] = result.second[e][d][j]; if (update_flags & update_inverse_jacobians) @@ -1299,8 +1299,8 @@ MappingQGeneric::fill_mapping_data_for_generic_points( const DerivativeForm<1, spacedim, dim, VectorizedArray> inv_jac = jac.covariant_form(); for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) - for (unsigned int d = 0; d < spacedim; ++d) - for (unsigned int e = 0; e < dim; ++e) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < spacedim; ++e) output_data.inverse_jacobians[i + j][d][e] = inv_jac[d][e][j]; } } @@ -1327,8 +1327,8 @@ MappingQGeneric::fill_mapping_data_for_generic_points( { DerivativeForm<1, spacedim, dim> jac(result.second); DerivativeForm<1, spacedim, dim> inv_jac = jac.covariant_form(); - for (unsigned int d = 0; d < spacedim; ++d) - for (unsigned int e = 0; e < dim; ++e) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < spacedim; ++e) output_data.inverse_jacobians[i][d][e] = inv_jac[d][e]; } }