From 60eb9517fc7d3506acc4ee75e10ea14f80f5270c Mon Sep 17 00:00:00 2001 From: turcksin Date: Fri, 15 Mar 2013 22:36:54 +0000 Subject: [PATCH] Convert unvalid_unsigned_int to unvalid_dof_index. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@28917 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/index_set.h | 16 ++++---- deal.II/include/deal.II/base/partitioner.h | 6 +-- deal.II/include/deal.II/base/types.h | 2 +- .../deal.II/dofs/dof_accessor.templates.h | 32 ++++++++-------- deal.II/include/deal.II/dofs/dof_handler.h | 2 +- deal.II/include/deal.II/hp/dof_handler.h | 4 +- deal.II/include/deal.II/hp/dof_objects.h | 20 +++++----- .../include/deal.II/lac/block_vector_base.h | 6 +-- .../include/deal.II/lac/constraint_matrix.h | 18 ++++----- deal.II/include/deal.II/lac/matrix_block.h | 4 +- .../deal.II/lac/parallel_vector.templates.h | 4 +- .../deal.II/lac/relaxation_block.templates.h | 2 +- .../deal.II/lac/sparse_ilu.templates.h | 6 +-- .../include/deal.II/matrix_free/dof_info.h | 2 +- .../deal.II/numerics/vector_tools.templates.h | 2 +- deal.II/source/base/partitioner.cc | 8 ++-- deal.II/source/dofs/dof_renumbering.cc | 24 ++++++------ deal.II/source/dofs/dof_tools.cc | 4 +- deal.II/source/hp/dof_handler.cc | 38 +++++++++---------- deal.II/source/lac/sparsity_pattern.cc | 2 +- deal.II/source/lac/sparsity_tools.cc | 26 ++++++------- deal.II/source/multigrid/mg_transfer_block.cc | 12 +++--- .../source/multigrid/mg_transfer_component.cc | 6 +-- .../source/multigrid/mg_transfer_prebuilt.cc | 6 +-- deal.II/source/numerics/matrix_tools.cc | 4 +- 25 files changed, 127 insertions(+), 129 deletions(-) diff --git a/deal.II/include/deal.II/base/index_set.h b/deal.II/include/deal.II/base/index_set.h index 379408dc1d..e2a96ceb39 100644 --- a/deal.II/include/deal.II/base/index_set.h +++ b/deal.II/include/deal.II/base/index_set.h @@ -84,7 +84,7 @@ public: * This can be achieved by calling * clear(), for example. */ - void set_size (const unsigned int size); + void set_size (const types::global_dof_index size); /** * Return the size of the index @@ -96,7 +96,7 @@ public: * set. The latter information is * returned by n_elements(). */ - unsigned int size () const; + types::global_dof_index size () const; /** * Add the half-open range @@ -534,7 +534,7 @@ private: * set have to have a smaller * number than this value. */ - unsigned int index_space_size; + types::global_dof_index index_space_size; /** * This integer caches the index of the @@ -566,8 +566,8 @@ private: inline IndexSet::Range::Range () : - begin(numbers::invalid_unsigned_int), - end(numbers::invalid_unsigned_int) + begin(numbers::invalid_dof_index), + end(numbers::invalid_dof_index) {} @@ -612,7 +612,7 @@ IndexSet::clear () inline void -IndexSet::set_size (const unsigned int sz) +IndexSet::set_size (const types::global_dof_index sz) { Assert (ranges.empty(), ExcMessage ("This function can only be called if the current " @@ -624,7 +624,7 @@ IndexSet::set_size (const unsigned int sz) inline -unsigned int +types::global_dof_index IndexSet::size () const { return index_space_size; @@ -901,7 +901,7 @@ IndexSet::nth_index_in_set (const unsigned int n) const else { Assert (false, ExcInternalError()); - return numbers::invalid_unsigned_int; + return numbers::invalid_dof_index; } } diff --git a/deal.II/include/deal.II/base/partitioner.h b/deal.II/include/deal.II/base/partitioner.h index 614ee08154..736a238499 100644 --- a/deal.II/include/deal.II/base/partitioner.h +++ b/deal.II/include/deal.II/base/partitioner.h @@ -215,7 +215,7 @@ namespace Utilities * but tailored to be iterated over, and some * indices may be duplicates. */ - const std::vector > & + const std::vector > & import_indices() const; /** @@ -335,7 +335,7 @@ namespace Utilities * but tailored to be iterated over, and some * indices may be duplicates. */ - std::vector > import_indices_data; + std::vector > import_indices_data; /** * Caches the number of ghost indices. It @@ -495,7 +495,7 @@ namespace Utilities inline - const std::vector > & + const std::vector > & Partitioner::import_indices() const { return import_indices_data; diff --git a/deal.II/include/deal.II/base/types.h b/deal.II/include/deal.II/base/types.h index 544178d172..2e4c516020 100644 --- a/deal.II/include/deal.II/base/types.h +++ b/deal.II/include/deal.II/base/types.h @@ -52,7 +52,7 @@ namespace types */ const unsigned int artificial_subdomain_id DEAL_II_DEPRECATED = static_cast(-2); -//#define DEAL_II_USE_LARGE_INDEX_TYPE +#define DEAL_II_USE_LARGE_INDEX_TYPE #ifdef DEAL_II_USE_LARGE_INDEX_TYPE /** * The type used for global indices of diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index 7f15e6c287..dfe57da782 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -1144,7 +1144,7 @@ namespace internal Assert (fe_index < dof_handler.finite_elements->size(), ExcInternalError()); Assert (dof_handler.vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, + numbers::invalid_dof_index, ExcMessage ("This vertex is unused and has no DoFs associated with it")); // hop along the list of index @@ -1154,7 +1154,7 @@ namespace internal // part. trigger an exception if // we can't find a set for this // particular fe_index - const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset]; while (true) { @@ -1236,7 +1236,7 @@ namespace internal ExcIndexRange (vertex_index, 0, dof_handler.vertex_dofs_offsets.size())); Assert (dof_handler.vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, + numbers::invalid_dof_index, ExcMessage ("This vertex is unused and has no DoFs associated with it")); // hop along the list of index @@ -1285,16 +1285,16 @@ namespace internal "this DoFHandler")); // if this vertex is unused, return 0 - if (dof_handler.vertex_dofs_offsets[vertex_index] == numbers::invalid_unsigned_int) + if (dof_handler.vertex_dofs_offsets[vertex_index] == numbers::invalid_dof_index) return 0; // hop along the list of index // sets and count the number of // hops - const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset]; - Assert (*pointer != numbers::invalid_size_type, + Assert (*pointer != numbers::invalid_dof_index, ExcInternalError()); unsigned int counter = 0; @@ -1338,16 +1338,16 @@ namespace internal // make sure we don't ask on // unused vertices Assert (dof_handler.vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, + numbers::invalid_dof_index, ExcInternalError()); // hop along the list of index // sets and count the number of // hops - const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset]; - Assert (*pointer != numbers::invalid_unsigned_int, + Assert (*pointer != numbers::invalid_dof_index, ExcInternalError()); unsigned int counter = 0; @@ -1399,23 +1399,23 @@ namespace internal // make sure we don't ask on // unused vertices Assert (dof_handler.vertex_dofs_offsets[vertex_index] != - numbers::invalid_unsigned_int, + numbers::invalid_dof_index, ExcInternalError()); // hop along the list of index // sets and see whether we find // the given index - const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; + const types::global_dof_index starting_offset = dof_handler.vertex_dofs_offsets[vertex_index]; const types::global_dof_index *pointer = &dof_handler.vertex_dofs[starting_offset]; - Assert (*pointer != numbers::invalid_unsigned_int, + Assert (*pointer != numbers::invalid_dof_index, ExcInternalError()); while (true) { Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError()); - Assert((*pointer)::max(), ExcInternalError()); + Assert((*pointer)::max(), ExcInternalError()); const unsigned int this_fe_index = static_cast(*pointer); Assert (this_fe_index < dof_handler.finite_elements->size(), @@ -1815,7 +1815,7 @@ namespace internal const unsigned int fe_index) { const DH &handler = accessor.get_dof_handler(); - Assert(handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); const FiniteElement &fe @@ -1841,7 +1841,7 @@ namespace internal const unsigned int fe_index) { const DH &handler = accessor.get_dof_handler(); - Assert(handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); const FiniteElement &fe = handler.get_fe ()[fe_index]; @@ -1870,7 +1870,7 @@ namespace internal const unsigned int fe_index) { const DH &handler = accessor.get_dof_handler(); - Assert(handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); const FiniteElement &fe = handler.get_fe ()[fe_index]; diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 0c3e86b613..16bd808a8a 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -613,7 +613,7 @@ public: * If no level degrees of * freedom have been assigned * to this level, returns - * numbers::invalid_unsigned_int. Else + * numbers::invalid_dof_index. Else * returns the number of * degrees of freedom on this level. */ diff --git a/deal.II/include/deal.II/hp/dof_handler.h b/deal.II/include/deal.II/hp/dof_handler.h index 1581eeddd4..e9ae42763a 100644 --- a/deal.II/include/deal.II/hp/dof_handler.h +++ b/deal.II/include/deal.II/hp/dof_handler.h @@ -849,7 +849,7 @@ namespace hp * actual data format used to * the present class. */ - std::vector vertex_dofs_offsets; + std::vector vertex_dofs_offsets; std::vector mg_vertex_dofs; @@ -915,7 +915,7 @@ namespace hp types::global_dof_index DoFHandler::n_dofs (const unsigned int) const { - return numbers::invalid_unsigned_int; + return numbers::invalid_dof_index; } diff --git a/deal.II/include/deal.II/hp/dof_objects.h b/deal.II/include/deal.II/hp/dof_objects.h index 145f394faa..3c938ef24e 100644 --- a/deal.II/include/deal.II/hp/dof_objects.h +++ b/deal.II/include/deal.II/hp/dof_objects.h @@ -272,7 +272,7 @@ namespace internal // make sure we are on an // object for which DoFs have // been allocated at all - Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int, + Assert (dof_offsets[obj_index] != numbers::invalid_dof_index, ExcMessage ("You are trying to access degree of freedom " "information for an object on which no such " "information is available")); @@ -308,7 +308,7 @@ namespace internal const types::global_dof_index *pointer = &dofs[starting_offset]; while (true) { - Assert (*pointer != numbers::invalid_unsigned_int, + Assert (*pointer != numbers::invalid_dof_index, ExcInternalError()); if (*pointer == fe_index) return *(pointer + 1 + local_index); @@ -354,7 +354,7 @@ namespace internal // make sure we are on an // object for which DoFs have // been allocated at all - Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int, + Assert (dof_offsets[obj_index] != numbers::invalid_dof_index, ExcMessage ("You are trying to access degree of freedom " "information for an object on which no such " "information is available")); @@ -390,7 +390,7 @@ namespace internal types::global_dof_index *pointer = &dofs[starting_offset]; while (true) { - Assert (*pointer != numbers::invalid_unsigned_int, + Assert (*pointer != numbers::invalid_dof_index, ExcInternalError()); if (*pointer == fe_index) { @@ -426,7 +426,7 @@ namespace internal // make sure we are on an // object for which DoFs have // been allocated at all - if (dof_offsets[obj_index] == numbers::invalid_unsigned_int) + if (dof_offsets[obj_index] == numbers::invalid_dof_index) return 0; // if we are on a cell, then the @@ -454,7 +454,7 @@ namespace internal unsigned int counter = 0; while (true) { - if (*pointer == numbers::invalid_unsigned_int) + if (*pointer == numbers::invalid_dof_index) // end of list reached return counter; else @@ -491,7 +491,7 @@ namespace internal // make sure we are on an // object for which DoFs have // been allocated at all - Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int, + Assert (dof_offsets[obj_index] != numbers::invalid_dof_index, ExcMessage ("You are trying to access degree of freedom " "information for an object on which no such " "information is available")); @@ -529,7 +529,7 @@ namespace internal unsigned int counter = 0; while (true) { - Assert (*pointer != numbers::invalid_unsigned_int, + Assert (*pointer != numbers::invalid_dof_index, ExcInternalError()); const unsigned int fe_index = *pointer; @@ -575,7 +575,7 @@ namespace internal // make sure we are on an // object for which DoFs have // been allocated at all - Assert (dof_offsets[obj_index] != numbers::invalid_unsigned_int, + Assert (dof_offsets[obj_index] != numbers::invalid_dof_index, ExcMessage ("You are trying to access degree of freedom " "information for an object on which no such " "information is available")); @@ -610,7 +610,7 @@ namespace internal const types::global_dof_index *pointer = &dofs[starting_offset]; while (true) { - if (*pointer == numbers::invalid_unsigned_int) + if (*pointer == numbers::invalid_dof_index) // end of list reached return false; else if (*pointer == fe_index) 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 c1ff69c2e2..b2fdf6919b 100644 --- a/deal.II/include/deal.II/lac/block_vector_base.h +++ b/deal.II/include/deal.II/lac/block_vector_base.h @@ -1677,7 +1677,7 @@ namespace internal current_block = parent.n_blocks(); index_within_block = 0; next_break_backward = global_index; - next_break_forward = numbers::invalid_unsigned_int; + next_break_forward = numbers::invalid_size_type; }; } @@ -1709,7 +1709,7 @@ namespace internal // then move the next // boundary arbitrarily far // away - next_break_forward = numbers::invalid_unsigned_int; + next_break_forward = numbers::invalid_size_type; }; ++global_index; @@ -1743,7 +1743,7 @@ namespace internal // get into unspecified terrain { --current_block; - index_within_block = numbers::invalid_unsigned_int; + index_within_block = numbers::invalid_size_type; next_break_forward = 0; next_break_backward = 0; }; diff --git a/deal.II/include/deal.II/lac/constraint_matrix.h b/deal.II/include/deal.II/lac/constraint_matrix.h index c4df71fa0e..cbd11d0ce6 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.h @@ -1610,11 +1610,11 @@ private: * contains the position of the * ConstraintLine of a constrained degree * of freedom, or - * numbers::invalid_unsigned_int if the + * numbers::invalid_size_type if the * degree of freedom is not * constrained. The - * numbers::invalid_unsigned_int - * return value returns thus whether + * numbers::invalid_size_type + * return value returns thus whether * there is a constraint line for a given * degree of freedom index. Note that * this class has no notion of how many @@ -1841,7 +1841,7 @@ ConstraintMatrix::add_line (const size_type line) // several terabytes of memory to // resize the various arrays below // :-) - Assert (line != numbers::invalid_unsigned_int, + Assert (line != numbers::invalid_size_type, ExcInternalError()); const size_type line_index = calculate_line_index (line); @@ -1885,7 +1885,7 @@ ConstraintMatrix::add_entry (const size_type line, // in any case: exit the function if an // entry for this column already exists, // since we don't want to enter it twice - Assert (lines_cache[calculate_line_index(line)] != numbers::invalid_unsigned_int, + Assert (lines_cache[calculate_line_index(line)] != numbers::invalid_size_type, ExcInternalError()); ConstraintLine *line_ptr = &lines[lines_cache[calculate_line_index(line)]]; Assert (line_ptr->line == line, ExcInternalError()); @@ -1911,7 +1911,7 @@ ConstraintMatrix::set_inhomogeneity (const size_type line, { const size_type line_index = calculate_line_index(line); Assert( line_index < lines_cache.size() && - lines_cache[line_index] != numbers::invalid_unsigned_int, + lines_cache[line_index] != numbers::invalid_size_type, ExcMessage("call add_line() before calling set_inhomogeneity()")); Assert(lines_cache[line_index] < lines.size(), ExcInternalError()); ConstraintLine *line_ptr = &lines[lines_cache[line_index]]; @@ -1950,7 +1950,7 @@ ConstraintMatrix::is_inhomogeneously_constrained (const size_type index) const // that means computing the line index twice const size_type line_index = calculate_line_index(index); if (line_index >= lines_cache.size() || - lines_cache[line_index] == numbers::invalid_unsigned_int) + lines_cache[line_index] == numbers::invalid_size_type) return false; else { @@ -1970,7 +1970,7 @@ ConstraintMatrix::get_constraint_entries (const size_type line) const // that means computing the line index twice const size_type line_index = calculate_line_index(line); if (line_index >= lines_cache.size() || - lines_cache[line_index] == numbers::invalid_unsigned_int) + lines_cache[line_index] == numbers::invalid_size_type) return 0; else return &lines[lines_cache[line_index]].entries; @@ -1987,7 +1987,7 @@ ConstraintMatrix::get_inhomogeneity (const size_type line) const // that means computing the line index twice const size_type line_index = calculate_line_index(line); if (line_index >= lines_cache.size() || - lines_cache[line_index] == numbers::invalid_unsigned_int) + lines_cache[line_index] == numbers::invalid_size_type) return 0; else return lines[lines_cache[line_index]].inhomogeneity; diff --git a/deal.II/include/deal.II/lac/matrix_block.h b/deal.II/include/deal.II/lac/matrix_block.h index b039686734..70d3b4f103 100644 --- a/deal.II/include/deal.II/lac/matrix_block.h +++ b/deal.II/include/deal.II/lac/matrix_block.h @@ -707,8 +707,8 @@ template inline MatrixBlock::MatrixBlock() : - row(deal_II_numbers::invalid_unsigned_int), - column(deal_II_numbers::invalid_unsigned_int) + row(deal_II_numbers::invalid_size_type), + column(deal_II_numbers::invalid_size_type) {} diff --git a/deal.II/include/deal.II/lac/parallel_vector.templates.h b/deal.II/include/deal.II/lac/parallel_vector.templates.h index 9f719906a6..30cfce14f3 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.templates.h +++ b/deal.II/include/deal.II/lac/parallel_vector.templates.h @@ -309,7 +309,7 @@ namespace parallel Assert (ierr == MPI_SUCCESS, ExcInternalError()); Number *read_position = import_data; - std::vector >::const_iterator + std::vector >::const_iterator my_imports = part.import_indices().begin(); // If add_ghost_data is set, add the imported @@ -414,7 +414,7 @@ namespace parallel { Assert (import_data != 0, ExcInternalError()); Number *write_position = import_data; - std::vector >::const_iterator + std::vector >::const_iterator my_imports = part.import_indices().begin(); for ( ; my_imports!=part.import_indices().end(); ++my_imports) for (size_type j=my_imports->first; jsecond; j++) diff --git a/deal.II/include/deal.II/lac/relaxation_block.templates.h b/deal.II/include/deal.II/lac/relaxation_block.templates.h index e4763ef234..357e44af33 100644 --- a/deal.II/include/deal.II/lac/relaxation_block.templates.h +++ b/deal.II/include/deal.II/lac/relaxation_block.templates.h @@ -129,7 +129,7 @@ RelaxationBlock::invert_diagblocks () { const size_type column = entry->column(); const size_type col_cell = additional_data->block_list.row_position(block, column); - if (col_cell != numbers::invalid_unsigned_int) + if (col_cell != numbers::invalid_size_type) M_cell(row_cell, col_cell) = entry->value(); } } diff --git a/deal.II/include/deal.II/lac/sparse_ilu.templates.h b/deal.II/include/deal.II/lac/sparse_ilu.templates.h index 4080ceafc9..10d4acb4b3 100644 --- a/deal.II/include/deal.II/lac/sparse_ilu.templates.h +++ b/deal.II/include/deal.II/lac/sparse_ilu.templates.h @@ -79,7 +79,7 @@ void SparseILU::decompose (const SparseMatrix &matrix, const size_type N = this->m(); size_type jrow = 0; - std::vector iw (N, numbers::invalid_unsigned_int); + std::vector iw (N, numbers::invalid_size_type); for (size_type k=0; k > compressed_import_indices; + types::global_dof_index last_index = numbers::invalid_dof_index-1; + std::vector > compressed_import_indices; for (unsigned int i=0; i= local_range_data.first && expanded_import_indices[i] < local_range_data.second, ExcIndexRange(expanded_import_indices[i], local_range_data.first, local_range_data.second)); - unsigned int new_index = (expanded_import_indices[i] - + types::global_dof_index new_index = (expanded_import_indices[i] - local_range_data.first); if (new_index == last_index+1) compressed_import_indices.back().second++; else { compressed_import_indices.push_back - (std::pair(new_index,new_index+1)); + (std::pair(new_index,new_index+1)); } last_index = new_index; } diff --git a/deal.II/source/dofs/dof_renumbering.cc b/deal.II/source/dofs/dof_renumbering.cc index 92aedf95fe..571286b87f 100644 --- a/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/source/dofs/dof_renumbering.cc @@ -435,7 +435,7 @@ namespace DoFRenumbering const bool reversed_numbering, const std::vector &starting_indices) { - Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); //TODO: we should be doing the same here as in the other compute_CMK function to preserve some memory @@ -497,7 +497,7 @@ namespace DoFRenumbering dof_handler.renumber_dofs (renumbering); // for (unsigned int level=0;level &component_order_arg) { - Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); std::vector renumbering (dof_handler.n_dofs(level), @@ -731,8 +731,6 @@ namespace DoFRenumbering all_dof_counts(fe_collection.n_components() * Utilities::MPI::n_mpi_processes (tria->get_communicator())); - Assert (sizeof(types::global_dof_index) == sizeof(unsigned int), - ExcNotImplemented()); MPI_Allgather ( &local_dof_count[0], n_buckets, MPI_UNSIGNED, &all_dof_counts[0], n_buckets, MPI_UNSIGNED, tria->get_communicator()); @@ -869,7 +867,7 @@ namespace DoFRenumbering void block_wise (DoFHandler &dof_handler, const unsigned int level) { - Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); std::vector renumbering (dof_handler.n_dofs(level), @@ -1213,7 +1211,7 @@ namespace DoFRenumbering // make sure that all local DoFs got new numbers assigned Assert (std::find (renumbering.begin(), renumbering.end(), - numbers::invalid_unsigned_int) + numbers::invalid_dof_index) == renumbering.end(), ExcInternalError()); @@ -1242,7 +1240,7 @@ namespace DoFRenumbering const std::vector &selected_dofs, const unsigned int level) { - Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); std::vector renumbering(dof_handler.n_dofs(level), @@ -1299,7 +1297,7 @@ namespace DoFRenumbering const std::vector &selected_dofs, const unsigned int level) { - Assert(dof_handler.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); const unsigned int n_dofs = dof_handler.n_dofs(level); @@ -1422,7 +1420,7 @@ namespace DoFRenumbering const unsigned int level, const typename std::vector &cells) { - Assert(dof.n_dofs(level) != numbers::invalid_unsigned_int, + Assert(dof.n_dofs(level) != numbers::invalid_dof_index, ExcNotInitialized()); std::vector renumbering(dof.n_dofs(level)); @@ -1885,13 +1883,13 @@ namespace DoFRenumbering // same subdomain, then they will be in // this order also after reordering std::fill (new_dof_indices.begin(), new_dof_indices.end(), - numbers::invalid_unsigned_int); + numbers::invalid_dof_index); types::global_dof_index next_free_index = 0; for (types::subdomain_id subdomain=0; subdomainn_vertices(), - numbers::invalid_unsigned_int); + numbers::invalid_dof_index); unsigned int vertex_slots_needed = 0; for (unsigned int v=0; vn_vertices(); ++v) @@ -286,7 +286,7 @@ namespace internal for (unsigned int v=0; vn_vertices(); ++v) if (dof_handler.tria->vertex_used(v) == true) { - unsigned int pointer = dof_handler.vertex_dofs_offsets[v]; + types::global_dof_index pointer = dof_handler.vertex_dofs_offsets[v]; for (unsigned int fe=0; fesize(); ++fe) if (vertex_fe_association[fe][v] == true) { @@ -301,7 +301,7 @@ namespace internal } // finally place the end // marker - dof_handler.vertex_dofs[pointer] = numbers::invalid_unsigned_int; + dof_handler.vertex_dofs[pointer] = numbers::invalid_dof_index; } } @@ -1421,7 +1421,7 @@ namespace internal // line_dofs_offsets field dof_handler.faces->lines.dof_offsets .resize (dof_handler.tria->n_raw_lines(), - numbers::invalid_unsigned_int); + numbers::invalid_dof_index); unsigned int line_slots_needed = 0; for (unsigned int line=0; linen_raw_lines(); ++line) @@ -1459,7 +1459,7 @@ namespace internal } // finally place the end // marker - dof_handler.faces->lines.dofs[pointer] = numbers::invalid_unsigned_int; + dof_handler.faces->lines.dofs[pointer] = numbers::invalid_dof_index; } } @@ -2110,7 +2110,7 @@ namespace hp identities[i].second); Assert ((new_dof_indices[higher_dof_index] == - numbers::invalid_unsigned_int) + numbers::invalid_dof_index) || (new_dof_indices[higher_dof_index] == lower_dof_index), @@ -2281,10 +2281,10 @@ namespace hp // slave to // master if (new_dof_indices[master_dof_index] != - numbers::invalid_unsigned_int) + numbers::invalid_dof_index) { Assert (new_dof_indices[new_dof_indices[master_dof_index]] == - numbers::invalid_unsigned_int, + numbers::invalid_dof_index, ExcInternalError()); new_dof_indices[slave_dof_index] @@ -2293,7 +2293,7 @@ namespace hp else { Assert ((new_dof_indices[master_dof_index] == - numbers::invalid_unsigned_int) + numbers::invalid_dof_index) || (new_dof_indices[slave_dof_index] == master_dof_index), @@ -2359,7 +2359,7 @@ namespace hp = line->dof_index (identities[i].second, other_fe_index); Assert ((new_dof_indices[master_dof_index] == - numbers::invalid_unsigned_int) + numbers::invalid_dof_index) || (new_dof_indices[slave_dof_index] == master_dof_index), @@ -2497,7 +2497,7 @@ namespace hp = quad->dof_index (identities[i].second, other_fe_index); Assert ((new_dof_indices[master_dof_index] == - numbers::invalid_unsigned_int) + numbers::invalid_dof_index) || (new_dof_indices[slave_dof_index] == master_dof_index), @@ -2621,7 +2621,7 @@ namespace hp // lower-dimensional objects // where elements come together std::vector - constrained_indices (number_cache.n_global_dofs, numbers::invalid_unsigned_int); + constrained_indices (number_cache.n_global_dofs, numbers::invalid_dof_index); compute_vertex_dof_identities (constrained_indices); compute_line_dof_identities (constrained_indices); compute_quad_dof_identities (constrained_indices); @@ -2630,10 +2630,10 @@ namespace hp // new numbers to those which are // not constrained std::vector - new_dof_indices (number_cache.n_global_dofs, numbers::invalid_unsigned_int); + new_dof_indices (number_cache.n_global_dofs, numbers::invalid_dof_index); types::global_dof_index next_free_dof = 0; for (types::global_dof_index i=0; i tmp; + std::vector tmp; std::swap (vertex_dofs_offsets, tmp); } } diff --git a/deal.II/source/lac/sparsity_pattern.cc b/deal.II/source/lac/sparsity_pattern.cc index 9d80edb4dc..9875a7d1ba 100644 --- a/deal.II/source/lac/sparsity_pattern.cc +++ b/deal.II/source/lac/sparsity_pattern.cc @@ -941,7 +941,7 @@ SparsityPattern::row_position (const size_type i, const size_type j) const // entry exists if (colnums[k] == j) return k-rowstart[i]; } - return numbers::invalid_unsigned_int; + return numbers::invalid_size_type; } diff --git a/deal.II/source/lac/sparsity_tools.cc b/deal.II/source/lac/sparsity_tools.cc index 6e1103f7f0..a11b444c70 100644 --- a/deal.II/source/lac/sparsity_tools.cc +++ b/deal.II/source/lac/sparsity_tools.cc @@ -139,7 +139,7 @@ namespace SparsityTools { /** * Given a connectivity graph and a list of indices (where - * invalid_unsigned_int indicates that a node has not been numbered yet), + * invalid_size_type indicates that a node has not been numbered yet), * pick a valid starting index among the as-yet unnumbered one. */ size_type @@ -147,11 +147,11 @@ namespace SparsityTools const std::vector &new_indices) { { - size_type starting_point = numbers::invalid_unsigned_int; + size_type starting_point = numbers::invalid_size_type; size_type min_coordination = sparsity.n_rows(); for (size_type row=0; row=sparsity.n_rows())) - last_round_dofs[i] = numbers::invalid_unsigned_int; + last_round_dofs[i] = numbers::invalid_size_type; std::remove_if (last_round_dofs.begin(), last_round_dofs.end(), std::bind2nd(std::equal_to(), - numbers::invalid_unsigned_int)); + numbers::invalid_size_type)); // now if no valid points remain: find dof with lowest coordination number if (last_round_dofs.empty()) @@ -271,7 +271,7 @@ namespace SparsityTools // eliminate dofs which are // already numbered for (int s=next_round_dofs.size()-1; s>=0; --s) - if (new_indices[next_round_dofs[s]] != numbers::invalid_unsigned_int) + if (new_indices[next_round_dofs[s]] != numbers::invalid_size_type) next_round_dofs.erase (next_round_dofs.begin() + s); // check whether there are @@ -288,7 +288,7 @@ namespace SparsityTools if (next_round_dofs.empty()) { if (std::find (new_indices.begin(), new_indices.end(), - numbers::invalid_unsigned_int) + numbers::invalid_size_type) == new_indices.end()) // no unnumbered @@ -366,7 +366,7 @@ namespace SparsityTools // front-marching-algorithm (which // Cuthill-McKee actually is) has // reached all points. - Assert ((std::find (new_indices.begin(), new_indices.end(), numbers::invalid_unsigned_int) + Assert ((std::find (new_indices.begin(), new_indices.end(), numbers::invalid_size_type) == new_indices.end()) && diff --git a/deal.II/source/multigrid/mg_transfer_block.cc b/deal.II/source/multigrid/mg_transfer_block.cc index 3db1882b7c..7a623fcf4d 100644 --- a/deal.II/source/multigrid/mg_transfer_block.cc +++ b/deal.II/source/multigrid/mg_transfer_block.cc @@ -487,7 +487,7 @@ void MGTransferBlockSelect::build_matrices ( temp_copy_indices.resize (0); temp_copy_indices.resize (sizes[level][selected_block], - numbers::invalid_unsigned_int); + numbers::invalid_dof_index); // Compute coarse level right hand side // by restricting from fine level. @@ -527,11 +527,11 @@ void MGTransferBlockSelect::build_matrices ( const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), std::bind2nd(std::not_equal_to(), - numbers::invalid_unsigned_int)); + numbers::invalid_dof_index)); copy_indices[selected_block][level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i (temp_copy_indices[i], i); Assert (counter == n_active_dofs, ExcInternalError()); @@ -577,7 +577,7 @@ void MGTransferBlock::build_matrices ( { temp_copy_indices[block].resize (0); temp_copy_indices[block].resize (sizes[level][block], - numbers::invalid_unsigned_int); + numbers::invalid_dof_index); } // Compute coarse level right hand side @@ -607,11 +607,11 @@ void MGTransferBlock::build_matrices ( std::count_if (temp_copy_indices[block].begin(), temp_copy_indices[block].end(), std::bind2nd(std::not_equal_to(), - numbers::invalid_unsigned_int)); + numbers::invalid_dof_index)); copy_indices[block][level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i (temp_copy_indices[block][i], i); diff --git a/deal.II/source/multigrid/mg_transfer_component.cc b/deal.II/source/multigrid/mg_transfer_component.cc index c0eab83665..8d920f126e 100644 --- a/deal.II/source/multigrid/mg_transfer_component.cc +++ b/deal.II/source/multigrid/mg_transfer_component.cc @@ -629,7 +629,7 @@ void MGTransferSelect::build_matrices ( level_end = mg_dof.end_active(level); temp_copy_indices.resize (0); - temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_unsigned_int); + temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_dof_index); // Compute coarse level right hand side // by restricting from fine level. @@ -664,11 +664,11 @@ void MGTransferSelect::build_matrices ( const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), std::bind2nd(std::not_equal_to(), - numbers::invalid_unsigned_int)); + numbers::invalid_dof_index)); copy_to_and_from_indices[level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i (temp_copy_indices[i], i); Assert (counter == n_active_dofs, ExcInternalError()); diff --git a/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/source/multigrid/mg_transfer_prebuilt.cc index f8f482e136..4c7031eac3 100644 --- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -277,7 +277,7 @@ void MGTransferPrebuilt::build_matrices ( level_end = mg_dof.end_active(level); temp_copy_indices.resize (0); - temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_unsigned_int); + temp_copy_indices.resize (mg_dof.n_dofs(level), numbers::invalid_dof_index); // Compute coarse level right hand side // by restricting from fine level. @@ -311,11 +311,11 @@ void MGTransferPrebuilt::build_matrices ( const types::global_dof_index n_active_dofs = std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(), std::bind2nd(std::not_equal_to(), - numbers::invalid_unsigned_int)); + numbers::invalid_dof_index)); copy_indices[level].resize (n_active_dofs); types::global_dof_index counter = 0; for (types::global_dof_index i=0; i (temp_copy_indices[i], i); Assert (counter == n_active_dofs, ExcInternalError()); diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 2273e23093..586651a016 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -1062,10 +1062,10 @@ namespace MatrixCreator Threads::Mutex::ScopedLock lock (mutex); for (unsigned int i=0; i