From: Daniel Arndt Date: Thu, 29 Nov 2018 13:24:38 +0000 (+0100) Subject: Don't use static_cast in grid_out.cc X-Git-Tag: v9.1.0-rc1~521^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99a9ddad2d1c39219670e67ddf405a7b230319f5;p=dealii.git Don't use static_cast in grid_out.cc --- diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index 770fe4de71..1c68ce9644 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -2367,7 +2367,9 @@ GridOut::write_svg(const Triangulation<2, 2> &tria, std::ostream &out) const if (svg_flags.label_level_number || svg_flags.label_cell_index) out << ','; - out << static_cast(cell->material_id()); + out + << static_cast::type>( + cell->material_id()); } if (svg_flags.label_subdomain_id) @@ -2376,7 +2378,9 @@ GridOut::write_svg(const Triangulation<2, 2> &tria, std::ostream &out) const svg_flags.label_cell_index || svg_flags.label_material_id) out << ','; if (cell->active()) - out << static_cast(cell->subdomain_id()); + out << static_cast< + std::make_signed::type>( + cell->subdomain_id()); else out << 'X'; } @@ -2388,7 +2392,9 @@ GridOut::write_svg(const Triangulation<2, 2> &tria, std::ostream &out) const svg_flags.label_material_id || svg_flags.label_subdomain_id) out << ','; - out << static_cast(cell->level_subdomain_id()); + out + << static_cast::type>( + cell->level_subdomain_id()); } out << "" << '\n'; @@ -2912,13 +2918,21 @@ namespace { patch.vertices[v] = cell->vertex(v); patch.data(0, v) = cell->level(); - patch.data(1, v) = static_cast(cell->manifold_id()); - patch.data(2, v) = cell->material_id(); + patch.data(1, v) = + static_cast::type>( + cell->manifold_id()); + patch.data(2, v) = + static_cast::type>( + cell->material_id()); if (!cell->has_children()) - patch.data(3, v) = static_cast(cell->subdomain_id()); + patch.data(3, v) = + static_cast::type>( + cell->subdomain_id()); else patch.data(3, v) = -1; - patch.data(4, v) = static_cast(cell->level_subdomain_id()); + patch.data(4, v) = + static_cast::type>( + cell->level_subdomain_id()); } patches.push_back(patch); } @@ -3118,17 +3132,23 @@ GridOut::write_vtk(const Triangulation &tria, // Now material id and boundary id for (auto cell : tria.active_cell_iterators()) { - out << static_cast(cell->material_id()) << ' '; + out << static_cast::type>( + cell->material_id()) + << ' '; } out << '\n'; for (auto face : faces) { - out << static_cast(face->boundary_id()) << ' '; + out << static_cast::type>( + face->boundary_id()) + << ' '; } out << '\n'; for (auto co_face : co_faces) { - out << static_cast(co_face->boundary_id()) << ' '; + out << static_cast::type>( + co_face->boundary_id()) + << ' '; } out << "\n\nSCALARS ManifoldID int 1\n" @@ -3137,17 +3157,23 @@ GridOut::write_vtk(const Triangulation &tria, // Now material id and boundary id for (auto cell : tria.active_cell_iterators()) { - out << static_cast(cell->manifold_id()) << ' '; + out << static_cast::type>( + cell->manifold_id()) + << ' '; } out << '\n'; for (auto face : faces) { - out << static_cast(face->manifold_id()) << ' '; + out << static_cast::type>( + face->manifold_id()) + << ' '; } out << '\n'; for (auto co_face : co_faces) { - out << static_cast(co_face->manifold_id()) << ' '; + out << static_cast::type>( + co_face->manifold_id()) + << ' '; } out << '\n'; @@ -3238,10 +3264,14 @@ GridOut::write_mesh_per_processor_as_vtu( patch.vertices[vertex] = cell->vertex(vertex); patch.data(0, vertex) = cell->level(); if (!cell->has_children()) - patch.data(1, vertex) = static_cast(cell->subdomain_id()); + patch.data(1, vertex) = + static_cast::type>( + cell->subdomain_id()); else patch.data(1, vertex) = -1.0; - patch.data(2, vertex) = static_cast(cell->level_subdomain_id()); + patch.data(2, vertex) = + static_cast::type>( + cell->level_subdomain_id()); patch.data(3, vertex) = tria.locally_owned_subdomain(); }