]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Readd some static_casts 7485/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 29 Nov 2018 14:09:20 +0000 (15:09 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 29 Nov 2018 14:09:20 +0000 (15:09 +0100)
source/grid/grid_out.cc
source/grid/grid_tools.cc

index 1c68ce96442c200a151732b138453ce6c799f5ee..543f400ebd90c707d5e8b399a9c994788508a34e 100644 (file)
@@ -1454,8 +1454,8 @@ GridOut::write_xfig(const Triangulation<2> &tria,
             cell->vertex(GeometryInfo<dim>::ucd_to_deal[k % nv]);
           for (unsigned int d = 0; d < static_cast<unsigned int>(dim); ++d)
             {
-              int val =
-                1200 * xfig_flags.scaling(d) * (p(d) - xfig_flags.offset(d));
+              int val = static_cast<int>(1200 * xfig_flags.scaling(d) *
+                                         (p(d) - xfig_flags.offset(d)));
               out << '\t' << ((d == 0) ? val : -val);
             }
           out << std::endl;
@@ -1498,8 +1498,9 @@ GridOut::write_xfig(const Triangulation<2> &tria,
                     for (unsigned int d = 0; d < static_cast<unsigned int>(dim);
                          ++d)
                       {
-                        int val = 1200 * xfig_flags.scaling(d) *
-                                  (p(d) - xfig_flags.offset(d));
+                        int val =
+                          static_cast<int>(1200 * xfig_flags.scaling(d) *
+                                           (p(d) - xfig_flags.offset(d)));
                         out << '\t' << ((d == 0) ? val : -val);
                       }
                     out << std::endl;
@@ -3264,14 +3265,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) =
+            patch.data(1, vertex) = static_cast<double>(
               static_cast<std::make_signed<types::subdomain_id>::type>(
-                cell->subdomain_id());
+                cell->subdomain_id()));
           else
             patch.data(1, vertex) = -1.0;
-          patch.data(2, vertex) =
+          patch.data(2, vertex) = static_cast<double>(
             static_cast<std::make_signed<types::subdomain_id>::type>(
-              cell->level_subdomain_id());
+              cell->level_subdomain_id()));
           patch.data(3, vertex) = tria.locally_owned_subdomain();
         }
 
index 2a85cf49a75d6f0b99d64517cdbf8b8f9c010ebb..b9b1419c95225eb593e24b772a45c4c533d356c9 100644 (file)
@@ -2812,7 +2812,7 @@ namespace GridTools
       if (cell->active())
         {
           while (current_cell_idx >=
-                 std::floor(static_cast<long>(n_active_cells) *
+                 std::floor(static_cast<uint_least64_t>(n_active_cells) *
                             (current_proc_idx + 1) / n_partitions))
             ++current_proc_idx;
           cell->set_subdomain_id(current_proc_idx);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.