From 254d2ede3a6f98449f8e42650f7ff366d2071515 Mon Sep 17 00:00:00 2001 From: buerg Date: Sat, 11 Aug 2012 14:24:05 +0000 Subject: [PATCH] Change unsigned int to types::global_dof_index. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25902 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/files | 6 +- deal.II/include/deal.II/lac/block_vector.h | 12 +-- .../deal.II/lac/block_vector.templates.h | 16 ++-- .../include/deal.II/lac/block_vector_base.h | 92 +++++++++---------- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/deal.II/files b/deal.II/files index f43157b90e..0495321d1d 100644 --- a/deal.II/files +++ b/deal.II/files @@ -117,7 +117,7 @@ MARKUS source/lac/block_sparse_matrix.cc MARKUS source/lac/block_sparse_matrix_ez.cc MARKUS source/lac/block_sparsity_pattern.cc MARKUS source/lac/block_vector.cc -source/lac/chunk_sparse_matrix.cc +MARKUS source/lac/chunk_sparse_matrix.cc source/lac/chunk_sparsity_pattern.cc MARKUS source/lac/compressed_set_sparsity_pattern.cc source/lac/compressed_simple_sparsity_pattern.cc @@ -370,8 +370,8 @@ MARKUS include/deal.II/lac/block_sparsity_pattern.h MARKUS include/deal.II/lac/block_vector_base.h MARKUS include/deal.II/lac/block_vector.h MARKUS include/deal.II/lac/block_vector.templates.h -include/deal.II/lac/chunk_sparse_matrix.h -include/deal.II/lac/chunk_sparse_matrix.templates.h +MARKUS include/deal.II/lac/chunk_sparse_matrix.h +MARKUS include/deal.II/lac/chunk_sparse_matrix.templates.h include/deal.II/lac/chunk_sparsity_pattern.h MARKUS include/deal.II/lac/compressed_set_sparsity_pattern.h include/deal.II/lac/compressed_simple_sparsity_pattern.h diff --git a/deal.II/include/deal.II/lac/block_vector.h b/deal.II/include/deal.II/lac/block_vector.h index 7344af92cd..b69f0d24b1 100644 --- a/deal.II/include/deal.II/lac/block_vector.h +++ b/deal.II/include/deal.II/lac/block_vector.h @@ -101,8 +101,8 @@ class BlockVector : public BlockVectorBase > * use blocks of different * sizes. */ - explicit BlockVector (const unsigned int num_blocks = 0, - const unsigned int block_size = 0); + explicit BlockVector (const unsigned int num_blocks = 0, + const types::global_dof_index block_size = 0); /** * Copy-Constructor. Dimension set to @@ -157,7 +157,7 @@ class BlockVector : public BlockVectorBase > * block_sizes[i] zero * elements. */ - BlockVector (const std::vector &block_sizes); + BlockVector (const std::vector &block_sizes); /** * Constructor. Initialize vector @@ -255,7 +255,7 @@ class BlockVector : public BlockVectorBase > * is filled with zeros. */ void reinit (const unsigned int num_blocks, - const unsigned int block_size = 0, + const types::global_dof_index block_size = 0, const bool fast = false); /** @@ -289,8 +289,8 @@ class BlockVector : public BlockVectorBase > * since they may be routed to * the wrong block. */ - void reinit (const std::vector &N, - const bool fast=false); + void reinit (const std::vector &N, + const bool fast=false); /** * Reinitialize the BlockVector diff --git a/deal.II/include/deal.II/lac/block_vector.templates.h b/deal.II/include/deal.II/lac/block_vector.templates.h index 488ae075bd..cf9e2c5dca 100644 --- a/deal.II/include/deal.II/lac/block_vector.templates.h +++ b/deal.II/include/deal.II/lac/block_vector.templates.h @@ -23,7 +23,7 @@ DEAL_II_NAMESPACE_OPEN template BlockVector::BlockVector (const unsigned int n_blocks, - const unsigned int block_size) + const types::global_dof_index block_size) { reinit (n_blocks, block_size); } @@ -31,7 +31,7 @@ BlockVector::BlockVector (const unsigned int n_blocks, template -BlockVector::BlockVector (const std::vector &n) +BlockVector::BlockVector (const std::vector &n) { reinit (n, false); } @@ -88,18 +88,18 @@ BlockVector::BlockVector (const TrilinosWrappers::BlockVector &v) template -void BlockVector::reinit (const unsigned int n_bl, - const unsigned int bl_sz, - const bool fast) +void BlockVector::reinit (const unsigned int n_bl, + const types::global_dof_index bl_sz, + const bool fast) { - std::vector n(n_bl, bl_sz); + std::vector n(n_bl, bl_sz); reinit(n, fast); } template -void BlockVector::reinit (const std::vector &n, - const bool fast) +void BlockVector::reinit (const std::vector &n, + const bool fast) { this->block_indices.reinit (n); if (this->components.size() != this->n_blocks()) diff --git a/deal.II/include/deal.II/lac/block_vector_base.h b/deal.II/include/deal.II/lac/block_vector_base.h index f984a739a2..908af5afd2 100644 --- a/deal.II/include/deal.II/lac/block_vector_base.h +++ b/deal.II/include/deal.II/lac/block_vector_base.h @@ -352,8 +352,8 @@ namespace internal * const or non-const * reference. */ - Iterator (BlockVector &parent, - const unsigned int global_index); + Iterator (BlockVector &parent, + const types::global_dof_index global_index); /** * Copy constructor. @@ -381,11 +381,11 @@ namespace internal * variables. */ Iterator (BlockVector &parent, - const unsigned int global_index, - const unsigned int current_block, - const unsigned int index_within_block, - const unsigned int next_break_forward, - const unsigned int next_break_backward); + const types::global_dof_index global_index, + const unsigned int current_block, + const types::global_dof_index index_within_block, + const types::global_dof_index next_break_forward, + const types::global_dof_index next_break_backward); public: @@ -612,7 +612,7 @@ namespace internal * element to which we * presently point. */ - unsigned int global_index; + types::global_dof_index global_index; /** * Current block and index @@ -621,7 +621,7 @@ namespace internal * to. */ unsigned int current_block; - unsigned int index_within_block; + types::global_dof_index index_within_block; /** * Indices of the global @@ -635,8 +635,8 @@ namespace internal * efficient than always * asking the parent object. */ - unsigned int next_break_forward; - unsigned int next_break_backward; + types::global_dof_index next_break_forward; + types::global_dof_index next_break_backward; /** * Move forward one element. @@ -825,7 +825,7 @@ class BlockVectorBase : public Subscriptor * is the sum of the dimensions of all * components. */ - unsigned int size () const; + types::global_dof_index size () const; /** * Return an iterator pointing to @@ -856,20 +856,20 @@ class BlockVectorBase : public Subscriptor /** * Access components, returns U(i). */ - value_type operator() (const unsigned int i) const; + value_type operator() (const types::global_dof_index i) const; /** * Access components, returns U(i) * as a writeable reference. */ - reference operator() (const unsigned int i); + reference operator() (const types::global_dof_index i); /** * Access components, returns U(i). * * Exactly the same as operator(). */ - value_type operator[] (const unsigned int i) const; + value_type operator[] (const types::global_dof_index i) const; /** * Access components, returns U(i) @@ -877,7 +877,7 @@ class BlockVectorBase : public Subscriptor * * Exactly the same as operator(). */ - reference operator[] (const unsigned int i); + reference operator[] (const types::global_dof_index i); /** * Copy operator: fill all components of @@ -998,8 +998,8 @@ class BlockVectorBase : public Subscriptor * indices. */ template - void add (const std::vector &indices, - const std::vector &values); + void add (const std::vector &indices, + const std::vector &values); /** * This is a second collective @@ -1009,8 +1009,8 @@ class BlockVectorBase : public Subscriptor * values. */ template - void add (const std::vector &indices, - const Vector &values); + void add (const std::vector &indices, + const Vector &values); /** * Take an address where @@ -1022,9 +1022,9 @@ class BlockVectorBase : public Subscriptor * functions above. */ template - void add (const unsigned int n_elements, - const unsigned int *indices, - const Number *values); + void add (const unsigned int n_elements, + const types::global_dof_index *indices, + const Number *values); /** * $U(0-DIM)+=s$. Addition of s @@ -1225,11 +1225,11 @@ namespace internal inline Iterator:: Iterator (BlockVector &parent, - const unsigned int global_index, - const unsigned int current_block, - const unsigned int index_within_block, - const unsigned int next_break_forward, - const unsigned int next_break_backward) + const types::global_dof_index global_index, + const unsigned int current_block, + const types::global_dof_index index_within_block, + const types::global_dof_index next_break_forward, + const types::global_dof_index next_break_backward) : parent (&parent), global_index (global_index), @@ -1633,8 +1633,8 @@ namespace internal template Iterator:: - Iterator (BlockVector &parent, - const unsigned int global_index) + Iterator (BlockVector &parent, + const types::global_dof_index global_index) : parent (&parent), global_index (global_index) @@ -1647,7 +1647,7 @@ namespace internal // past-the-end if (global_index < parent.size()) { - const std::pair + const std::pair indices = parent.block_indices.global_to_local(global_index); current_block = indices.first; index_within_block = indices.second; @@ -1756,7 +1756,7 @@ BlockVectorBase::BlockVectorBase () template inline -unsigned int +types::global_dof_index BlockVectorBase::size () const { return block_indices.total_size(); @@ -1811,7 +1811,7 @@ inline void BlockVectorBase::collect_sizes () { - std::vector sizes (n_blocks()); + std::vector sizes (n_blocks()); for (unsigned int i=0; i template inline void -BlockVectorBase::add (const std::vector &indices, - const std::vector &values) +BlockVectorBase::add (const std::vector &indices, + const std::vector &values) { Assert (indices.size() == values.size(), ExcDimensionMismatch(indices.size(), values.size())); @@ -2021,8 +2021,8 @@ template template inline void -BlockVectorBase::add (const std::vector &indices, - const Vector &values) +BlockVectorBase::add (const std::vector &indices, + const Vector &values) { Assert (indices.size() == values.size(), ExcDimensionMismatch(indices.size(), values.size())); @@ -2037,9 +2037,9 @@ template template inline void -BlockVectorBase::add (const unsigned int n_indices, - const unsigned int *indices, - const Number *values) +BlockVectorBase::add (const unsigned int n_indices, + const types::global_dof_index *indices, + const Number *values) { for (unsigned int i=0; i::operator /= (const value_type factor) template inline typename BlockVectorBase::value_type -BlockVectorBase::operator() (const unsigned int i) const +BlockVectorBase::operator() (const types::global_dof_index i) const { - const std::pair local_index + const std::pair local_index = block_indices.global_to_local (i); return components[local_index.first](local_index.second); } @@ -2405,9 +2405,9 @@ BlockVectorBase::operator() (const unsigned int i) const template inline typename BlockVectorBase::reference -BlockVectorBase::operator() (const unsigned int i) +BlockVectorBase::operator() (const types::global_dof_index i) { - const std::pair local_index + const std::pair local_index = block_indices.global_to_local (i); return components[local_index.first](local_index.second); } @@ -2417,7 +2417,7 @@ BlockVectorBase::operator() (const unsigned int i) template inline typename BlockVectorBase::value_type -BlockVectorBase::operator[] (const unsigned int i) const +BlockVectorBase::operator[] (const types::global_dof_index i) const { return operator()(i); } @@ -2427,7 +2427,7 @@ BlockVectorBase::operator[] (const unsigned int i) const template inline typename BlockVectorBase::reference -BlockVectorBase::operator[] (const unsigned int i) +BlockVectorBase::operator[] (const types::global_dof_index i) { return operator()(i); } -- 2.39.5