From: David Wells Date: Thu, 1 Aug 2024 13:51:37 +0000 (-0400) Subject: MatrixFree: initialize more std::array objects. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e05ed35ca8a6db51cd6b96a92319128cc6547284;p=dealii.git MatrixFree: initialize more std::array objects. This fixes some GCC warnings. --- diff --git a/include/deal.II/matrix_free/evaluation_kernels_face.h b/include/deal.II/matrix_free/evaluation_kernels_face.h index 0356dd1c6b..e41dad1b80 100644 --- a/include/deal.II/matrix_free/evaluation_kernels_face.h +++ b/include/deal.II/matrix_free/evaluation_kernels_face.h @@ -2696,12 +2696,12 @@ namespace internal const bool vectorization_possible = all_faces_are_same && (sm_ptr == nullptr); - std::array vector_ptrs; - std::array reordered_indices; + std::array vector_ptrs{{nullptr}}; + std::array reordered_indices{ + {numbers::invalid_unsigned_int}}; if (vectorization_possible == false) { - vector_ptrs = {}; if (n_face_orientations == 1) { for (unsigned int v = 0; v < n_filled_lanes; ++v) diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index bf1c3b1103..fda4197cce 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3328,7 +3328,7 @@ FEEvaluationBase:: dof_info.dof_indices_contiguous[ind]; const std::size_t dofs_per_component = this->data->dofs_per_component_on_cell; - std::array values_dofs; + std::array values_dofs{{nullptr}}; for (unsigned int c = 0; c < n_components; ++c) values_dofs[c] = const_cast(this->values_dofs) + c * dofs_per_component; @@ -3383,7 +3383,8 @@ FEEvaluationBase:: if (vectors_sm[0] != nullptr) { const auto compute_vector_ptrs = [&](const unsigned int comp) { - std::array vector_ptrs = {}; + std::array vector_ptrs{ + {nullptr}}; const auto upper_bound = std::min(n_filled_lanes, n_lanes); @@ -3478,11 +3479,8 @@ FEEvaluationBase:: return; } - std::array dof_indices; - std::fill(dof_indices.begin(), - dof_indices.end(), - numbers::invalid_unsigned_int); - + std::array dof_indices{ + {numbers::invalid_unsigned_int}}; Assert(n_filled_lanes <= n_lanes, ExcInternalError()); for (unsigned int v = 0; v < n_filled_lanes; ++v) { @@ -3524,7 +3522,8 @@ FEEvaluationBase:: internal::MatrixFreeFunctions::DoFInfo::IndexStorageVariants:: interleaved_contiguous_strided) { - std::array src_ptrs; + std::array src_ptrs{ + {nullptr}}; if (n_components == 1 || this->n_fe_components == 1) for (unsigned int comp = 0; comp < n_components; ++comp) src_ptrs[comp] = const_cast( @@ -3563,7 +3562,8 @@ FEEvaluationBase:: internal::MatrixFreeFunctions::DoFInfo:: IndexStorageVariants::interleaved_contiguous_mixed_strides, ExcNotImplemented()); - std::array src_ptrs; + std::array src_ptrs{ + {nullptr}}; if (n_components == 1 || this->n_fe_components == 1) for (unsigned int comp = 0; comp < n_components; ++comp) src_ptrs[comp] = const_cast( @@ -3842,7 +3842,8 @@ FEEvaluationBase:: return; // nothing to do with faces std::array - constraint_mask; + constraint_mask{{internal::MatrixFreeFunctions:: + unconstrained_compressed_constraint_kind}}; bool hn_available = false;