]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use the right types for iota and accumulate. 5030/head
authorDavid Wells <wellsd2@rpi.edu>
Tue, 5 Sep 2017 19:31:37 +0000 (15:31 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Tue, 5 Sep 2017 20:09:56 +0000 (16:09 -0400)
include/deal.II/dofs/dof_accessor.templates.h
source/distributed/tria.cc
source/grid/grid_refinement.cc
source/grid/grid_tools.cc
source/grid/manifold.cc
source/multigrid/mg_tools.cc
source/multigrid/mg_transfer_block.cc
source/multigrid/mg_transfer_component.cc

index 7dd36e996d5517018faee7f16b611d267399f613..9387b9345b063d40757af5da3906239f01efeee6 100644 (file)
@@ -1546,7 +1546,7 @@ namespace internal
       {
         // initialize original index locations
         std::vector<unsigned int> idx(v_end-v_begin);
-        std::iota(idx.begin(), idx.end(), 0);
+        std::iota(idx.begin(), idx.end(), 0u);
 
         // sort indices based on comparing values in v
         std::sort(idx.begin(), idx.end(),
index 3333a29ac680c9cd34fb73883e819f70dc414b19..0812303743bbed667ac8dae53355cf6e1ed31039 100644 (file)
@@ -256,7 +256,7 @@ namespace
     const typename internal::p4est::types<dim>::locidx
     num_vtt = std::accumulate (vertex_touch_count.begin(),
                                vertex_touch_count.end(),
-                               0);
+                               0u);
     (void)num_vtt;
     Assert (connectivity->ctt_offset[triangulation.n_vertices()] ==
             num_vtt,
@@ -2019,7 +2019,7 @@ namespace parallel
       const dealii::internal::p4est::types<2>::locidx
       num_vtt = std::accumulate (vertex_touch_count.begin(),
                                  vertex_touch_count.end(),
-                                 0);
+                                 0u);
 
       // now create a connectivity object with the right sizes for all
       // arrays. set vertex information only in debug mode (saves a few bytes
@@ -2090,7 +2090,7 @@ namespace parallel
       const dealii::internal::p4est::types<2>::locidx
       num_vtt = std::accumulate (vertex_touch_count.begin(),
                                  vertex_touch_count.end(),
-                                 0);
+                                 0u);
 
       // now create a connectivity object with the right sizes for all
       // arrays. set vertex information only in debug mode (saves a few bytes
@@ -2159,7 +2159,7 @@ namespace parallel
       const dealii::internal::p4est::types<2>::locidx
       num_vtt = std::accumulate (vertex_touch_count.begin(),
                                  vertex_touch_count.end(),
-                                 0);
+                                 0u);
 
       std::vector<unsigned int> edge_touch_count;
       std::vector<
@@ -2173,7 +2173,7 @@ namespace parallel
       const dealii::internal::p4est::types<2>::locidx
       num_ett = std::accumulate (edge_touch_count.begin(),
                                  edge_touch_count.end(),
-                                 0);
+                                 0u);
 
       // now create a connectivity object with the right sizes for all arrays
       const bool set_vertex_info
index fde982e36f70657dd35426eb7e08c0c68b6b9d1e..338bdf9b6a7877c772838f9d252589594028abeb 100644 (file)
@@ -467,7 +467,7 @@ GridRefinement::refine_and_coarsen_optimize (Triangulation<dim,spacedim> &tria,
 
   // get a decreasing order on the error indicator
   std::vector<unsigned int> cell_indices(criteria.size());
-  std::iota(cell_indices.begin(), cell_indices.end(), 0);
+  std::iota(cell_indices.begin(), cell_indices.end(), 0u);
 
   std::sort(cell_indices.begin(), cell_indices.end(),
             [&criteria](const unsigned int left,
index 1b41e5927b452cf1a4864c7e34a6f588e2d75d1a..e492b2fef4df0d0cf000ba0a03e7ca118f4b7276 100644 (file)
@@ -2258,7 +2258,8 @@ next_cell:
                              indices.size(), DEAL_II_DOF_INDEX_MPI_TYPE, triangulation.get_communicator());
     AssertThrowMPI(ierr);
     const types::global_vertex_index shift = std::accumulate(&indices[0],
-                                                             &indices[0]+triangulation.locally_owned_subdomain(),0);
+                                                             &indices[0]+triangulation.locally_owned_subdomain(),
+                                                             types::global_vertex_index(0));
 
     std::map<unsigned int,types::global_vertex_index>::iterator
     global_index_it = local_to_global_vertex_index.begin(),
index 6cc6f27786145d1382a9db400f06d7c75d753034..c2d2238f515f18dd7a5a779d74292c8c3eb7c504 100644 (file)
@@ -105,7 +105,7 @@ get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
   // produce unique points even if get_intermediate_points is not
   // associative (as for the SphericalManifold).
   boost::container::small_vector<unsigned int, 100> permutation(n_points);
-  std::iota(permutation.begin(), permutation.end(), 0);
+  std::iota(permutation.begin(), permutation.end(), 0u);
   std::sort(permutation.begin(), permutation.end(), CompareWeights(weights));
 
   // Now loop over points in the order of their associated weight
index b848fbdf8e4cb15010105b8abfe222533bb10008..e69cd338d34bc4b1ddf31beb8675f9db9aa21284 100644 (file)
@@ -1074,7 +1074,8 @@ namespace MGTools
             Assert (!dof_handler.get_fe().is_primitive()
                     ||
                     std::accumulate (result[l].begin(),
-                                     result[l].end(), 0U)
+                                     result[l].end(),
+                                     types::global_dof_index(0))
                     ==
                     dof_handler.n_dofs(l),
                     ExcInternalError());
index ebae1c360ad695337ab9f0f24067c02a1e3be33d..bde0a9cabc7c2c63e8acc21825f7bf56a667a6cf 100644 (file)
@@ -58,7 +58,7 @@ namespace
     const unsigned int n_selected
       = std::accumulate(selected.begin(),
                         selected.end(),
-                        0U);
+                        0u);
 
     if (ndofs.size() == 0)
       {
index 1a3e5ec8147f57c1b613479e2c37456835fe367c..e663e69a1ab20a8c04cb7b3a5e3170637d74acc2 100644 (file)
@@ -120,7 +120,7 @@ namespace
     const unsigned int n_selected
       = std::accumulate(selected.begin(),
                         selected.end(),
-                        0U);
+                        0u);
 
     if (ndofs.size() == 0)
       {

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.