From: Wolfgang Bangerth Date: Mon, 24 Jul 2023 20:56:49 +0000 (-0600) Subject: Simplify code using structured bindings. X-Git-Tag: relicensing~643^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15796%2Fhead;p=dealii.git Simplify code using structured bindings. --- 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;