From d8ad1b95022ba01fd12952dbd05ab37369730191 Mon Sep 17 00:00:00 2001 From: turcksin Date: Mon, 8 Apr 2013 17:30:48 +0000 Subject: [PATCH] Fix some conversion warnings. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29218 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/lac/block_matrix_array.h | 68 +++++++++---------- .../deal.II/numerics/solution_transfer.h | 2 +- deal.II/source/fe/fe_values.cc | 4 +- deal.II/source/lac/block_matrix_array.cc | 38 +++++------ deal.II/source/numerics/matrix_tools.cc | 3 +- .../source/numerics/point_value_history.cc | 10 ++- 6 files changed, 67 insertions(+), 58 deletions(-) diff --git a/deal.II/include/deal.II/lac/block_matrix_array.h b/deal.II/include/deal.II/lac/block_matrix_array.h index 74aa21c467..7cba2b2ca2 100644 --- a/deal.II/include/deal.II/lac/block_matrix_array.h +++ b/deal.II/include/deal.II/lac/block_matrix_array.h @@ -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 > &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 > &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 - 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 void enter_aux (VectorMemory > &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: * n_blocks 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 > &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 > &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::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::enter_aux ( VectorMemory > &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::print_latex (STREAM &out) const array(m->row, m->col) += stream.str(); } - for (size_type i=0; i 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); } diff --git a/deal.II/source/lac/block_matrix_array.cc b/deal.II/source/lac/block_matrix_array.cc index dcb82f4c14..c90824a219 100644 --- a/deal.II/source/lac/block_matrix_array.cc +++ b/deal.II/source/lac/block_matrix_array.cc @@ -51,8 +51,8 @@ BlockMatrixArray::BlockMatrixArray () template BlockMatrixArray::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::BlockMatrixArray ( template BlockMatrixArray::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 > &) : block_rows (n_block_rows), block_cols (n_block_cols) @@ -71,8 +71,8 @@ BlockMatrixArray::BlockMatrixArray ( template void BlockMatrixArray::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 > &) { block_rows = n_block_rows; @@ -83,8 +83,8 @@ BlockMatrixArray::initialize ( template void BlockMatrixArray::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::initialize ( template void BlockMatrixArray::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::matrix_scalar_product ( number result = 0.; - for (size_type i=0; i::matrix_norm_square ( template -typename BlockMatrixArray::size_type +unsigned int BlockMatrixArray::n_block_rows () const { return block_rows; @@ -258,7 +258,7 @@ BlockMatrixArray::n_block_rows () const template -typename BlockMatrixArray::size_type +unsigned int BlockMatrixArray::n_block_cols () const { return block_cols; @@ -277,7 +277,7 @@ BlockTrianglePrecondition::BlockTrianglePrecondition() template BlockTrianglePrecondition::BlockTrianglePrecondition( - const size_type block_rows, + const unsigned int block_rows, VectorMemory > &, const bool backward) : @@ -288,7 +288,7 @@ BlockTrianglePrecondition::BlockTrianglePrecondition( template BlockTrianglePrecondition::BlockTrianglePrecondition( - const size_type block_rows) + const unsigned int block_rows) : BlockMatrixArray (block_rows, block_rows), backward(false) @@ -298,7 +298,7 @@ BlockTrianglePrecondition::BlockTrianglePrecondition( template void BlockTrianglePrecondition::initialize( - const size_type n_block_rows, + const unsigned int n_block_rows, VectorMemory > &, const bool backward) { @@ -310,7 +310,7 @@ BlockTrianglePrecondition::initialize( template void BlockTrianglePrecondition::reinit ( - const size_type n) + const unsigned int n) { BlockMatrixArray::reinit(n,n); } @@ -432,12 +432,12 @@ BlockTrianglePrecondition::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 > block_boundary_values(n_blocks); { - int offset = 0, block=0; + int block=0; + types::global_dof_index offset = 0; for (std::map::const_iterator dof = boundary_values.begin(); dof != boundary_values.end(); diff --git a/deal.II/source/numerics/point_value_history.cc b/deal.II/source/numerics/point_value_history.cc index 03859e48e1..70a15161f3 100644 --- a/deal.II/source/numerics/point_value_history.cc +++ b/deal.II/source/numerics/point_value_history.cc @@ -270,7 +270,11 @@ void PointValueHistory std::vector local_dof_indices (dof_handler->get_fe ().dofs_per_cell); - std::vector new_solution_indices; +#ifndef deal_ii_use_large_index_type + std::vector new_solution_indices; +#else + std::vector 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 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 new_solution_indices; +#else + std::vector new_solution_indices; +#endif for (unsigned int component = 0; component < dof_handler->get_fe ().n_components (); component++) { -- 2.39.5