From ac936da55c3cd8c562ac6b96c835c24bd4420f2a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 20 Jan 2021 20:38:03 -0700 Subject: [PATCH] Add a couple of duplicate checks to avoid triggering array access warnings. --- source/grid/tria.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 5eadb32ab4..cf30f4e356 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -4452,7 +4452,8 @@ namespace internal ++next_unused_cell; } - if (cell->reference_cell_type() == ReferenceCell::Type::Tri) + if ((dim == 2) && + (cell->reference_cell_type() == ReferenceCell::Type::Tri)) { subcells[0]->set_bounding_object_indices({new_lines[0]->index(), new_lines[8]->index(), @@ -4502,7 +4503,8 @@ namespace internal // triangulation.levels[subcells[2]->level()]->face_orientations[subcells[2]->index() // * GeometryInfo<2>::faces_per_cell + 0] = 0; } - else if (cell->reference_cell_type() == ReferenceCell::Type::Quad) + else if ((dim == 2) && + (cell->reference_cell_type() == ReferenceCell::Type::Quad)) { subcells[0]->set_bounding_object_indices( {new_lines[0]->index(), -- 2.39.5