From d2b7d3b357e391d31b01612dba71fd60b5dd693b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 17 Jun 2017 19:15:09 -0600 Subject: [PATCH] Non-functional source cleanups at the textual level. --- include/deal.II/dofs/dof_handler.h | 12 +++++-- source/dofs/dof_handler.cc | 54 +++++++++++++++++++++++------- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index ffbc214337..ac85819b20 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1035,13 +1035,19 @@ private: types::global_dof_index *indices_offset; }; - void clear_mg_space (); - /** - * Free all used memory. + * Free all memory used for non-multigrid data structures. */ void clear_space (); + /** + * Free all memory used for multigrid data structures. + */ + void clear_mg_space (); + + /** + * Allocate space that will be used by distribute_dofs(). + */ void reserve_space (); template diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 6ec3099f4f..c0b2561007 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1404,7 +1404,7 @@ void DoFHandler<3>::renumber_dofs (const unsigned int level, const_cast &>(this->get_triangulation()).load_user_flags (user_flags); } - //HEX DoFs + // HEX DoFs for (std::vector::iterator i=mg_levels[level]->dof_object.dofs.begin(); i!=mg_levels[level]->dof_object.dofs.end(); ++i) { @@ -1479,14 +1479,15 @@ void DoFHandler::clear_space () number_cache.clear (); } + + template template 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 +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, @@ -1494,18 +1495,37 @@ DoFHandler::get_dof_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 types::global_dof_index 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 ()); + 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 ()); } + template -DoFHandler::MGVertexDoFs::MGVertexDoFs (): coarsest_level (numbers::invalid_unsigned_int), finest_level (0), indices (nullptr), indices_offset (nullptr) -{ -} +DoFHandler::MGVertexDoFs::MGVertexDoFs () + : + coarsest_level (numbers::invalid_unsigned_int), + finest_level (0), + indices (nullptr), + indices_offset (nullptr) +{} + template @@ -1515,8 +1535,12 @@ DoFHandler::MGVertexDoFs::~MGVertexDoFs () delete[] indices_offset; } + + template -void DoFHandler::MGVertexDoFs::init (const unsigned int cl, const unsigned int fl, const unsigned int dofs_per_vertex) +void DoFHandler::MGVertexDoFs::init (const unsigned int cl, + const unsigned int fl, + const unsigned int dofs_per_vertex) { if (indices != nullptr) { @@ -1531,7 +1555,7 @@ void DoFHandler::MGVertexDoFs::init (const unsigned int cl, const } coarsest_level = cl; - finest_level = fl; + finest_level = fl; if (cl > fl) return; @@ -1548,12 +1572,16 @@ void DoFHandler::MGVertexDoFs::init (const unsigned int cl, const indices_offset[i] = i * dofs_per_vertex; } + + template unsigned int DoFHandler::MGVertexDoFs::get_coarsest_level () const { return coarsest_level; } + + template unsigned int DoFHandler::MGVertexDoFs::get_finest_level () const { -- 2.39.5