From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 03:38:03 +0000 (-0700) Subject: Add a couple of duplicate checks to avoid triggering array access warnings. X-Git-Tag: v9.3.0-rc1~586^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11595%2Fhead;p=dealii.git Add a couple of duplicate checks to avoid triggering array access warnings. --- 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(),