]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix some conversion warning.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Apr 2013 17:17:52 +0000 (17:17 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Apr 2013 17:17:52 +0000 (17:17 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29165 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/fe/fe.h
deal.II/include/deal.II/lac/block_indices.h
deal.II/include/deal.II/lac/full_matrix.h
deal.II/include/deal.II/lac/householder.h
deal.II/source/fe/fe_tools.cc

index 3059dbcc02e9f7a1469ac788284bd90e22266362..851795456b6cf1941b0f7782e44213145a8922b0 100644 (file)
@@ -1505,7 +1505,7 @@ public:
    * return the first block of a
    * BlockVector it would generate.
    */
-  unsigned int first_block_of_base (const unsigned int b) const;
+  types::global_dof_index first_block_of_base (const unsigned int b) const;
 
   /**
    * For each vector component,
@@ -1548,7 +1548,7 @@ public:
    * inside the block for this
    * shape function.
    */
-  std::pair<unsigned int,unsigned int>
+  std::pair<unsigned int,types::global_dof_index>
   system_to_block_index (const unsigned int component) const;
 
   /**
@@ -2892,7 +2892,7 @@ FiniteElement<dim,spacedim>::face_system_to_base_index (const unsigned int index
 
 template <int dim, int spacedim>
 inline
-unsigned int
+types::global_dof_index
 FiniteElement<dim,spacedim>::first_block_of_base (const unsigned int index) const
 {
   return base_to_block_indices.block_start(index);
@@ -2925,7 +2925,7 @@ FiniteElement<dim,spacedim>::block_to_base_index (const unsigned int index) cons
 
 template <int dim, int spacedim>
 inline
-std::pair<unsigned int,unsigned int>
+std::pair<unsigned int,types::global_dof_index>
 FiniteElement<dim,spacedim>::system_to_block_index (const unsigned int index) const
 {
   Assert (index < this->dofs_per_cell,
@@ -2933,7 +2933,7 @@ FiniteElement<dim,spacedim>::system_to_block_index (const unsigned int index) co
   // The block is computed simply as
   // first block of this base plus
   // the index within the base blocks
-  return std::pair<unsigned int, unsigned int>(
+  return std::pair<unsigned int, types::global_dof_index>(
            first_block_of_base(system_to_base_table[index].first.first)
            + system_to_base_table[index].first.second,
            system_to_base_table[index].second);
index 5fca62c6a2c12279517688d6f871ca274166def0..7ab39f3198a1350a3648d8c69165a3c1851c00f6 100644 (file)
@@ -120,12 +120,12 @@ public:
    * of the vector space of the
    * block vector.
    */
-  std::size_t total_size () const;
+  size_type total_size () const;
 
   /**
    * The size of the @p ith block.
    */
-  std::size_t block_size (const size_type i) const;
+  size_type block_size (const size_type i) const;
 
   //@}
 
@@ -165,7 +165,7 @@ public:
   /**
    * The start index of the ith block.
    */
-  size_type block_start (const size_type i) const;
+  size_type block_start (const unsigned int i) const;
   //@}
 
   /**
@@ -350,7 +350,7 @@ BlockIndices::reinit (const std::vector<size_type> &n)
 {
   if (start_indices.size() != n.size()+1)
     {
-      n_blocks = n.size();
+      n_blocks = static_cast<unsigned int>(n.size());
       start_indices.resize(n_blocks+1);
     }
   start_indices[0] = 0;
@@ -385,7 +385,7 @@ BlockIndices::BlockIndices (
 inline
 BlockIndices::BlockIndices (const std::vector<size_type> &n)
   :
-  n_blocks(n.size()),
+  n_blocks(static_cast<unsigned int>(n.size())),
   start_indices(n.size()+1)
 {
   reinit (n);
@@ -441,7 +441,7 @@ BlockIndices::size () const
 
 
 inline
-std::size_t
+BlockIndices::size_type
 BlockIndices::total_size () const
 {
   if (n_blocks == 0) return 0;
@@ -451,7 +451,7 @@ BlockIndices::total_size () const
 
 
 inline
-std::size_t
+BlockIndices::size_type
 BlockIndices::block_size (const size_type block) const
 {
   Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
@@ -462,7 +462,7 @@ BlockIndices::block_size (const size_type block) const
 
 inline
 BlockIndices::size_type
-BlockIndices::block_start (const size_type block) const
+BlockIndices::block_start (const unsigned int block) const
 {
   Assert (block < n_blocks, ExcIndexRange(block, 0, n_blocks));
   return start_indices[block];
index 71ba524f5f202a91441ffc009d58e8fda0fe8d92..e3f79df034dc45a4ac747e18ce58c8f0609f7da9 100644 (file)
@@ -63,6 +63,9 @@ public:
   /**
    * Declare type of container size.
    */
+  // A FullMatrix will never require to use unsigned long long int instead of
+  // unsigned but because a ConstraintMatrix can be a SparseMatrix or a
+  // FullMatrix, we need have the same interface.
   typedef types::global_dof_index size_type;
 
   /**
index fc1155c95e11ded926eca632d8ba729249adfddc..900742cb1cbd6716d9f4a8350d140e5ee424abe0 100644 (file)
@@ -228,11 +228,11 @@ Householder<number>::least_squares (Vector<number2> &dst,
       // sum = v_i^T dst
       number2 sum = diagonal[j]* (*aux)(j);
       for (size_type i=j+1 ; i<m ; ++i)
-        sum += this->el(i,j)*(*aux)(i);
+        sum += static_cast<number2>(this->el(i,j))*(*aux)(i);
       // dst -= v * sum
       (*aux)(j) -= sum*diagonal[j];
       for (size_type i=j+1 ; i<m ; ++i)
-        (*aux)(i) -= sum*this->el(i,j);
+        (*aux)(i) -= sum*static_cast<number2>(this->el(i,j));
     }
   // Compute norm of residual
   number2 sum = 0.;
index c048cd0f227a11a7560781474724c912ebf9d6b4..2a7d332a38ac0eaba20da29349c605d51033009a 100644 (file)
@@ -373,7 +373,7 @@ namespace FETools
            ExcDimensionMismatch(block_data.size(),
                                 element.n_blocks()));
 
-    unsigned int k=0;
+    types::global_dof_index k=0;
     unsigned int i=0;
     for (unsigned int b=0; b<element.n_base_elements(); ++b)
       for (unsigned int m=0; m<element.element_multiplicity(b); ++m)
@@ -385,7 +385,7 @@ namespace FETools
         }
     Assert (i == element.n_blocks(), ExcInternalError());
 
-    std::vector<unsigned int> start_indices(block_data.size());
+    std::vector<types::global_dof_index> start_indices(block_data.size());
     k = 0;
     for (unsigned int i=0; i<block_data.size(); ++i)
       if (return_start_indices)
@@ -399,7 +399,7 @@ namespace FETools
 //TODO:[GK] This does not work for a single RT
     for (unsigned int i=0; i<element.dofs_per_cell; ++i)
       {
-        std::pair<types::global_dof_index, types::global_dof_index>
+        std::pair<unsigned int, types::global_dof_index>
         indices = element.system_to_block_index(i);
         renumbering[i] = start_indices[indices.first]
                          +indices.second;

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.