]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some conversion warnings.
authorBruno Turcksin <bruno.turcksin@gmail.com>
Mon, 8 Apr 2013 17:30:48 +0000 (17:30 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Mon, 8 Apr 2013 17:30:48 +0000 (17:30 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29218 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_matrix_array.h
deal.II/include/deal.II/numerics/solution_transfer.h
deal.II/source/fe/fe_values.cc
deal.II/source/lac/block_matrix_array.cc
deal.II/source/numerics/matrix_tools.cc
deal.II/source/numerics/point_value_history.cc

index 74aa21c467e07c2c5e6d6cb0f1feaf0ab034229e..7cba2b2ca22988604880f0edc2d6e6b5949ea221 100644 (file)
@@ -140,8 +140,8 @@ public:
    * Constructor fixing the
    * dimensions.
    */
-  BlockMatrixArray (const size_type n_block_rows,
-                    const size_type n_block_cols);
+  BlockMatrixArray (const unsigned int n_block_rows,
+                    const unsigned int n_block_cols);
 
   /**
    * Initialize object
@@ -150,8 +150,8 @@ public:
    * created by the default
    * constructor.
    */
-  void initialize (const size_type n_block_rows,
-                   const size_type n_block_cols);
+  void initialize (const unsigned int n_block_rows,
+                   const unsigned int n_block_cols);
 
   /**
    * Constructor fixing the
@@ -160,8 +160,8 @@ public:
    * @deprecated The last argument is ignored. Use the constructor with only
    * the first two arguments.
    */
-  BlockMatrixArray (const size_type n_block_rows,
-                    const size_type n_block_cols,
+  BlockMatrixArray (const unsigned int n_block_rows,
+                    const unsigned int n_block_cols,
                     VectorMemory<Vector<number> > &mem) DEAL_II_DEPRECATED;
 
   /**
@@ -174,16 +174,16 @@ public:
    * @deprecated The last argument is ignored. Use the function with same name
    * but only the first two arguments.
    */
-  void initialize (const size_type n_block_rows,
-                   const size_type n_block_cols,
+  void initialize (const unsigned int n_block_rows,
+                   const unsigned int n_block_cols,
                    VectorMemory<Vector<number> > &mem) DEAL_II_DEPRECATED;
 
   /**
    * Adjust the matrix to a new
    * size and delete all blocks.
    */
-  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);
 
   /**
    * Add a block matrix entry. The
@@ -205,11 +205,11 @@ public:
    * the multiplication functions.
    */
   template <class MATRIX>
-  void enter (const MATRIX   &matrix,
-              const size_type row,
-              const size_type col,
-              const double    prefix = 1.,
-              const bool      transpose = false);
+  void enter (const MATRIX       &matrix,
+              const unsigned int  row,
+              const unsigned int  col,
+              const double        prefix = 1.,
+              const bool          transpose = false);
 
   /**
    * Add an entry like with enter,
@@ -223,11 +223,11 @@ public:
    */
   template <class MATRIX>
   void enter_aux (VectorMemory<Vector<number> > &mem,
-                  const MATRIX   &matrix,
-                  const size_type row,
-                  const size_type col,
-                  const double    prefix = 1.,
-                  const bool      transpose = false) DEAL_II_DEPRECATED;
+                  const MATRIX       &matrix,
+                  const unsigned int  row,
+                  const unsigned int  col,
+                  const double        prefix = 1.,
+                  const bool          transpose = false) DEAL_II_DEPRECATED;
 
 
   /**
@@ -240,13 +240,13 @@ public:
    * Number of block-entries per
    * column.
    */
-  size_type n_block_rows () const;
+  unsigned int n_block_rows () const;
 
   /**
    * Number of block-entries per
    * row.
    */
-  size_type n_block_cols () const;
+  unsigned int n_block_cols () const;
 
   /**
    * Matrix-vector multiplication.
@@ -404,11 +404,11 @@ private:
   /**
    * Number of blocks per column.
    */
-  size_type block_rows;
+  unsigned int block_rows;
   /**
    * number of blocks per row.
    */
-  size_type block_cols;
+  unsigned int block_cols;
 };
 
 /*@}*/
@@ -495,7 +495,7 @@ public:
    * <tt>n_blocks</tt> is the
    * number of blocks in each direction.
    */
-  BlockTrianglePrecondition (const size_type n_blocks);
+  BlockTrianglePrecondition (const unsigned int n_blocks);
 
   /**
    * Constructor. This matrix must be
@@ -506,7 +506,7 @@ public:
    * @deprecated The second argument is ignored. Use the constructor with only
    * the first and third argument.
    */
-  BlockTrianglePrecondition (const size_type n_block_rows,
+  BlockTrianglePrecondition (const unsigned int n_block_rows,
                              VectorMemory<Vector<number> > &mem,
                              const bool backward = false) DEAL_II_DEPRECATED;
 
@@ -520,7 +520,7 @@ public:
    * @deprecated The second argument
    * is ignored. Use the function without that argument.
    */
-  void initialize (const size_type n_block_rows,
+  void initialize (const unsigned int n_block_rows,
                    VectorMemory<Vector<number> > &mem,
                    const bool backward = false) DEAL_II_DEPRECATED;
 
@@ -528,7 +528,7 @@ public:
    * Resize preconditioner to a new
    * size and clear all blocks.
    */
-  void reinit (const size_type n_block_rows);
+  void reinit (const unsigned int n_block_rows);
 
 
   /**
@@ -679,8 +679,8 @@ inline
 void
 BlockMatrixArray<number>::enter (
   const MATRIX &matrix,
-  size_type row,
-  size_type col,
+  unsigned int row,
+  unsigned int col,
   double prefix,
   bool transpose)
 {
@@ -697,8 +697,8 @@ void
 BlockMatrixArray<number>::enter_aux (
   VectorMemory<Vector<number> > &mem,
   const MATRIX &matrix,
-  size_type row,
-  size_type col,
+  unsigned int row,
+  unsigned int col,
   double prefix,
   bool transpose)
 {
@@ -766,8 +766,8 @@ BlockMatrixArray<number>::print_latex (STREAM &out) const
 
       array(m->row, m->col) += stream.str();
     }
-  for (size_type i=0; i<n_block_rows(); ++i)
-    for (size_type j=0; j<n_block_cols(); ++j)
+  for (unsigned int i=0; i<n_block_rows(); ++i)
+    for (unsigned int j=0; j<n_block_cols(); ++j)
       {
         out << '\t' << array(i,j);
         if (j==n_block_cols()-1)
index e42b9261f8f3a07f111c38d5690bcdedb617b0ae..d1983fda7654a508ab5cb590641006560d04e53d 100644 (file)
@@ -377,7 +377,7 @@ private:
    * Stores the number of DoFs before the
    * refinement and/or coarsening.
    */
-  unsigned int n_dofs_old;
+  types::global_dof_index n_dofs_old;
 
   /**
    * Declaration of
index 597fd9aa5ea173cfd1b5a344e379628693730133..b482eba8436f73f5021baa07c52c331a325bf31a 100644 (file)
@@ -40,7 +40,7 @@ namespace
   template <class VectorType>
   double
   get_vector_element (const VectorType &vector,
-                      const unsigned int cell_number)
+                      const types::global_dof_index cell_number)
   {
     return vector[cell_number];
   }
@@ -48,7 +48,7 @@ namespace
 
   double
   get_vector_element (const IndexSet &is,
-                      const unsigned int cell_number)
+                      const types::global_dof_index cell_number)
   {
     return (is.is_element(cell_number) ? 1 : 0);
   }
index dcb82f4c1479c70e223b41723c9c6c6c9aab8fb4..c90824a2199e3eb5cec359e8d2177827868b66de 100644 (file)
@@ -51,8 +51,8 @@ BlockMatrixArray<number>::BlockMatrixArray ()
 
 template <typename number>
 BlockMatrixArray<number>::BlockMatrixArray (
-  const size_type n_block_rows,
-  const size_type n_block_cols)
+  const unsigned int n_block_rows,
+  const unsigned int n_block_cols)
   : block_rows (n_block_rows),
     block_cols (n_block_cols)
 {}
@@ -60,8 +60,8 @@ BlockMatrixArray<number>::BlockMatrixArray (
 
 template <typename number>
 BlockMatrixArray<number>::BlockMatrixArray (
-  const size_type n_block_rows,
-  const size_type n_block_cols,
+  const unsigned int n_block_rows,
+  const unsigned int n_block_cols,
   VectorMemory<Vector<number> > &)
   : block_rows (n_block_rows),
     block_cols (n_block_cols)
@@ -71,8 +71,8 @@ BlockMatrixArray<number>::BlockMatrixArray (
 template <typename number>
 void
 BlockMatrixArray<number>::initialize (
-  const size_type n_block_rows,
-  const size_type n_block_cols,
+  const unsigned int n_block_rows,
+  const unsigned int n_block_cols,
   VectorMemory<Vector<number> > &)
 {
   block_rows = n_block_rows;
@@ -83,8 +83,8 @@ BlockMatrixArray<number>::initialize (
 template <typename number>
 void
 BlockMatrixArray<number>::initialize (
-  const size_type n_block_rows,
-  const size_type n_block_cols)
+  const unsigned int n_block_rows,
+  const unsigned int n_block_cols)
 {
   block_rows = n_block_rows;
   block_cols = n_block_cols;
@@ -95,8 +95,8 @@ BlockMatrixArray<number>::initialize (
 template <typename number>
 void
 BlockMatrixArray<number>::reinit (
-  const size_type n_block_rows,
-  const size_type n_block_cols)
+  const unsigned int n_block_rows,
+  const unsigned int n_block_cols)
 {
   clear();
   block_rows = n_block_rows;
@@ -218,7 +218,7 @@ BlockMatrixArray<number>::matrix_scalar_product (
 
   number result = 0.;
 
-  for (size_type i=0; i<block_rows; ++i)
+  for (unsigned int i=0; i<block_rows; ++i)
     {
       aux.reinit(u.block(i));
       for (m = entries.begin(); m != end ; ++m)
@@ -249,7 +249,7 @@ BlockMatrixArray<number>::matrix_norm_square (
 
 
 template <typename number>
-typename BlockMatrixArray<number>::size_type
+unsigned int
 BlockMatrixArray<number>::n_block_rows () const
 {
   return block_rows;
@@ -258,7 +258,7 @@ BlockMatrixArray<number>::n_block_rows () const
 
 
 template <typename number>
-typename BlockMatrixArray<number>::size_type
+unsigned int
 BlockMatrixArray<number>::n_block_cols () const
 {
   return block_cols;
@@ -277,7 +277,7 @@ BlockTrianglePrecondition<number>::BlockTrianglePrecondition()
 
 template <typename number>
 BlockTrianglePrecondition<number>::BlockTrianglePrecondition(
-  const size_type block_rows,
+  const unsigned int block_rows,
   VectorMemory<Vector<number> > &,
   const bool backward)
   :
@@ -288,7 +288,7 @@ BlockTrianglePrecondition<number>::BlockTrianglePrecondition(
 
 template <typename number>
 BlockTrianglePrecondition<number>::BlockTrianglePrecondition(
-  const size_type block_rows)
+  const unsigned int block_rows)
   :
   BlockMatrixArray<number> (block_rows, block_rows),
   backward(false)
@@ -298,7 +298,7 @@ BlockTrianglePrecondition<number>::BlockTrianglePrecondition(
 template <typename number>
 void
 BlockTrianglePrecondition<number>::initialize(
-  const size_type n_block_rows,
+  const unsigned int n_block_rows,
   VectorMemory<Vector<number> > &,
   const bool backward)
 {
@@ -310,7 +310,7 @@ BlockTrianglePrecondition<number>::initialize(
 template <typename number>
 void
 BlockTrianglePrecondition<number>::reinit (
-  const size_type n)
+  const unsigned int n)
 {
   BlockMatrixArray<number>::reinit(n,n);
 }
@@ -432,12 +432,12 @@ BlockTrianglePrecondition<number>::vmult (
 
   if (backward)
     {
-      for (size_type i=n_block_rows(); i>0;)
+      for (unsigned int i=n_block_rows(); i>0;)
         do_row(dst, --i);
     }
   else
     {
-      for (size_type i=0; i<n_block_rows(); ++i)
+      for (unsigned int i=0; i<n_block_rows(); ++i)
         do_row(dst, i);
     }
 
index 586651a016e5b8ad3a0250a09415bd28d03d511d..9b33964c32ca6bfadb234fae227e5075623e2647 100644 (file)
@@ -2688,7 +2688,8 @@ namespace MatrixTools
         // maps with the respective indices.
         std::vector<std::map<types::global_dof_index,double> > block_boundary_values(n_blocks);
         {
-          int offset = 0, block=0;
+          int block=0;
+          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 03859e48e1a03a266a2fa33b727cd218087e0d5c..70a15161f36212adc0596272153b989dcfa71ed9 100644 (file)
@@ -270,7 +270,11 @@ void PointValueHistory<dim>
 
   std::vector<types::global_dof_index>
   local_dof_indices (dof_handler->get_fe ().dofs_per_cell);
-  std::vector <int> new_solution_indices;
+#ifndef deal_ii_use_large_index_type
+      std::vector <int> new_solution_indices;
+#else
+      std::vector <long long int> new_solution_indices;
+#endif
   current_cell->get_dof_indices (local_dof_indices);
   // there is an implicit assumption here
   // that all the closest support point to
@@ -415,7 +419,11 @@ 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.