From dbf05ce6bc21a366dfbbd4795a44ae4ddc644937 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 8 Jul 2023 00:26:06 -0600 Subject: [PATCH] Replace use of C-style array by std::array in a second place. --- .../vector_tools_constraints.templates.h | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/include/deal.II/numerics/vector_tools_constraints.templates.h b/include/deal.II/numerics/vector_tools_constraints.templates.h index 3fa96e5a78..9f4b162f7c 100644 --- a/include/deal.II/numerics/vector_tools_constraints.templates.h +++ b/include/deal.II/numerics/vector_tools_constraints.templates.h @@ -86,33 +86,24 @@ namespace VectorTools { static const unsigned int size = 3; // store active fe indeX, face number, DoF index - unsigned int indices[size]; + std::array indices; bool operator<(const FaceDoFInfo &other) const { - for (unsigned int i = 0; i < size; ++i) - if (indices[i] < other.indices[i]) - return true; - else if (indices[i] > other.indices[i]) - return false; - return false; + return (indices < other.indices); } bool operator==(const FaceDoFInfo &other) const { - for (unsigned int i = 0; i < size; ++i) - if (indices[i] != other.indices[i]) - return false; - - return true; + return (indices == other.indices); } bool operator!=(const FaceDoFInfo &other) const { - return !(*this == other); + return (indices != other.indices); } }; @@ -548,7 +539,7 @@ namespace VectorTools { local_vector_indices[0] = i; const FaceDoFInfo local_face_dof_info = { - {cell->active_fe_index(), face_no, i}}; + {{cell->active_fe_index(), face_no, i}}}; for (unsigned int k = 0; k < fe.n_dofs_per_face(face_no); ++k) if ((k != i) && @@ -648,7 +639,7 @@ namespace VectorTools !refinement_edge_indices.is_element(face_dofs[i])) { const FaceDoFInfo face_dof_info = { - {cell->active_fe_index(), face_no, i}}; + {{cell->active_fe_index(), face_no, i}}}; const auto it = dof_to_vector_dof.find(face_dof_info); Assert(it != dof_to_vector_dof.end(), ExcInternalError()); const std::array local_vector_indices = -- 2.39.5