From 1612211a7faaf4667071fba5f9c34137c2348f32 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sun, 7 Apr 2024 19:37:12 -0400 Subject: [PATCH] fix maybe-unused warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ``` ./include/deal.II/grid/reference_cell.h:2799:22: warning: ‘face1_vertices.std::array::_M_elems[0]’ was declared here ``` --- source/grid/grid_tools_dof_handlers.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 5ffef54767..aca115ca24 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -2437,6 +2437,9 @@ namespace GridTools std::array::vertices_per_face> face1_vertices, face2_vertices; + face1_vertices.fill(numbers::invalid_unsigned_int); + face2_vertices.fill(numbers::invalid_unsigned_int); + AssertDimension(face1->n_vertices(), face2->n_vertices()); std::set face2_vertices_set; @@ -2465,6 +2468,18 @@ namespace GridTools if (face2_vertices_set.empty()) { + // Just to be sure, did we fill both arrays with sensible data? + Assert(face1_vertices.end() == + std::find(face1_vertices.begin(), + face1_vertices.begin() + face1->n_vertices(), + numbers::invalid_unsigned_int), + ExcInternalError()); + Assert(face2_vertices.end() == + std::find(face2_vertices.begin(), + face2_vertices.begin() + face1->n_vertices(), + numbers::invalid_unsigned_int), + ExcInternalError()); + const auto reference_cell = face1->reference_cell(); // We want the relative orientation of face1 with respect to face2 so // the order is flipped here: -- 2.39.5