From 9310cacb069ca787dbdad346d2943fabd33dd1b7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 31 Aug 2020 17:45:33 -0600 Subject: [PATCH] Minor clean-ups. --- source/base/data_out_base.cc | 13 ++++++------- source/grid/grid_out.cc | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index ba2054af34..79faad781e 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -5364,14 +5364,13 @@ namespace DataOutBase // If a user set to output high order cells, we treat n_subdivisions // as a cell order and adjust variables accordingly, otherwise // each patch is written as a linear cell. - unsigned int n_points_per_cell = - ReferenceCell::internal::Info::get_cell(patches[0].reference_cell_type) - .n_vertices(); + const unsigned int n_points_per_cell = + (flags.write_higher_order_cells == false ? + ReferenceCell::internal::Info::get_cell(patches[0].reference_cell_type) + .n_vertices() : + n_nodes / patches.size()); if (flags.write_higher_order_cells) - { - n_cells = patches.size(); - n_points_per_cell = n_nodes / n_cells; - } + n_cells = patches.size(); // in gmv format the vertex coordinates and the data have an order that is a // bit unpleasant (first all x coordinates, then all y coordinate, ...; diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index 197c523a22..1dac38b756 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -889,7 +889,7 @@ GridOut::write_dx(const Triangulation &tria, for (const auto &cell : tria.active_cell_iterators()) { - for (auto f : cell->face_indices()) + for (const auto f : cell->face_indices()) { typename Triangulation::face_iterator face = cell->face(f); -- 2.39.5