]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix some conversion warnings.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 Apr 2013 23:12:23 +0000 (23:12 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 Apr 2013 23:12:23 +0000 (23:12 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29252 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_matrix_base.h
deal.II/include/deal.II/multigrid/mg_transfer.h
deal.II/source/lac/constraint_matrix.cc
deal.II/source/multigrid/mg_transfer_component.cc
deal.II/source/numerics/matrix_tools.cc
deal.II/source/numerics/point_value_history.cc

index 18cfc16e5e35842fa9e10881e5edde3fc84e48a7..803501437c87fd9d5d012e5a1a1cbdd909356e82 100644 (file)
@@ -443,8 +443,8 @@ public:
    * given coordinates.
    */
   BlockType &
-  block (const size_type row,
-         const size_type column);
+  block (const unsigned int row,
+         const unsigned int column);
 
 
   /**
@@ -453,8 +453,8 @@ public:
    * constant objects.
    */
   const BlockType &
-  block (const size_type row,
-         const size_type column) const;
+  block (const unsigned int row,
+         const unsigned int column) const;
 
   /**
    * Return the dimension of the
@@ -479,7 +479,7 @@ public:
    * sparsity pattern is presently
    * associated to this matrix.
    */
-  size_type n_block_rows () const;
+  unsigned int n_block_rows () const;
 
   /**
    * Return the number of blocks in
@@ -487,7 +487,7 @@ public:
    * sparsity pattern is presently
    * associated to this matrix.
    */
-  size_type n_block_cols () const;
+  unsigned int n_block_cols () const;
 
   /**
    * Set the element <tt>(i,j)</tt>
@@ -1336,7 +1336,7 @@ namespace BlockMatrixIterators
 
         // find the first block that does
         // have an entry in this row
-        for (size_type bc=0; bc<matrix->n_block_cols(); ++bc)
+        for (unsigned int bc=0; bc<matrix->n_block_cols(); ++bc)
           {
             base_iterator
               = matrix->block(indices.first, bc).begin(indices.second);
@@ -1740,8 +1740,8 @@ BlockMatrixBase<MatrixType> &
 BlockMatrixBase<MatrixType>::
 copy_from (const BlockMatrixType &source)
 {
-  for (size_type r=0; r<n_block_rows(); ++r)
-    for (size_type c=0; c<n_block_cols(); ++c)
+  for (unsigned int r=0; r<n_block_rows(); ++r)
+    for (unsigned int c=0; c<n_block_cols(); ++c)
       block(r,c).copy_from (source.block(r,c));
 
   return *this;
@@ -1760,8 +1760,8 @@ BlockMatrixBase<MatrixType>::memory_consumption () const
     MemoryConsumption::memory_consumption(column_indices)+
     MemoryConsumption::memory_consumption(column_values);
 
-  for (size_type r=0; r<n_block_rows(); ++r)
-    for (size_type c=0; c<n_block_cols(); ++c)
+  for (unsigned int r=0; r<n_block_rows(); ++r)
+    for (unsigned int c=0; c<n_block_cols(); ++c)
       {
         MatrixType *p = this->sub_objects[r][c];
         mem += MemoryConsumption::memory_consumption(*p);
@@ -1777,8 +1777,8 @@ inline
 void
 BlockMatrixBase<MatrixType>::clear ()
 {
-  for (size_type r=0; r<n_block_rows(); ++r)
-    for (size_type c=0; c<n_block_cols(); ++c)
+  for (unsigned int r=0; r<n_block_rows(); ++r)
+    for (unsigned int c=0; c<n_block_cols(); ++c)
       {
         MatrixType *p = this->sub_objects[r][c];
         this->sub_objects[r][c] = 0;
@@ -1795,8 +1795,8 @@ BlockMatrixBase<MatrixType>::clear ()
 template <class MatrixType>
 inline
 typename BlockMatrixBase<MatrixType>::BlockType &
-BlockMatrixBase<MatrixType>::block (const size_type row,
-                                    const size_type column)
+BlockMatrixBase<MatrixType>::block (const unsigned int row,
+                                    const unsigned int column)
 {
   Assert (row<n_block_rows(),
           ExcIndexRange (row, 0, n_block_rows()));
@@ -1811,8 +1811,8 @@ BlockMatrixBase<MatrixType>::block (const size_type row,
 template <class MatrixType>
 inline
 const typename BlockMatrixBase<MatrixType>::BlockType &
-BlockMatrixBase<MatrixType>::block (const size_type row,
-                                    const size_type column) const
+BlockMatrixBase<MatrixType>::block (const unsigned int row,
+                                    const unsigned int column) const
 {
   Assert (row<n_block_rows(),
           ExcIndexRange (row, 0, n_block_rows()));
@@ -1845,7 +1845,7 @@ BlockMatrixBase<MatrixType>::n () const
 
 template <class MatrixType>
 inline
-typename BlockMatrixBase<MatrixType>::size_type
+unsigned int
 BlockMatrixBase<MatrixType>::n_block_cols () const
 {
   return column_block_indices.size();
@@ -1855,7 +1855,7 @@ BlockMatrixBase<MatrixType>::n_block_cols () const
 
 template <class MatrixType>
 inline
-typename BlockMatrixBase<MatrixType>::size_type
+unsigned int
 BlockMatrixBase<MatrixType>::n_block_rows () const
 {
   return row_block_indices.size();
@@ -1980,7 +1980,7 @@ BlockMatrixBase<MatrixType>::set (const size_type  row,
   // through all of them.
   if (column_indices[0].size() < n_cols)
     {
-      for (size_type i=0; i<this->n_block_cols(); ++i)
+      for (unsigned int i=0; i<this->n_block_cols(); ++i)
         {
           column_indices[i].resize(n_cols);
           column_values[i].resize(n_cols);
@@ -1989,7 +1989,7 @@ BlockMatrixBase<MatrixType>::set (const size_type  row,
 
   // Reset the number of added elements
   // in each block to zero.
-  for (size_type i=0; i<this->n_block_cols(); ++i)
+  for (unsigned int i=0; i<this->n_block_cols(); ++i)
     counter_within_block[i] = 0;
 
   // Go through the column indices to
@@ -2021,7 +2021,7 @@ BlockMatrixBase<MatrixType>::set (const size_type  row,
   // If in debug mode, do a check whether
   // the right length has been obtained.
   size_type length = 0;
-  for (size_type i=0; i<this->n_block_cols(); ++i)
+  for (unsigned int i=0; i<this->n_block_cols(); ++i)
     length += counter_within_block[i];
   Assert (length <= n_cols, ExcInternalError());
 #endif
@@ -2033,7 +2033,7 @@ BlockMatrixBase<MatrixType>::set (const size_type  row,
   // the individual blocks!
   const std::pair<size_type,size_type>
   row_index = this->row_block_indices.global_to_local (row);
-  for (size_type block_col=0; block_col<n_block_cols(); ++block_col)
+  for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
     {
       if (counter_within_block[block_col] == 0)
         continue;
@@ -2225,7 +2225,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
   // through all of them.
   if (column_indices[0].size() < n_cols)
     {
-      for (size_type i=0; i<this->n_block_cols(); ++i)
+      for (unsigned int i=0; i<this->n_block_cols(); ++i)
         {
           column_indices[i].resize(n_cols);
           column_values[i].resize(n_cols);
@@ -2234,7 +2234,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
 
   // Reset the number of added elements
   // in each block to zero.
-  for (size_type i=0; i<this->n_block_cols(); ++i)
+  for (unsigned int i=0; i<this->n_block_cols(); ++i)
     counter_within_block[i] = 0;
 
   // Go through the column indices to
@@ -2266,7 +2266,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
   // If in debug mode, do a check whether
   // the right length has been obtained.
   size_type length = 0;
-  for (size_type i=0; i<this->n_block_cols(); ++i)
+  for (unsigned int i=0; i<this->n_block_cols(); ++i)
     length += counter_within_block[i];
   Assert (length <= n_cols, ExcInternalError());
 #endif
@@ -2278,7 +2278,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
   // the individual blocks!
   const std::pair<size_type,size_type>
   row_index = this->row_block_indices.global_to_local (row);
-  for (size_type block_col=0; block_col<n_block_cols(); ++block_col)
+  for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
     {
       if (counter_within_block[block_col] == 0)
         continue;
@@ -2314,8 +2314,8 @@ BlockMatrixBase<MatrixType>::add (const value_type                   factor,
       (factor == 0))
     return;
 
-  for (size_type row=0; row<n_block_rows(); ++row)
-    for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
+    for (unsigned int col=0; col<n_block_cols(); ++col)
       // This function should throw if the sparsity
       // patterns of the two blocks differ
       block(row, col).add(factor, matrix.block(row,col));
@@ -2373,8 +2373,8 @@ inline
 void
 BlockMatrixBase<MatrixType>::compress (::dealii::VectorOperation::values operation)
 {
-  for (size_type r=0; r<n_block_rows(); ++r)
-    for (size_type c=0; c<n_block_cols(); ++c)
+  for (unsigned int r=0; r<n_block_rows(); ++r)
+    for (unsigned int c=0; c<n_block_cols(); ++c)
       block(r,c).compress (operation);
 }
 
@@ -2396,8 +2396,8 @@ BlockMatrixBase<MatrixType>::operator *= (const value_type factor)
   Assert (n_block_cols() != 0, ExcNotInitialized());
   Assert (n_block_rows() != 0, ExcNotInitialized());
 
-  for (size_type r=0; r<n_block_rows(); ++r)
-    for (size_type c=0; c<n_block_cols(); ++c)
+  for (unsigned int r=0; r<n_block_rows(); ++r)
+    for (unsigned int c=0; c<n_block_cols(); ++c)
       block(r,c) *= factor;
 
   return *this;
@@ -2416,8 +2416,8 @@ BlockMatrixBase<MatrixType>::operator /= (const value_type factor)
 
   const value_type factor_inv = 1. / factor;
 
-  for (size_type r=0; r<n_block_rows(); ++r)
-    for (size_type c=0; c<n_block_cols(); ++c)
+  for (unsigned int r=0; r<n_block_rows(); ++r)
+    for (unsigned int c=0; c<n_block_cols(); ++c)
       block(r,c) *= factor_inv;
 
   return *this;
@@ -2535,11 +2535,11 @@ BlockMatrixBase<MatrixType>::vmult_add (BlockVectorType       &dst,
   Assert (src.n_blocks() == n_block_cols(),
           ExcDimensionMismatch(src.n_blocks(), n_block_cols()));
 
-  for (size_type row=0; row<n_block_rows(); ++row)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
     {
       block(row,0).vmult_add (dst.block(row),
                               src.block(0));
-      for (size_type col=1; col<n_block_cols(); ++col)
+      for (unsigned int col=1; col<n_block_cols(); ++col)
         block(row,col).vmult_add (dst.block(row),
                                   src.block(col));
     };
@@ -2562,9 +2562,9 @@ Tvmult_block_block (BlockVectorType       &dst,
 
   dst = 0.;
 
-  for (size_type row=0; row<n_block_rows(); ++row)
+  for (unsigned int  row=0; row<n_block_rows(); ++row)
     {
-      for (size_type col=0; col<n_block_cols(); ++col)
+      for (unsigned int col=0; col<n_block_cols(); ++col)
         block(row,col).Tvmult_add (dst.block(col),
                                    src.block(row));
     };
@@ -2587,7 +2587,7 @@ Tvmult_block_nonblock (BlockVectorType  &dst,
 
   dst = 0.;
 
-  for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int col=0; col<n_block_cols(); ++col)
     block(0,col).Tvmult_add (dst.block(col), src);
 }
 
@@ -2642,9 +2642,9 @@ BlockMatrixBase<MatrixType>::Tvmult_add (BlockVectorType &dst,
   Assert (src.n_blocks() == n_block_rows(),
           ExcDimensionMismatch(src.n_blocks(), n_block_rows()));
 
-  for (size_type row=0; row<n_block_rows(); ++row)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
     {
-      for (size_type col=0; col<n_block_cols(); ++col)
+      for (unsigned int col=0; col<n_block_cols(); ++col)
         block(row,col).Tvmult_add (dst.block(col),
                                    src.block(row));
     };
@@ -2662,8 +2662,8 @@ BlockMatrixBase<MatrixType>::matrix_norm_square (const BlockVectorType &v) const
           ExcDimensionMismatch(v.n_blocks(), n_block_rows()));
 
   value_type norm_sqr = 0;
-  for (size_type row=0; row<n_block_rows(); ++row)
-    for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
+    for (unsigned int col=0; col<n_block_cols(); ++col)
       if (row==col)
         norm_sqr += block(row,col).matrix_norm_square (v.block(row));
       else
@@ -2687,8 +2687,8 @@ matrix_scalar_product (const BlockVectorType    &u,
           ExcDimensionMismatch(v.n_blocks(), n_block_cols()));
 
   value_type result = 0;
-  for (size_type row=0; row<n_block_rows(); ++row)
-    for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
+    for (unsigned int col=0; col<n_block_cols(); ++col)
       result += block(row,col).matrix_scalar_product (u.block(row),
                                                       v.block(col));
   return result;
@@ -2724,7 +2724,7 @@ residual (BlockVectorType          &dst,
   // perform a sign change of the
   // first two term before, and after
   // adding up
-  for (size_type row=0; row<n_block_rows(); ++row)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
     {
       block(row,0).residual (dst.block(row),
                              x.block(0),
@@ -2733,7 +2733,7 @@ residual (BlockVectorType          &dst,
       for (size_type i=0; i<dst.block(row).size(); ++i)
         dst.block(row)(i) = -dst.block(row)(i);
 
-      for (size_type col=1; col<n_block_cols(); ++col)
+      for (unsigned int col=1; col<n_block_cols(); ++col)
         block(row,col).vmult_add (dst.block(row),
                                   x.block(col));
 
@@ -2755,8 +2755,8 @@ void
 BlockMatrixBase<MatrixType>::print (std::ostream &out,
                                     const bool    alternative_output) const
 {
-  for (size_type row=0; row<n_block_rows(); ++row)
-    for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
+    for (unsigned int col=0; col<n_block_cols(); ++col)
       {
         if (!alternative_output)
           out << "Block (" << row << ", " << col << ")" << std::endl;
@@ -2860,13 +2860,13 @@ BlockMatrixBase<MatrixType>::collect_sizes ()
 
   // first find out the row sizes
   // from the first block column
-  for (size_type r=0; r<this->n_block_rows(); ++r)
+  for (unsigned int r=0; r<this->n_block_rows(); ++r)
     row_sizes[r] = sub_objects[r][0]->m();
   // then check that the following
   // block columns have the same
   // sizes
-  for (size_type c=1; c<this->n_block_cols(); ++c)
-    for (size_type r=0; r<this->n_block_rows(); ++r)
+  for (unsigned int c=1; c<this->n_block_cols(); ++c)
+    for (unsigned int r=0; r<this->n_block_rows(); ++r)
       Assert (row_sizes[r] == sub_objects[r][c]->m(),
               ExcIncompatibleRowNumbers (r,0,r,c));
 
@@ -2876,10 +2876,10 @@ BlockMatrixBase<MatrixType>::collect_sizes ()
 
 
   // then do the same with the columns
-  for (size_type c=0; c<this->n_block_cols(); ++c)
+  for (unsigned int c=0; c<this->n_block_cols(); ++c)
     col_sizes[c] = sub_objects[0][c]->n();
-  for (size_type r=1; r<this->n_block_rows(); ++r)
-    for (size_type c=0; c<this->n_block_cols(); ++c)
+  for (unsigned int r=1; r<this->n_block_rows(); ++r)
+    for (unsigned int c=0; c<this->n_block_cols(); ++c)
       Assert (col_sizes[c] == sub_objects[r][c]->n(),
               ExcIncompatibleRowNumbers (0,c,r,c));
 
@@ -2894,8 +2894,8 @@ template <class MatrixType>
 void
 BlockMatrixBase<MatrixType>::prepare_add_operation ()
 {
-  for (size_type row=0; row<n_block_rows(); ++row)
-    for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
+    for (unsigned int col=0; col<n_block_cols(); ++col)
       block(row, col).prepare_add();
 }
 
@@ -2905,8 +2905,8 @@ template <class MatrixType>
 void
 BlockMatrixBase<MatrixType>::prepare_set_operation ()
 {
-  for (size_type row=0; row<n_block_rows(); ++row)
-    for (size_type col=0; col<n_block_cols(); ++col)
+  for (unsigned int row=0; row<n_block_rows(); ++row)
+    for (unsigned int col=0; col<n_block_cols(); ++col)
       block(row, col).prepare_set();
 }
 
index 8e295949ab6d7186960e91a7c96a49ef78312c6b..3dca22527c5eb70755d300f7250d4876e5a3e0bf 100644 (file)
@@ -218,7 +218,7 @@ private:
   /**
    * Sizes of the multi-level vectors.
    */
-  std::vector<unsigned int> sizes;
+  std::vector<types::global_dof_index> sizes;
 
   /**
    * Sparsity patterns for transfer
index 108f6b5dee5fa75a98db79d82a30867fd3879957..d37393aa338a715295c1ad4904ae5aadea5febc5 100644 (file)
@@ -642,7 +642,11 @@ void ConstraintMatrix::condense (const SparsityPattern &uncondensed,
 
   // store for each line of the matrix its new line number after
   // compression. If the shift is -1, this line will be condensed away
+#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
   std::vector<int> new_line;
+#else
+  std::vector<long long int> new_line;
+#endif
 
   new_line.reserve (uncondensed.n_rows());
 
@@ -1504,7 +1508,7 @@ void ConstraintMatrix::condense (BlockCompressedSimpleSparsityPattern &sparsity)
                   else
                     // distribute entry at irregular row @p{row} and
                     // irregular column @p{global_col}
-                    { for (size_type int p=0;
+                    { for (size_type p=0;
                            p!=lines[distribute[row]].entries.size(); ++p)
                         for (size_type q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                           sparsity.add (lines[distribute[row]].entries[p].first,
index 8d920f126eb8a009702319a7cc47b5e4f5a0b22d..a6c41c3e803385555d652c5398075893c8c5f324 100644 (file)
@@ -524,11 +524,11 @@ void MGTransferComponentBase::build_matrices (
                                                      ende = prolongation_matrices[level]->block(iblock,jblock).end(i);
                       for (; anfang != ende; ++anfang)
                         {
-                          const unsigned int column_number = anfang->column();
+                          const types::global_dof_index column_number = anfang->column();
 
                           //convert global indices into local ones
                           const BlockIndices block_indices_coarse (dofs_per_component[level]);
-                          const unsigned int global_j = block_indices_coarse.local_to_global(iblock, column_number);
+                          const types::global_dof_index global_j = block_indices_coarse.local_to_global(iblock, column_number);
 
                           std::set<types::global_dof_index>::const_iterator found_dof =
                             boundary_indices[level].find(global_j);
index 9b33964c32ca6bfadb234fae227e5075623e2647..4d95a80303bee0bafdc14fb31d125382b7ac4e9f 100644 (file)
@@ -1236,7 +1236,7 @@ namespace MatrixCreator
 #ifdef DEBUG
       if (true)
         {
-          unsigned int max_element = 0;
+          types::global_dof_index max_element = 0;
           for (std::vector<types::global_dof_index>::const_iterator i=dof_to_boundary_mapping.begin();
                i!=dof_to_boundary_mapping.end(); ++i)
             if ((*i != hp::DoFHandler<dim,spacedim>::invalid_dof_index) &&
@@ -1960,7 +1960,7 @@ namespace MatrixTools
       return;
 
 
-    const unsigned int n_dofs = matrix.m();
+    const types::global_dof_index n_dofs = matrix.m();
 
     // if a diagonal entry is zero
     // later, then we use another
@@ -2048,7 +2048,7 @@ namespace MatrixTools
                  q = matrix.begin(dof_number)+1;
                  q != matrix.end(dof_number); ++q)
               {
-                const unsigned int row = q->column();
+                const types::global_dof_index row = q->column();
 
                 // find the position of
                 // element
@@ -2125,7 +2125,7 @@ namespace MatrixTools
       return;
 
 
-    const unsigned int n_dofs = matrix.m();
+    const types::global_dof_index n_dofs = matrix.m();
 
     // if a diagonal entry is zero
     // later, then we use another
@@ -2290,7 +2290,7 @@ namespace MatrixTools
                     // get the number of the column in this row in which a
                     // nonzero entry is. this is also the row of the transpose
                     // block which has an entry in the interesting row
-                    const unsigned int row = q->column();
+                    const types::global_dof_index row = q->column();
 
                     // find the position of element (row,dof_number) in this
                     // block (not in the transpose one). note that we have to
@@ -2389,7 +2389,7 @@ namespace MatrixTools
         // matrix that we can see. if we can't
         // find such an entry, take one
         PetscScalar average_nonzero_diagonal_entry = 1;
-        for (unsigned int i=local_range.first; i<local_range.second; ++i)
+        for (types::global_dof_index i=local_range.first; i<local_range.second; ++i)
           if (matrix.diag_element(i) != 0)
             {
               average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
@@ -2507,7 +2507,8 @@ namespace MatrixTools
     // maps with the respective indices.
     std::vector<std::map<dealii::types::global_dof_index,double> > block_boundary_values(n_blocks);
     {
-      int offset = 0, block=0;
+      int block = 0;
+      dealii::types::global_dof_index offset = 0;
       for (std::map<types::global_dof_index,double>::const_iterator
            dof  = boundary_values.begin();
            dof != boundary_values.end();
index 70a15161f36212adc0596272153b989dcfa71ed9..03859e48e1a03a266a2fa33b727cd218087e0d5c 100644 (file)
@@ -270,11 +270,7 @@ void PointValueHistory<dim>
 
   std::vector<types::global_dof_index>
   local_dof_indices (dof_handler->get_fe ().dofs_per_cell);
-#ifndef deal_ii_use_large_index_type
-      std::vector <int> new_solution_indices;
-#else
-      std::vector <long long int> new_solution_indices;
-#endif
+  std::vector <int> new_solution_indices;
   current_cell->get_dof_indices (local_dof_indices);
   // there is an implicit assumption here
   // that all the closest support point to
@@ -419,11 +415,7 @@ void PointValueHistory<dim>
   for (unsigned int point = 0; point < locations.size (); point++)
     {
       current_cell[point]->get_dof_indices (local_dof_indices);
-#ifndef deal_ii_use_large_index_type
       std::vector <int> new_solution_indices;
-#else
-      std::vector <long long int> new_solution_indices;
-#endif
 
       for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++)
         {

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.