From c9a97ecd3012cc80911bb9b00ff0425ab632f896 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 24 Jul 2023 14:56:49 -0600 Subject: [PATCH] Simplify code using structured bindings. --- source/grid/grid_generator.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 2ac550a402..d55e7a5ce5 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -6487,12 +6487,12 @@ namespace GridGenerator ExcMessage("The input triangulations must be non-empty " "and must not be refined.")); - std::vector> tria_vertices; - std::vector> tria_cells; - SubCellData tria_subcell_data; - std::tie(tria_vertices, tria_cells, tria_subcell_data) = + auto [tria_vertices, tria_cells, tria_subcell_data] = GridTools::get_coarse_mesh_description(*triangulation); + // Copy the vertices of the current triangulation into the merged list, + // and then let the vertex indices of the cells refer to those in + // the merged list: vertices.insert(vertices.end(), tria_vertices.begin(), tria_vertices.end()); @@ -6750,11 +6750,9 @@ namespace GridGenerator tria_to_replicate.copy_triangulation(input); for (unsigned int d = 0; d < dim; ++d) { - std::vector> input_vertices; - std::vector> input_cell_data; - SubCellData input_subcell_data; - std::tie(input_vertices, input_cell_data, input_subcell_data) = + auto [input_vertices, input_cell_data, input_subcell_data] = GridTools::get_coarse_mesh_description(tria_to_replicate); + std::vector> output_vertices = input_vertices; std::vector> output_cell_data = input_cell_data; SubCellData output_subcell_data = input_subcell_data; -- 2.39.5