]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix some conversion warnings.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Apr 2013 16:56:14 +0000 (16:56 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Apr 2013 16:56:14 +0000 (16:56 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29289 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/dof_accessor.templates.h
deal.II/include/deal.II/dofs/number_cache.h
deal.II/include/deal.II/lac/block_matrix_base.h
deal.II/include/deal.II/lac/block_sparse_matrix_ez.h
deal.II/include/deal.II/lac/block_sparse_matrix_ez.templates.h
deal.II/include/deal.II/lac/matrix_block.h

index 8f6a07ae0bdbff36a2cff435b4db02f3187518c0..f08bd965a892cb64db2a875a15c8e1a0ed98319d 100644 (file)
@@ -2289,7 +2289,7 @@ DoFAccessor<0,DH<1,spacedim>, lda>::get_dof_indices (
   std::vector<types::global_dof_index> &dof_indices,
   const unsigned int fe_index) const
 {
-  for (types::global_dof_index i=0; i<dof_indices.size(); ++i)
+  for (unsigned int i=0; i<dof_indices.size(); ++i)
     dof_indices[i]
       = dealii::internal::DoFAccessor::Implementation::get_vertex_dof_index (
           *dof_handler,
@@ -2613,6 +2613,9 @@ namespace internal
           for (unsigned int d=0; d<dofs_per_vertex; ++d, ++index)
             accessor.set_vertex_dof_index(vertex,d,
                                           local_dof_indices[index]);
+        //TODO[bt] the function dof_index expects two unsigned int (I am not
+        //sure what should be the type of fe_index) but the following loop
+        //seems to do nothing but incrementing index.
         for (unsigned int d=0; d<dofs_per_line; ++d, ++index)
           accessor.dof_index(d, local_dof_indices[index]);
 
index 469bbe7804a1bba9d086e560ba2eee2b0e7a5baf..848ad9db2d4b7ba70630a723f6351652240ddde8 100644 (file)
@@ -64,7 +64,7 @@ namespace internal
        * computation, then this
        * equals n_global_dofs.
        */
-      types::global_dof_index n_locally_owned_dofs;
+      unsigned int n_locally_owned_dofs;
 
       /**
        * An index set denoting the
index 803501437c87fd9d5d012e5a1a1cbdd909356e82..3b03e827586c62757d1845d23a7e34b379baeb06 100644 (file)
@@ -75,27 +75,27 @@ namespace BlockMatrixIterators
      * element represented by
      * this object.
      */
-    size_type block_row() const;
+    unsigned int block_row() const;
 
     /**
      * Block column of the
      * element represented by
      * this object.
      */
-    size_type block_column() const;
+    unsigned int block_column() const;
 
   protected:
     /**
      * Block row into which we presently
      * point.
      */
-    size_type row_block;
+    unsigned int row_block;
 
     /**
      * Block column into which we
      * presently point.
      */
-    size_type col_block;
+    unsigned int col_block;
 
     /**
      * Let the iterator class be a
@@ -1293,10 +1293,10 @@ namespace BlockMatrixIterators
 
   template <class BlockMatrix>
   inline
-  typename AccessorBase<BlockMatrix>::size_type
+  unsigned int
   AccessorBase<BlockMatrix>::block_row() const
   {
-    Assert (row_block != numbers::invalid_size_type,
+    Assert (row_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
 
     return row_block;
@@ -1305,10 +1305,10 @@ namespace BlockMatrixIterators
 
   template <class BlockMatrix>
   inline
-  typename AccessorBase<BlockMatrix>::size_type
+  unsigned int
   AccessorBase<BlockMatrix>::block_column() const
   {
-    Assert (col_block != numbers::invalid_size_type,
+    Assert (col_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
 
     return col_block;
@@ -1319,8 +1319,8 @@ namespace BlockMatrixIterators
   inline
   Accessor<BlockMatrix, true>::Accessor (
     const BlockMatrix  *matrix,
-    const size_type    row,
-    const size_type    col)
+    const size_type     row,
+    const size_type     col)
     :
     matrix(matrix),
     base_iterator(matrix->block(0,0).begin())
@@ -1331,7 +1331,7 @@ namespace BlockMatrixIterators
     // the end of the matrix
     if (row < matrix->m())
       {
-        const std::pair<size_type,size_type> indices
+        const std::pair<unsigned int,size_type> indices
           = matrix->row_block_indices.global_to_local(row);
 
         // find the first block that does
@@ -1361,8 +1361,8 @@ namespace BlockMatrixIterators
       {
         // we were asked to create the end
         // iterator for this matrix
-        this->row_block = numbers::invalid_size_type;
-        this->col_block = numbers::invalid_size_type;
+        this->row_block = numbers::invalid_unsigned_int;
+        this->col_block = numbers::invalid_unsigned_int;
       }
   }
 
@@ -1396,7 +1396,7 @@ namespace BlockMatrixIterators
   typename Accessor<BlockMatrix, true>::size_type
   Accessor<BlockMatrix, true>::row() const
   {
-    Assert (this->row_block != numbers::invalid_size_type,
+    Assert (this->row_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
 
     return (matrix->row_block_indices.local_to_global(this->row_block, 0) +
@@ -1409,7 +1409,7 @@ namespace BlockMatrixIterators
   typename Accessor<BlockMatrix, true>::size_type
   Accessor<BlockMatrix, true>::column() const
   {
-    Assert (this->col_block != numbers::invalid_size_type,
+    Assert (this->col_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
 
     return (matrix->column_block_indices.local_to_global(this->col_block,0) +
@@ -1422,9 +1422,9 @@ namespace BlockMatrixIterators
   typename Accessor<BlockMatrix, true>::value_type
   Accessor<BlockMatrix, true>::value () const
   {
-    Assert (this->row_block != numbers::invalid_size_type,
+    Assert (this->row_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
-    Assert (this->col_block != numbers::invalid_size_type,
+    Assert (this->col_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
 
     return base_iterator->value();
@@ -1437,9 +1437,9 @@ namespace BlockMatrixIterators
   void
   Accessor<BlockMatrix, true>::advance ()
   {
-    Assert (this->row_block != numbers::invalid_size_type,
+    Assert (this->row_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
-    Assert (this->col_block != numbers::invalid_size_type,
+    Assert (this->col_block != numbers::invalid_unsigned_int,
             ExcIteratorPastEnd());
 
     // Remember current row inside block
@@ -1485,8 +1485,8 @@ namespace BlockMatrixIterators
                 ++this->row_block;
                 if (this->row_block == matrix->n_block_rows())
                   {
-                    this->row_block = numbers::invalid_size_type;
-                    this->col_block = numbers::invalid_size_type;
+                    this->row_block = numbers::invalid_unsigned_int;
+                    this->col_block = numbers::invalid_unsigned_int;
                     return;
                   }
               }
@@ -1512,9 +1512,9 @@ namespace BlockMatrixIterators
       // have to have the same
       // base_iterator representation, but
       // valid iterators have to
-      return (((this->row_block == numbers::invalid_size_type)
+      return (((this->row_block == numbers::invalid_unsigned_int)
                &&
-               (this->col_block == numbers::invalid_size_type))
+               (this->col_block == numbers::invalid_unsigned_int))
               ||
               (base_iterator == a.base_iterator));
 
@@ -1539,7 +1539,7 @@ namespace BlockMatrixIterators
     // the end of the matrix
     if (row < matrix->m())
       {
-        const std::pair<size_type,size_type> indices
+        const std::pair<unsigned int,size_type> indices
           = matrix->row_block_indices.global_to_local(row);
 
         // find the first block that does
@@ -1877,7 +1877,7 @@ BlockMatrixBase<MatrixType>::set (const size_type i,
 
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   block(row_index.first,col_index.first).set (row_index.second,
@@ -2008,7 +2008,7 @@ BlockMatrixBase<MatrixType>::set (const size_type  row,
       if (value == 0 && elide_zero_values == true)
         continue;
 
-      const std::pair<size_type, size_type>
+      const std::pair<unsigned int, size_type>
       col_index = this->column_block_indices.global_to_local(col_indices[j]);
 
       const size_type local_index = counter_within_block[col_index.first]++;
@@ -2031,7 +2031,7 @@ BlockMatrixBase<MatrixType>::set (const size_type  row,
   // where we should start reading out
   // data. Now let's write the data into
   // the individual blocks!
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = this->row_block_indices.global_to_local (row);
   for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
     {
@@ -2070,7 +2070,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  i,
       (value == value_type()))
     return;
 
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   block(row_index.first,col_index.first).add (row_index.second,
@@ -2170,7 +2170,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
           else
             before = col_indices[i];
 #endif
-      const std::pair<size_type,size_type>
+      const std::pair<unsigned int,size_type>
       row_index = this->row_block_indices.global_to_local (row);
 
       if (this->n_block_cols() > 1)
@@ -2253,7 +2253,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
       if (value == 0 && elide_zero_values == true)
         continue;
 
-      const std::pair<size_type, size_type>
+      const std::pair<unsigned int, size_type>
       col_index = this->column_block_indices.global_to_local(col_indices[j]);
 
       const size_type local_index = counter_within_block[col_index.first]++;
@@ -2276,7 +2276,7 @@ BlockMatrixBase<MatrixType>::add (const size_type  row,
   // where we should start reading out
   // data. Now let's write the data into
   // the individual blocks!
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = this->row_block_indices.global_to_local (row);
   for (unsigned int block_col=0; block_col<n_block_cols(); ++block_col)
     {
@@ -2329,7 +2329,7 @@ typename BlockMatrixBase<MatrixType>::value_type
 BlockMatrixBase<MatrixType>::operator () (const size_type i,
                                           const size_type j) const
 {
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   return block(row_index.first,col_index.first) (row_index.second,
@@ -2344,7 +2344,7 @@ typename BlockMatrixBase<MatrixType>::value_type
 BlockMatrixBase<MatrixType>::el (const size_type i,
                                  const size_type j) const
 {
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = row_block_indices.global_to_local (i),
   col_index = column_block_indices.global_to_local (j);
   return block(row_index.first,col_index.first).el (row_index.second,
@@ -2361,7 +2361,7 @@ BlockMatrixBase<MatrixType>::diag_element (const size_type i) const
   Assert (n_block_rows() == n_block_cols(),
           ExcNotQuadratic());
 
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   index = row_block_indices.global_to_local (i);
   return block(index.first,index.first).diag_element(index.second);
 }
index 70d48988199cc43a5a7b6bea9c1f583c7e4ee196..79db7b54b1e65c85928d5bf0170dbcd3e6ffd9f4 100644 (file)
@@ -66,8 +66,8 @@ public:
    * blocks themselves still have
    * zero dimension.
    */
-  BlockSparseMatrixEZ (const size_type block_rows,
-                       const size_type block_cols);
+  BlockSparseMatrixEZ (const unsigned int block_rows,
+                       const unsigned int block_cols);
 
   /**
    * Copy constructor. This is
@@ -128,8 +128,8 @@ public:
    * called to update internal data
    * structures.
    */
-  void reinit (const size_type n_block_rows,
-               const size_type n_block_cols);
+  void reinit (const unsigned int n_block_rows,
+               const unsigned int n_block_cols);
   /**
    * This function collects the
    * sizes of the sub-objects and
@@ -149,8 +149,8 @@ public:
    * given coordinates.
    */
   SparseMatrixEZ<Number> &
-  block (const size_type row,
-         const size_type column);
+  block (const unsigned int row,
+         const unsigned int column);
 
 
   /**
@@ -159,20 +159,20 @@ public:
    * constant objects.
    */
   const SparseMatrixEZ<Number> &
-  block (const size_type row,
-         const size_type column) const;
+  block (const unsigned int row,
+         const unsigned int column) const;
 
   /**
    * Return the number of blocks in a
    * column.
    */
-  size_type n_block_rows () const;
+  unsigned int n_block_rows () const;
 
   /**
    * Return the number of blocks in a
    * row.
    */
-  size_type n_block_cols () const;
+  unsigned int n_block_cols () const;
 
   /**
    * Return whether the object is
@@ -333,7 +333,7 @@ private:
 
 template <typename Number>
 inline
-typename BlockSparseMatrixEZ<Number>::size_type
+unsigned int
 BlockSparseMatrixEZ<Number>::n_block_rows () const
 {
   return row_indices.size();
@@ -353,7 +353,7 @@ BlockSparseMatrixEZ<Number>::n_rows () const
 
 template <typename Number>
 inline
-typename BlockSparseMatrixEZ<Number>::size_type
+unsigned int
 BlockSparseMatrixEZ<Number>::n_block_cols () const
 {
   return column_indices.size();
@@ -374,8 +374,8 @@ BlockSparseMatrixEZ<Number>::n_cols () const
 template <typename Number>
 inline
 SparseMatrixEZ<Number> &
-BlockSparseMatrixEZ<Number>::block (const size_type row,
-                                    const size_type column)
+BlockSparseMatrixEZ<Number>::block (const unsigned int row,
+                                    const unsigned int column)
 {
   Assert (row<n_block_rows(), ExcIndexRange (row, 0, n_block_rows()));
   Assert (column<n_block_cols(), ExcIndexRange (column, 0, n_block_cols()));
@@ -388,8 +388,8 @@ BlockSparseMatrixEZ<Number>::block (const size_type row,
 template <typename Number>
 inline
 const SparseMatrixEZ<Number> &
-BlockSparseMatrixEZ<Number>::block (const size_type row,
-                                    const size_type column) const
+BlockSparseMatrixEZ<Number>::block (const unsigned int row,
+                                    const unsigned int column) const
 {
   Assert (row<n_block_rows(), ExcIndexRange (row, 0, n_block_rows()));
   Assert (column<n_block_cols(), ExcIndexRange (column, 0, n_block_cols()));
@@ -449,7 +449,7 @@ BlockSparseMatrixEZ<Number>::add (const size_type i,
 
   Assert (numbers::is_finite(value), ExcNumberNotFinite());
 
-  const std::pair<size_type,size_type>
+  const std::pair<unsigned int,size_type>
   row_index = row_indices.global_to_local (i),
   col_index = column_indices.global_to_local (j);
   block(row_index.first,col_index.first).add (row_index.second,
@@ -514,8 +514,8 @@ Tvmult (BlockVector<somenumber>       &dst,
 
   dst = 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)
       block(row,col).Tvmult_add (dst.block(col),
                                  src.block(row));
 }
@@ -534,12 +534,10 @@ Tvmult_add (BlockVector<somenumber>       &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 (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).Tvmult_add (dst.block(col),
                                    src.block(row));
-    };
 }
 
 
index a97b1175b06494f23f91bbc98490af0b4d7bfd13..5ed65230196d1a66cadc2514cb550471a16c26d0 100644 (file)
@@ -28,8 +28,8 @@ BlockSparseMatrixEZ<number>::BlockSparseMatrixEZ ()
 
 template <typename number>
 BlockSparseMatrixEZ<number>::
-BlockSparseMatrixEZ (const size_type rows,
-                     const size_type cols)
+BlockSparseMatrixEZ (const unsigned int rows,
+                     const unsigned int cols)
   :
   row_indices (rows, 0),
   column_indices (cols, 0)
@@ -60,8 +60,8 @@ operator = (const BlockSparseMatrixEZ<number> &m)
   // anything except than checking
   // whether the base objects want to
   // do something
-  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) = m.block(r,c);
   return *this;
 }
@@ -74,8 +74,8 @@ BlockSparseMatrixEZ<number>::operator = (const double d)
 {
   Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
-  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) = 0;
 
   return *this;
@@ -97,8 +97,8 @@ BlockSparseMatrixEZ<number>::BlockSparseMatrixEZ (
 
 template <typename number>
 void
-BlockSparseMatrixEZ<number>::reinit (const size_type rows,
-                                     const size_type cols)
+BlockSparseMatrixEZ<number>::reinit (const unsigned int rows,
+                                     const unsigned int cols)
 {
   row_indices.reinit(rows, 0);
   column_indices.reinit(cols, 0);
@@ -122,8 +122,8 @@ template <typename number>
 bool
 BlockSparseMatrixEZ<number>::empty () const
 {
-  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)
       if (block(r,c).empty () == false)
         return false;
   return true;
@@ -135,20 +135,20 @@ template <typename number>
 void
 BlockSparseMatrixEZ<number>::collect_sizes ()
 {
-  const size_type rows = n_block_rows();
-  const size_type columns = n_block_cols();
+  const unsigned int rows = n_block_rows();
+  const unsigned int columns = n_block_cols();
   std::vector<size_type> row_sizes (rows);
   std::vector<size_type> col_sizes (columns);
 
   // first find out the row sizes
   // from the first block column
-  for (size_type r=0; r<rows; ++r)
+  for (unsigned int r=0; r<rows; ++r)
     row_sizes[r] = blocks[r][0].m();
   // then check that the following
   // block columns have the same
   // sizes
-  for (size_type c=1; c<columns; ++c)
-    for (size_type r=0; r<rows; ++r)
+  for (unsigned int c=1; c<columns; ++c)
+    for (unsigned int r=0; r<rows; ++r)
       Assert (row_sizes[r] == blocks[r][c].m(),
               ExcDimensionMismatch (row_sizes[r], blocks[r][c].m()));
 
@@ -158,10 +158,10 @@ BlockSparseMatrixEZ<number>::collect_sizes ()
 
 
   // then do the same with the columns
-  for (size_type c=0; c<columns; ++c)
+  for (unsigned int c=0; c<columns; ++c)
     col_sizes[c] = blocks[0][c].n();
-  for (size_type r=1; r<rows; ++r)
-    for (size_type c=0; c<columns; ++c)
+  for (unsigned int r=1; r<rows; ++r)
+    for (unsigned int c=0; c<columns; ++c)
       Assert (col_sizes[c] == blocks[r][c].n(),
               ExcDimensionMismatch (col_sizes[c], blocks[r][c].n()));
 
index 582186166250556703119cf24386f64ec7ea8387..c26ece3303f59b408daa997dbcc7e78464c8c591 100644 (file)
@@ -707,8 +707,8 @@ template <class MATRIX>
 inline
 MatrixBlock<MATRIX>::MatrixBlock()
   :
-  row(deal_II_numbers::invalid_size_type),
-  column(deal_II_numbers::invalid_size_type)
+  row(deal_II_numbers::invalid_unsigned_int),
+  column(deal_II_numbers::invalid_unsigned_int)
 {}
 
 

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.