]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some conversion warnings.
authorBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 4 Apr 2013 19:16:40 +0000 (19:16 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 4 Apr 2013 19:16:40 +0000 (19:16 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29185 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/index_set.h
deal.II/include/deal.II/base/memory_consumption.h
deal.II/include/deal.II/base/partitioner.h
deal.II/include/deal.II/base/utilities.h
deal.II/include/deal.II/fe/fe.h
deal.II/include/deal.II/hp/dof_objects.h
deal.II/include/deal.II/lac/block_sparsity_pattern.h
deal.II/include/deal.II/matrix_free/dof_info.h
deal.II/include/deal.II/matrix_free/dof_info.templates.h
deal.II/include/deal.II/matrix_free/matrix_free.templates.h

index 3dce70cadebf8204fcad6b0b146f7cd0f2853a47..ef1c16bb184710dfd116b369dc5bce74c6b74c26 100644 (file)
@@ -160,7 +160,7 @@ public:
    * local_index obviously needs to be less
    * than n_elements().
    */
-  types::global_dof_index nth_index_in_set (const types::global_dof_index local_index) const;
+  types::global_dof_index nth_index_in_set (const unsigned int local_index) const;
 
   /**
    * Return the how-manyth element of this
@@ -172,7 +172,7 @@ public:
    * a member of this index set, i.e. if
    * is_element(global_index) is false.
    */
-  types::global_dof_index index_within_set (const types::global_dof_index global_index) const;
+  unsigned int index_within_set (const types::global_dof_index global_index) const;
 
   /**
    * Each index set can be
@@ -868,7 +868,7 @@ IndexSet::n_elements () const
 
 inline
 types::global_dof_index
-IndexSet::nth_index_in_set (const types::global_dof_index n) const
+IndexSet::nth_index_in_set (const unsigned int n) const
 {
   // to make this call thread-safe, compress()
   // must not be called through this function
@@ -918,7 +918,7 @@ IndexSet::nth_index_in_set (const types::global_dof_index n) const
 
 
 inline
-types::global_dof_index
+unsigned int
 IndexSet::index_within_set (const types::global_dof_index n) const
 {
   // to make this call thread-safe, compress()
index e9c854c4c61610670d80536fc45825e21ea8c2b5..76cfc4d9d6f892475f9a5e6a58fe7999800b2fc6 100644 (file)
@@ -530,7 +530,7 @@ namespace MemoryConsumption
   std::size_t memory_consumption (const std::vector<T> &v)
   {
     std::size_t mem = sizeof(std::vector<T>);
-    const unsigned int n = v.size();
+    const unsigned int n = static_cast<unsigned int>(v.size());
     for (unsigned int i=0; i<n; ++i)
       mem += memory_consumption(v[i]);
     mem += (v.capacity() - n)*sizeof(T);
index c1862ef9dc8fde6f4eb30dbbd4a1a47e40bef6ea..7a7b23c18f8d1b4305334acc1e3402be75f397fd 100644 (file)
@@ -442,7 +442,7 @@ namespace Utilities
       Assert(in_local_range(global_index) || is_ghost_entry (global_index),
              ExcIndexNotPresent(global_index, my_pid));
       if (in_local_range(global_index))
-        return global_index - local_range_data.first;
+        return static_cast<unsigned int>(global_index - local_range_data.first);
       else if (is_ghost_entry (global_index))
         return (local_size() +
                 ghost_indices_data.index_within_set (global_index));
index 0059f45bb5e8b21f714f37f8df6f7399b8b060c2..c76ff1d3f08822a21fdf27b45c8fe7d122492c7e 100644 (file)
@@ -749,7 +749,7 @@ namespace Utilities
     Assert (last - first >= 0,
             ExcMessage ("The given iterators do not satisfy the proper ordering."));
 
-    unsigned int len = last-first;
+    unsigned int len = static_cast<unsigned int>(last-first);
 
     if (len==0)
       return first;
index 851795456b6cf1941b0f7782e44213145a8922b0..7a671ccbea94cdc871365c638f9021bc7a859085 100644 (file)
@@ -2815,7 +2815,7 @@ inline
 unsigned int
 FiniteElement<dim,spacedim>::element_multiplicity (const unsigned int index) const
 {
-  return base_to_block_indices.block_size(index);
+  return static_cast<unsigned int>(base_to_block_indices.block_size(index));
 }
 
 
index 3c938ef24ec8a74a605563135c7ae090028be0a2..da2d2b296b4fa485f99a2861d0530a1404b715c8 100644 (file)
@@ -313,8 +313,9 @@ namespace internal
               if (*pointer == fe_index)
                 return *(pointer + 1 + local_index);
               else
-                pointer += dof_handler.get_fe()[*pointer]
-                           .template n_dofs_per_object<dim>() + 1;
+                pointer += static_cast<types::global_dof_index>(
+                    dof_handler.get_fe()[*pointer]
+                    .template n_dofs_per_object<dim>() + 1);
             }
         }
     }
@@ -606,8 +607,8 @@ namespace internal
           // an exception if we can't
           // find a set for this
           // particular fe_index
-          const unsigned int starting_offset = dof_offsets[obj_index];
-          const types::global_dof_index  *pointer = &dofs[starting_offset];
+          const types::global_dof_index starting_offset = dof_offsets[obj_index];
+          const types::global_dof_index *pointer = &dofs[starting_offset];
           while (true)
             {
               if (*pointer == numbers::invalid_dof_index)
@@ -616,8 +617,9 @@ namespace internal
               else if (*pointer == fe_index)
                 return true;
               else
-                pointer += dof_handler.get_fe()[*pointer]
-                           .template n_dofs_per_object<dim>() + 1;
+                pointer += static_cast<types::global_dof_index>(
+                    dof_handler.get_fe()[*pointer]
+                    .template n_dofs_per_object<dim>()+1);
             }
         }
     }
index cad22c9c5fef04615aa510877d5a1c2ab32a635a..2de9afd2d9e496fc9ba6246e0eb69b835dc84964 100644 (file)
@@ -342,7 +342,7 @@ public:
    * all the blocks that form this
    * row.
    */
-  size_type row_length (const size_type row) const;
+  unsigned int row_length (const size_type row) const;
 
   /**
    * Return the number of nonzero
@@ -1302,14 +1302,14 @@ BlockSparsityPatternBase<SparsityPatternBase>::exists (const size_type i,
 
 template <class SparsityPatternBase>
 inline
-typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
+unsigned int
 BlockSparsityPatternBase<SparsityPatternBase>::
 row_length (const size_type row) const
 {
   const std::pair<size_type , size_type>
   row_index = row_indices.global_to_local (row);
 
-  size_type c = 0;
+  unsigned int c = 0;
 
   for (size_type b=0; b<rows; ++b)
     c += sub_objects[row_index.first][b]->row_length (row_index.second);
index 96dcad82915e6358534a5dd9df4500bbf245602d..63552c1fde7a432de898f4cc001bb3c6e3d3a170 100644 (file)
@@ -178,7 +178,7 @@ namespace internal
        */
       void compute_renumber_serial (const std::vector<unsigned int> &boundary_cells,
                                     const SizeInfo                  &size_info,
-                                    std::vector<unsigned int>       &renumbering);
+                                    std::vector<types::global_dof_index> &renumbering);
 
       /**
        * Reorganizes cells in the hp case without parallelism such that all
@@ -187,7 +187,7 @@ namespace internal
        * DoFHandlers.
        */
       void compute_renumber_hp_serial (SizeInfo                  &size_info,
-                                       std::vector<unsigned int> &renumbering,
+                                     std::vector<types::global_dof_index> &renumbering,
                                        std::vector<unsigned int> &irregular_cells);
 
       /**
@@ -197,7 +197,7 @@ namespace internal
        */
       void compute_renumber_parallel (const std::vector<unsigned int> &boundary_cells,
                                       SizeInfo                        &size_info,
-                                      std::vector<unsigned int>       &renumbering);
+                                      std::vector<types::global_dof_index> &renumbering);
 
       /**
        * This method reorders the way cells are gone through based on a given
@@ -206,7 +206,7 @@ namespace internal
        * vectorization.
        */
       void reorder_cells (const SizeInfo                  &size_info,
-                          const std::vector<unsigned int> &renumbering,
+                          const std::vector<types::global_dof_index> &renumbering,
                           const std::vector<unsigned int> &constraint_pool_row_index,
                           const std::vector<unsigned int> &irregular_cells,
                           const unsigned int               vectorization_length);
@@ -237,7 +237,7 @@ namespace internal
       void
       make_thread_graph_partition_color (SizeInfo                  &size_info,
                                          TaskInfo                  &task_info,
-                                         std::vector<unsigned int> &renumbering,
+                                         std::vector<types::global_dof_index> &renumbering,
                                          std::vector<unsigned int> &irregular_cells,
                                          const bool                 hp_bool);
 
@@ -258,7 +258,7 @@ namespace internal
       void
       make_thread_graph_partition_partition (SizeInfo                  &size_info,
                                              TaskInfo                  &task_info,
-                                             std::vector<unsigned int> &renumbering,
+                                             std::vector<types::global_dof_index> &renumbering,
                                              std::vector<unsigned int> &irregular_cells,
                                              const bool                 hp_bool);
 
@@ -271,7 +271,7 @@ namespace internal
       void
       make_connectivity_graph (const SizeInfo                  &size_info,
                                const TaskInfo                  &task_info,
-                               const std::vector<unsigned int> &renumbering,
+                               const std::vector<types::global_dof_index> &renumbering,
                                const std::vector<unsigned int> &irregular_cells,
                                const bool                       do_blocking,
                                CompressedSimpleSparsityPattern &connectivity) const;
index ee577247938bfe549de8d3c7d11828f336479a07..ebb8577a2053e152bd3d5f5b39b4cc22ba2615fd 100644 (file)
@@ -178,7 +178,7 @@ namespace internal
       const unsigned int n_mpi_procs = vector_partitioner->n_mpi_processes();
       const types::global_dof_index first_owned = vector_partitioner->local_range().first;
       const types::global_dof_index last_owned  = vector_partitioner->local_range().second;
-      const unsigned int n_owned     = last_owned - first_owned;
+      const types::global_dof_index n_owned     = last_owned - first_owned;
       std::pair<unsigned short,unsigned short> constraint_iterator (0,0);
 
       unsigned int dofs_this_cell = (cell_active_fe_index.empty()) ?
@@ -208,7 +208,7 @@ namespace internal
               // to actually resolve the constraint entries
               const std::vector<std::pair<types::global_dof_index,double> >
               &entries = *entries_ptr;
-              const unsigned int n_entries = entries.size();
+              const types::global_dof_index n_entries = entries.size();
               if (n_entries == 1 && std::fabs(entries[0].second-1.)<1e-14)
                 {
                   current_dof = entries[0].first;
@@ -325,7 +325,7 @@ no_constraint:
       Assert (boundary_cells.size() < row_starts.size(), ExcInternalError());
 
       // sort ghost dofs and compress out duplicates
-      const unsigned int n_owned  = (vector_partitioner->local_range().second-
+      const types::global_dof_index n_owned  = (vector_partitioner->local_range().second-
                                      vector_partitioner->local_range().first);
       const size_dof n_ghosts = ghost_dofs.size();
       unsigned int       n_unique_ghosts= 0;
@@ -435,9 +435,9 @@ no_constraint:
     void
     DoFInfo::compute_renumber_serial (const std::vector<unsigned int> &boundary_cells,
                                       const SizeInfo                  &size_info,
-                                      std::vector<unsigned int>       &renumbering)
+                                      std::vector<types::global_dof_index> &renumbering)
     {
-      std::vector<unsigned int> reverse_numbering (size_info.n_active_cells,
+      std::vector<types::global_dof_index> reverse_numbering (size_info.n_active_cells,
                                                    numbers::invalid_unsigned_int);
       const unsigned int n_boundary_cells = boundary_cells.size();
       for (unsigned int j=0; j<n_boundary_cells; ++j)
@@ -469,7 +469,7 @@ no_constraint:
 
     void
     DoFInfo::compute_renumber_hp_serial (SizeInfo                  &size_info,
-                                         std::vector<unsigned int> &renumbering,
+                                         std::vector<types::global_dof_index> &renumbering,
                                          std::vector<unsigned int> &irregular_cells)
     {
       if (max_fe_index < 2)
@@ -551,9 +551,9 @@ no_constraint:
     void
     DoFInfo::compute_renumber_parallel (const std::vector<unsigned int> &boundary_cells,
                                         SizeInfo                        &size_info,
-                                        std::vector<unsigned int>       &renumbering)
+                                        std::vector<types::global_dof_index> &renumbering)
     {
-      std::vector<unsigned int> reverse_numbering (size_info.n_active_cells,
+      std::vector<types::global_dof_index> reverse_numbering (size_info.n_active_cells,
                                                    numbers::invalid_unsigned_int);
       const unsigned int n_boundary_cells = boundary_cells.size();
       for (unsigned int j=0; j<n_boundary_cells; ++j)
@@ -575,7 +575,7 @@ no_constraint:
 
     void
     DoFInfo::reorder_cells (const SizeInfo                  &size_info,
-                            const std::vector<unsigned int> &renumbering,
+                            const std::vector<types::global_dof_index> &renumbering,
                             const std::vector<unsigned int> &constraint_pool_row_index,
                             const std::vector<unsigned int> &irregular_cells,
                             const unsigned int               vectorization_length)
@@ -810,11 +810,11 @@ no_constraint:
 
 
     void DoFInfo::make_thread_graph_partition_color
-    (SizeInfo                  &size_info,
-     TaskInfo                  &task_info,
-     std::vector<unsigned int> &renumbering,
-     std::vector<unsigned int> &irregular_cells,
-     const bool                 hp_bool)
+    (SizeInfo                             &size_info,
+     TaskInfo                             &task_info,
+     std::vector<types::global_dof_index> &renumbering,
+     std::vector<unsigned int>            &irregular_cells,
+     const bool                            hp_bool)
     {
       if (size_info.n_macro_cells == 0)
         return;
@@ -923,12 +923,12 @@ no_constraint:
       // yet assigned a partition.
       std::vector<unsigned int> cell_partition(task_info.n_blocks,
                                                size_info.n_macro_cells);
-      std::vector<unsigned int> neighbor_list;
-      std::vector<unsigned int> neighbor_neighbor_list;
+      std::vector<types::global_dof_index> neighbor_list;
+      std::vector<types::global_dof_index> neighbor_neighbor_list;
 
       // In element j of this variable, one puts the old number of the block
       // that should be the jth block in the new numeration.
-      std::vector<unsigned int> partition_list      (task_info.n_blocks,0);
+      std::vector<types::global_dof_index> partition_list      (task_info.n_blocks,0);
       std::vector<unsigned int> partition_color_list(task_info.n_blocks,0);
 
       // This vector points to the start of each partition.
@@ -1121,7 +1121,7 @@ no_constraint:
       // check that the renumbering is one-to-one
 #ifdef DEBUG
       {
-        std::vector<unsigned int> sorted_renumbering (renumbering);
+        std::vector<types::global_dof_index> sorted_renumbering (renumbering);
         std::sort(sorted_renumbering.begin(), sorted_renumbering.end());
         for (unsigned int i=0; i<sorted_renumbering.size(); ++i)
           Assert(sorted_renumbering[i] == i, ExcInternalError());
@@ -1140,11 +1140,11 @@ no_constraint:
 
     void
     DoFInfo::make_thread_graph_partition_partition
-    (SizeInfo                  &size_info,
-     TaskInfo                  &task_info,
-     std::vector<unsigned int> &renumbering,
-     std::vector<unsigned int> &irregular_cells,
-     const bool                 hp_bool)
+    (SizeInfo                             &size_info,
+     TaskInfo                             &task_info,
+     std::vector<types::global_dof_index> &renumbering,
+     std::vector<unsigned int>            &irregular_cells,
+     const bool                            hp_bool)
     {
       if (size_info.n_macro_cells == 0)
         return;
@@ -1181,7 +1181,7 @@ no_constraint:
       // In element j of this variable, one puts the old number of the block
       // that should be the jth block in the new numeration.
       std::vector<unsigned int> partition_list(size_info.n_active_cells,0);
-      std::vector<unsigned int> partition_partition_list(size_info.n_active_cells,0);
+      std::vector<types::global_dof_index> partition_partition_list(size_info.n_active_cells,0);
 
       // This vector points to the start of each partition.
       std::vector<unsigned int> partition_size(2,0);
@@ -1436,7 +1436,7 @@ not_connect:
                       missing_macros = 0;
                       std::vector<unsigned int> remaining_per_macro_cell
                       (max_fe_index);
-                      std::vector<std::vector<unsigned int> >
+                      std::vector<std::vector<types::global_dof_index> >
                       renumbering_fe_index;
                       unsigned int cell;
                       bool filled = true;
@@ -1688,7 +1688,7 @@ not_connect:
     DoFInfo::make_connectivity_graph
     (const SizeInfo                  &size_info,
      const TaskInfo                  &task_info,
-     const std::vector<unsigned int> &renumbering,
+     const std::vector<types::global_dof_index> &renumbering,
      const std::vector<unsigned int> &irregular_cells,
      const bool                       do_blocking,
      CompressedSimpleSparsityPattern &connectivity) const
@@ -1741,9 +1741,9 @@ not_connect:
               scratch.insert(scratch.end(),
                              begin_indices(block), end_indices(block));
               std::sort(scratch.begin(), scratch.end());
-              const unsigned int n_unique =
+              const types::global_dof_index n_unique =
                 std::unique(scratch.begin(), scratch.end())-scratch.begin();
-              for (unsigned int i=0; i<n_unique; ++i)
+              for (types::global_dof_index i=0; i<n_unique; ++i)
                 row_lengths[scratch[i]]++;
             }
         }
index 4db9ad0aa4061ba82251738ec9cb01490990375a..c14e6354281173d6a200a4be2b371f36397e42f4 100644 (file)
@@ -620,7 +620,7 @@ void MatrixFree<dim,Number>::initialize_indices
   // reorganize the indices in order to overlap communication in MPI with
   // computations: Place all cells with ghost indices into one chunk. Also
   // reorder cells so that we can parallelize by threads
-  std::vector<unsigned int> renumbering;
+  std::vector<types::global_dof_index> renumbering;
   if (task_info.use_multithreading == true)
     {
       dof_info[0].compute_renumber_parallel (boundary_cells, size_info,
@@ -650,7 +650,7 @@ void MatrixFree<dim,Number>::initialize_indices
   // operations will then be done simultaneously).
 #ifdef DEBUG
   {
-    std::vector<unsigned int> sorted_renumbering (renumbering);
+    std::vector<types::global_dof_index> sorted_renumbering (renumbering);
     std::sort (sorted_renumbering.begin(), sorted_renumbering.end());
     for (unsigned int i=0; i<sorted_renumbering.size(); ++i)
       Assert (sorted_renumbering[i] == i, ExcInternalError());

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.