From 52a5d4382fcf18f01b5e09306827cda5d618b96e Mon Sep 17 00:00:00 2001 From: turcksin Date: Wed, 3 Apr 2013 17:17:52 +0000 Subject: [PATCH] Fix some conversion warning. 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 | 10 +++++----- deal.II/include/deal.II/lac/block_indices.h | 16 ++++++++-------- deal.II/include/deal.II/lac/full_matrix.h | 3 +++ deal.II/include/deal.II/lac/householder.h | 4 ++-- deal.II/source/fe/fe_tools.cc | 6 +++--- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/deal.II/include/deal.II/fe/fe.h b/deal.II/include/deal.II/fe/fe.h index 3059dbcc02..851795456b 100644 --- a/deal.II/include/deal.II/fe/fe.h +++ b/deal.II/include/deal.II/fe/fe.h @@ -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 + std::pair system_to_block_index (const unsigned int component) const; /** @@ -2892,7 +2892,7 @@ FiniteElement::face_system_to_base_index (const unsigned int index template inline -unsigned int +types::global_dof_index FiniteElement::first_block_of_base (const unsigned int index) const { return base_to_block_indices.block_start(index); @@ -2925,7 +2925,7 @@ FiniteElement::block_to_base_index (const unsigned int index) cons template inline -std::pair +std::pair FiniteElement::system_to_block_index (const unsigned int index) const { Assert (index < this->dofs_per_cell, @@ -2933,7 +2933,7 @@ FiniteElement::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( + return std::pair( first_block_of_base(system_to_base_table[index].first.first) + system_to_base_table[index].first.second, system_to_base_table[index].second); diff --git a/deal.II/include/deal.II/lac/block_indices.h b/deal.II/include/deal.II/lac/block_indices.h index 5fca62c6a2..7ab39f3198 100644 --- a/deal.II/include/deal.II/lac/block_indices.h +++ b/deal.II/include/deal.II/lac/block_indices.h @@ -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 &n) { if (start_indices.size() != n.size()+1) { - n_blocks = n.size(); + n_blocks = static_cast(n.size()); start_indices.resize(n_blocks+1); } start_indices[0] = 0; @@ -385,7 +385,7 @@ BlockIndices::BlockIndices ( inline BlockIndices::BlockIndices (const std::vector &n) : - n_blocks(n.size()), + n_blocks(static_cast(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]; diff --git a/deal.II/include/deal.II/lac/full_matrix.h b/deal.II/include/deal.II/lac/full_matrix.h index 71ba524f5f..e3f79df034 100644 --- a/deal.II/include/deal.II/lac/full_matrix.h +++ b/deal.II/include/deal.II/lac/full_matrix.h @@ -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; /** diff --git a/deal.II/include/deal.II/lac/householder.h b/deal.II/include/deal.II/lac/householder.h index fc1155c95e..900742cb1c 100644 --- a/deal.II/include/deal.II/lac/householder.h +++ b/deal.II/include/deal.II/lac/householder.h @@ -228,11 +228,11 @@ Householder::least_squares (Vector &dst, // sum = v_i^T dst number2 sum = diagonal[j]* (*aux)(j); for (size_type i=j+1 ; iel(i,j)*(*aux)(i); + sum += static_cast(this->el(i,j))*(*aux)(i); // dst -= v * sum (*aux)(j) -= sum*diagonal[j]; for (size_type i=j+1 ; iel(i,j); + (*aux)(i) -= sum*static_cast(this->el(i,j)); } // Compute norm of residual number2 sum = 0.; diff --git a/deal.II/source/fe/fe_tools.cc b/deal.II/source/fe/fe_tools.cc index c048cd0f22..2a7d332a38 100644 --- a/deal.II/source/fe/fe_tools.cc +++ b/deal.II/source/fe/fe_tools.cc @@ -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 start_indices(block_data.size()); + std::vector start_indices(block_data.size()); k = 0; for (unsigned int i=0; i + std::pair indices = element.system_to_block_index(i); renumbering[i] = start_indices[indices.first] +indices.second; -- 2.39.5