From: buerg Date: Fri, 10 Aug 2012 09:02:05 +0000 (+0000) Subject: Change unsigned int to types::global_dof_index. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f70462c6bd2f0436405d69ea7c405ff035b6f7d;p=dealii-svn.git Change unsigned int to types::global_dof_index. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25858 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 1267243915..ffd74ce9d6 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -318,9 +318,9 @@ class DoFHandler : public Subscriptor * object to the finite element. */ virtual void distribute_dofs (const FiniteElement &fe, - const unsigned int offset = 0); + const types::global_dof_index offset = 0); - virtual void distribute_mg_dofs (const FiniteElement& fe, const unsigned int offset = 0); + virtual void distribute_mg_dofs (const FiniteElement& fe, const types::global_dof_index offset = 0); /** * After distribute_dofs() with @@ -411,7 +411,7 @@ class DoFHandler : public Subscriptor * case that only one processor * participates in the mesh. */ - void renumber_dofs (const std::vector &new_numbers); + void renumber_dofs (const std::vector &new_numbers); /** * @deprecated Use @@ -1042,15 +1042,15 @@ class DoFHandler : public Subscriptor * DoFs which are constrained by * hanging nodes, see @ref constraints. */ - unsigned int n_dofs () const; + types::global_dof_index n_dofs () const; - unsigned int n_dofs (const unsigned int level) const; + types::global_dof_index n_dofs (const unsigned int level) const; /** * Return the number of degrees of freedom * located on the boundary. */ - unsigned int n_boundary_dofs () const; + types::global_dof_index n_boundary_dofs () const; /** * Return the number of degrees @@ -1065,7 +1065,7 @@ class DoFHandler : public Subscriptor * @p make_boundary_sparsity_pattern * function. */ - unsigned int + types::global_dof_index n_boundary_dofs (const FunctionMap &boundary_indicators) const; /** @@ -1076,7 +1076,7 @@ class DoFHandler : public Subscriptor * indicators under * consideration. */ - unsigned int + types::global_dof_index n_boundary_dofs (const std::set &boundary_indicators) const; /** @@ -1308,7 +1308,7 @@ class DoFHandler : public Subscriptor * degrees of freedom located at * vertices. */ - std::vector vertex_dofs; + std::vector vertex_dofs; @@ -1382,8 +1382,8 @@ class DoFHandler : public Subscriptor private: unsigned int coarsest_level; unsigned int finest_level; - unsigned int* indices; - unsigned int* indices_offset; + types::global_dof_index* indices; + types::global_dof_index* indices_offset; public: DeclException0 (ExcNoMemory); @@ -1391,9 +1391,9 @@ class DoFHandler : public Subscriptor ~MGVertexDoFs (); unsigned int get_coarsest_level () const; unsigned int get_finest_level () const; - unsigned int get_index (const unsigned int level, const unsigned int dof_number) const; + types::global_dof_index get_index (const unsigned int level, const unsigned int dof_number) const; void init (const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex); - void set_index (const unsigned int level, const unsigned int dof_number, const unsigned int index); + void set_index (const unsigned int level, const unsigned int dof_number, const types::global_dof_index index); }; void clear_mg_space (); @@ -1406,10 +1406,10 @@ class DoFHandler : public Subscriptor void reserve_space (); template - unsigned int get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const; + types::global_dof_index get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const; template - void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const; + void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const; /** * Space to store the DoF numbers @@ -1436,7 +1436,7 @@ class DoFHandler : public Subscriptor std::vector mg_vertex_dofs; - std::vector mg_used_dofs; + std::vector mg_used_dofs; /** * Make accessor objects friends. @@ -1457,9 +1457,9 @@ class DoFHandler : public Subscriptor #ifndef DOXYGEN -template <> unsigned int DoFHandler<1>::n_boundary_dofs () const; -template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const; -template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set &) const; +template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs () const; +template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const; +template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set &) const; /* ----------------------- Inline functions ---------------------------------- */ @@ -1475,7 +1475,7 @@ DoFHandler::n_dofs () const template inline -unsigned int DoFHandler::n_dofs (const unsigned int level) const { +types::global_dof_index DoFHandler::n_dofs (const unsigned int level) const { Assert (level < mg_used_dofs.size (), ExcInvalidLevel (level)); return mg_used_dofs[level]; } @@ -1607,7 +1607,7 @@ void DoFHandler::load (Archive & ar, template inline -unsigned int DoFHandler::MGVertexDoFs::get_index (const unsigned int level, const unsigned int dof_number) const { +types::global_dof_index DoFHandler::MGVertexDoFs::get_index (const unsigned int level, const unsigned int dof_number) const { Assert ((level >= coarsest_level) && (level <= finest_level), ExcInvalidLevel (level)); return indices[indices_offset[level - coarsest_level] + dof_number]; } @@ -1615,7 +1615,7 @@ unsigned int DoFHandler::MGVertexDoFs::get_index (const unsigned template inline -void DoFHandler::MGVertexDoFs::set_index (const unsigned int level, const unsigned int dof_number, const unsigned int index) { +void DoFHandler::MGVertexDoFs::set_index (const unsigned int level, const unsigned int dof_number, const types::global_dof_index index) { Assert ((level >= coarsest_level) && (level <= finest_level), ExcInvalidLevel (level)); indices[indices_offset[level - coarsest_level] + dof_number] = index; } diff --git a/deal.II/source/dofs/dof_handler.cc b/deal.II/source/dofs/dof_handler.cc index 0e5146ac24..dc84a2fbd2 100644 --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@ -510,7 +510,7 @@ namespace internal template static - unsigned int distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator& cell, unsigned int next_free_dof) { + types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator& cell, types::global_dof_index next_free_dof) { const FiniteElement<1, spacedim>& fe = cell->get_fe (); if (fe.dofs_per_vertex > 0) @@ -544,7 +544,7 @@ namespace internal template static - unsigned int distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator& cell, unsigned int next_free_dof) { + types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator& cell, types::global_dof_index next_free_dof) { const FiniteElement<2, spacedim>& fe = cell->get_fe (); if (fe.dofs_per_vertex > 0) @@ -572,7 +572,7 @@ namespace internal template static - unsigned int distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator& cell, unsigned int next_free_dof) { + types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator& cell, types::global_dof_index next_free_dof) { const FiniteElement<3, spacedim>& fe = cell->get_fe (); if (fe.dofs_per_vertex > 0) @@ -609,73 +609,73 @@ namespace internal template static - unsigned int get_dof_index (const DoFHandler<1, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<1>& mg_level, internal::DoFHandler::DoFFaces<1>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) { + types::global_dof_index get_dof_index (const DoFHandler<1, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<1>& mg_level, internal::DoFHandler::DoFFaces<1>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) { return mg_level.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index); } template static - unsigned int get_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>&, internal::DoFHandler::DoFFaces<2>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) { + types::global_dof_index get_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>&, internal::DoFHandler::DoFFaces<2>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) { return mg_faces.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index); } template static - unsigned int get_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>& mg_level, internal::DoFHandler::DoFFaces<2>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>) { + types::global_dof_index get_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>& mg_level, internal::DoFHandler::DoFFaces<2>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>) { return mg_level.quads.get_dof_index (dof_handler, obj_index, fe_index, local_index); } template static - unsigned int get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) { + types::global_dof_index get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) { return mg_faces.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index); } template static - unsigned int get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>) { + types::global_dof_index get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>) { return mg_faces.quads.get_dof_index (dof_handler, obj_index, fe_index, local_index); } template static - unsigned int get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>& mg_level, internal::DoFHandler::DoFFaces<3>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<3>) { + types::global_dof_index get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>& mg_level, internal::DoFHandler::DoFFaces<3>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<3>) { return mg_level.hexes.get_dof_index (dof_handler, obj_index, fe_index, local_index); } template static - void set_dof_index (const DoFHandler<1, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<1>& mg_level, internal::DoFHandler::DoFFaces<1>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>) { + void set_dof_index (const DoFHandler<1, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<1>& mg_level, internal::DoFHandler::DoFFaces<1>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<1>) { mg_level.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index); } template static - void set_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>&, internal::DoFHandler::DoFFaces<2>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>) { + void set_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>&, internal::DoFHandler::DoFFaces<2>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<1>) { mg_faces.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index); } template static - void set_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>& mg_level, internal::DoFHandler::DoFFaces<2>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<2>) { + void set_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>& mg_level, internal::DoFHandler::DoFFaces<2>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<2>) { mg_level.quads.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index); } template static - void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>) { + void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<1>) { mg_faces.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index); } template static - void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<2>) { + void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<2>) { mg_faces.quads.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index); } template static - void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>& mg_level, internal::DoFHandler::DoFFaces<3>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<3>) { + void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>& mg_level, internal::DoFHandler::DoFFaces<3>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const int2type<3>) { mg_level.hexes.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index); } }; @@ -1819,7 +1819,7 @@ types::global_dof_index DoFHandler<1>::n_boundary_dofs (const FunctionMap &bound template <> -unsigned int DoFHandler<1>::n_boundary_dofs (const std::set &boundary_indicators) const +types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set &boundary_indicators) const { // check that only boundary // indicators 0 and 1 are allowed @@ -1858,7 +1858,7 @@ types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &bou template <> -unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set &boundary_indicators) const +types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::set &boundary_indicators) const { // check that only boundary // indicators 0 and 1 are allowed @@ -1932,7 +1932,7 @@ DoFHandler::n_boundary_dofs (const FunctionMap &boundary_indicator template -unsigned int +types::global_dof_index DoFHandler::n_boundary_dofs (const std::set &boundary_indicators) const { Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(), @@ -1980,7 +1980,7 @@ DoFHandler::memory_consumption () const mem += MemoryConsumption::memory_consumption (*mg_faces); for (unsigned int i = 0; i < mg_vertex_dofs.size (); ++i) - mem += sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) * sizeof (unsigned int); + mem += sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) * sizeof (types::global_dof_index); mem += MemoryConsumption::memory_consumption (mg_used_dofs); return mem; @@ -1991,7 +1991,7 @@ DoFHandler::memory_consumption () const template void DoFHandler:: distribute_dofs (const FiniteElement &ff, - const unsigned int offset) + const types::global_dof_index offset) { selected_fe = &ff; @@ -2028,7 +2028,7 @@ distribute_dofs (const FiniteElement &ff, template -void DoFHandler::distribute_mg_dofs (const FiniteElement& fe, const unsigned int offset) { +void DoFHandler::distribute_mg_dofs (const FiniteElement& fe, const types::global_dof_index offset) { Assert ((dynamic_cast*> (&*tria) == 0), ExcMessage ("Invalid triangulation")); distribute_dofs (fe); reserve_space (); @@ -2043,7 +2043,7 @@ void DoFHandler::distribute_mg_dofs (const FiniteElement&>(*tria).clear_user_flags (); for (unsigned int level = 0; level < n_levels; ++level) { - unsigned int next_free_dof = offset; + types::global_dof_index next_free_dof = offset; for (cell_iterator cell = begin (level); cell != end (level); ++cell) next_free_dof = internal::DoFHandler::Implementation::distribute_dofs_on_cell (cell, next_free_dof); @@ -2116,15 +2116,15 @@ renumber_dofs (const std::vector &new_numbers) // processor if (n_locally_owned_dofs() == n_dofs()) { - std::vector tmp(new_numbers); + std::vector tmp(new_numbers); std::sort (tmp.begin(), tmp.end()); - std::vector::const_iterator p = tmp.begin(); - unsigned int i = 0; + std::vector::const_iterator p = tmp.begin(); + types::global_dof_index i = 0; for (; p!=tmp.end(); ++p, ++i) Assert (*p == i, ExcNewNumbersNotConsecutive(i)); } else - for (unsigned int i=0; i::clear_space () template template -unsigned int DoFHandler::get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const { +types::global_dof_index DoFHandler::get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const { return internal::DoFHandler::Implementation::get_dof_index (*this, *this->mg_levels[obj_level], *this->mg_faces, obj_index, fe_index, local_index, internal::int2type ()); } template template -void DoFHandler::set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const { +void DoFHandler::set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const { internal::DoFHandler::Implementation::set_dof_index (*this, *this->mg_levels[obj_level], *this->mg_faces, obj_index, fe_index, local_index, global_index, internal::int2type ()); }