From 64cf12744cafe2018ba1f30b5d039cff25ef0e52 Mon Sep 17 00:00:00 2001 From: sharma Date: Fri, 10 Aug 2012 10:20:12 +0000 Subject: [PATCH] Convert some unsigned ints to types::global_dof_index. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25872 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/index_set.h | 50 ++++++++++++------------ deal.II/include/deal.II/hp/dof_objects.h | 24 ++++++------ deal.II/source/base/index_set.cc | 6 +-- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/deal.II/include/deal.II/base/index_set.h b/deal.II/include/deal.II/base/index_set.h index aa21ea567d..46710d65b3 100644 --- a/deal.II/include/deal.II/base/index_set.h +++ b/deal.II/include/deal.II/base/index_set.h @@ -64,7 +64,7 @@ class IndexSet * overall size of the index * range. */ - IndexSet (const unsigned int size); + IndexSet (const types::global_dof_index size); /** * Remove all indices from this @@ -136,7 +136,7 @@ class IndexSet * index is an element of the * index set. */ - bool is_element (const unsigned int index) const; + bool is_element (const types::global_dof_index index) const; /** * Return whether the index set @@ -151,7 +151,7 @@ class IndexSet * Return the number of elements * stored in this index set. */ - unsigned int n_elements () const; + types::global_dof_index n_elements () const; /** * Return the global index of the local @@ -160,7 +160,7 @@ class IndexSet * local_index obviously needs to be less * than n_elements(). */ - unsigned int nth_index_in_set (const unsigned int local_index) const; + types::global_dof_index nth_index_in_set (const unsigned int local_index) const; /** * Return the how-manyth element of this @@ -172,7 +172,7 @@ class IndexSet * a member of this index set, i.e. if * is_element(global_index) is false. */ - unsigned int index_within_set (const unsigned int global_index) const; + unsigned int index_within_set (const types::global_dof_index global_index) const; /** * Each index set can be @@ -245,8 +245,8 @@ class IndexSet * to the range [0, * end-begin). */ - IndexSet get_view (const unsigned int begin, - const unsigned int end) const; + IndexSet get_view (const types::global_dof_index begin, + const types::global_dof_index end) const; /** @@ -263,7 +263,7 @@ class IndexSet * Fills the given vector with all * indices contained in this IndexSet. */ - void fill_index_vector(std::vector & indices) const; + void fill_index_vector(std::vector & indices) const; /** * Fill the given vector with either @@ -427,10 +427,10 @@ class IndexSet */ struct Range { - unsigned int begin; - unsigned int end; + types::global_dof_index begin; + types::global_dof_index end; - unsigned int nth_index_in_set; + types::global_dof_index nth_index_in_set; /** * Default constructor. Since there is no useful choice for @@ -449,8 +449,8 @@ class IndexSet * @param i1 Left end point of the interval. * @param i2 First index greater than the last index of the indicated range. **/ - Range (const unsigned int i1, - const unsigned int i2); + Range (const types::global_dof_index i1, + const types::global_dof_index i2); friend inline bool operator< (const Range &range_1, @@ -572,8 +572,8 @@ IndexSet::Range::Range () inline -IndexSet::Range::Range (const unsigned int i1, - const unsigned int i2) +IndexSet::Range::Range (const types::global_dof_index i1, + const types::global_dof_index i2) : begin(i1), end(i2) @@ -591,7 +591,7 @@ IndexSet::IndexSet () inline -IndexSet::IndexSet (const unsigned int size) +IndexSet::IndexSet (const types::global_dof_index size) : is_compressed (true), index_space_size (size), @@ -646,8 +646,8 @@ IndexSet::compress () const inline void -IndexSet::add_range (const unsigned int begin, - const unsigned int end) +IndexSet::add_range (const types::global_dof_index begin, + const types::global_dof_index end) { Assert ((begin < index_space_size) || @@ -680,7 +680,7 @@ IndexSet::add_range (const unsigned int begin, inline void -IndexSet::add_index (const unsigned int index) +IndexSet::add_index (const types::global_dof_index index) { Assert (index < index_space_size, ExcIndexRange (index, 0, index_space_size)); @@ -712,8 +712,8 @@ IndexSet::add_indices (const ForwardIterator &begin, // range for (ForwardIterator p=begin; p!=end;) { - const unsigned int begin_index = *p; - unsigned int end_index = begin_index + 1; + const types::global_dof_index begin_index = *p; + types::global_dof_index end_index = begin_index + 1; ForwardIterator q = p; ++q; while ((q != end) && (*q == end_index)) @@ -750,7 +750,7 @@ IndexSet::add_indices(const IndexSet & other) inline bool -IndexSet::is_element (const unsigned int index) const +IndexSet::is_element (const types::global_dof_index index) const { if (ranges.empty() == false) { @@ -828,7 +828,7 @@ IndexSet::is_contiguous () const inline -unsigned int +types::global_dof_index IndexSet::n_elements () const { // make sure we have @@ -858,7 +858,7 @@ IndexSet::n_elements () const inline unsigned int -IndexSet::nth_index_in_set (const unsigned int n) const +IndexSet::nth_index_in_set (const types::global_dof_index n) const { // to make this call thread-safe, compress() // must not be called through this function @@ -908,7 +908,7 @@ IndexSet::nth_index_in_set (const unsigned int n) const inline -unsigned int +types::global_dof_index IndexSet::index_within_set (const unsigned int n) const { // to make this call thread-safe, compress() diff --git a/deal.II/include/deal.II/hp/dof_objects.h b/deal.II/include/deal.II/hp/dof_objects.h index e7c7dd4627..35c5e829fa 100644 --- a/deal.II/include/deal.II/hp/dof_objects.h +++ b/deal.II/include/deal.II/hp/dof_objects.h @@ -101,7 +101,7 @@ namespace internal * the degrees of freedom of each * hex in the @p hex_dofs array. */ - std::vector dof_offsets; + std::vector dof_offsets; /** * Store the global indices of @@ -109,7 +109,7 @@ namespace internal * DoFLevel() for detailed * information. */ - std::vector dofs; + std::vector dofs; /** * Set the global index of @@ -142,7 +142,7 @@ namespace internal const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, - const unsigned int global_index, + const types::global_dof_index global_index, const unsigned int obj_level); /** @@ -169,7 +169,7 @@ namespace internal * information. */ template - unsigned int + types::global_dof_index get_dof_index (const dealii::hp::DoFHandler &dof_handler, const unsigned int obj_index, const unsigned int fe_index, @@ -243,7 +243,7 @@ namespace internal template template inline - unsigned int + types::global_dof_index DoFObjects:: get_dof_index (const dealii::hp::DoFHandler &dof_handler, const unsigned int obj_index, @@ -304,7 +304,7 @@ namespace internal // an exception if we can't // find a set for this // particular fe_index - const unsigned int starting_offset = dof_offsets[obj_index]; + const type::global_dof_index starting_offset = dof_offsets[obj_index]; const unsigned int *pointer = &dofs[starting_offset]; while (true) { @@ -330,7 +330,7 @@ namespace internal const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, - const unsigned int global_index, + const types::global_dof_index global_index, const unsigned int obj_level) { Assert ((fe_index != dealii::hp::DoFHandler::default_fe_index), @@ -386,7 +386,7 @@ namespace internal // an exception if we can't // find a set for this // particular fe_index - const unsigned int starting_offset = dof_offsets[obj_index]; + const types::global_dof_index starting_offset = dof_offsets[obj_index]; unsigned int *pointer = &dofs[starting_offset]; while (true) { @@ -450,7 +450,7 @@ namespace internal // find a set for this // particular fe_index const unsigned int starting_offset = dof_offsets[obj_index]; - const unsigned int *pointer = &dofs[starting_offset]; + const types::global_dof_index *pointer = &dofs[starting_offset]; unsigned int counter = 0; while (true) { @@ -472,7 +472,7 @@ namespace internal template template inline - unsigned int + types::global_dof_index DoFObjects:: nth_active_fe_index (const dealii::hp::DoFHandler &dof_handler, const unsigned int obj_level, @@ -525,7 +525,7 @@ namespace internal // find a set for this // particular fe_index const unsigned int starting_offset = dof_offsets[obj_index]; - const unsigned int *pointer = &dofs[starting_offset]; + const types::global_dof_index *pointer = &dofs[starting_offset]; unsigned int counter = 0; while (true) { @@ -607,7 +607,7 @@ namespace internal // find a set for this // particular fe_index const unsigned int starting_offset = dof_offsets[obj_index]; - const unsigned int *pointer = &dofs[starting_offset]; + const types::global_dof_index *pointer = &dofs[starting_offset]; while (true) { if (*pointer == numbers::invalid_unsigned_int) diff --git a/deal.II/source/base/index_set.cc b/deal.II/source/base/index_set.cc index 8fc02d8530..bb38a154d5 100644 --- a/deal.II/source/base/index_set.cc +++ b/deal.II/source/base/index_set.cc @@ -174,8 +174,8 @@ IndexSet::n_intervals () const IndexSet -IndexSet::get_view (const unsigned int begin, - const unsigned int end) const +IndexSet::get_view (const types::global_dof_index begin, + const types::global_dof_index end) const { Assert (begin <= end, ExcMessage ("End index needs to be larger or equal to begin index!")); @@ -394,7 +394,7 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator, #endif else { - std::vector indices; + std::vector indices; fill_index_vector(indices); return Epetra_Map (-1, -- 2.39.5