From: heister Date: Thu, 1 Nov 2012 19:08:54 +0000 (+0000) Subject: merge from mainline X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cae946b8e83435bbc6ae224a5e4f44ced19282ad;p=dealii-svn.git merge from mainline git-svn-id: https://svn.dealii.org/branches/branch_merge_mg_into_dof_handler@27293 0785d39b-7218-0410-832d-ea1e28bc413d --- cae946b8e83435bbc6ae224a5e4f44ced19282ad diff --cc deal.II/source/dofs/dof_handler.cc index d1a371c03f,afa53fe64e..3f78fac5bf --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@@ -1229,74 -842,10 +1229,76 @@@ void DoFHandler::clear_sp std::vector tmp; std::swap (vertex_dofs, tmp); + + number_cache.clear (); } +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 { + 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 { + 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 (0), indices_offset (0) { +} + +template +DoFHandler::MGVertexDoFs::~MGVertexDoFs () { + delete[] indices; + delete[] indices_offset; +} + +template +void DoFHandler::MGVertexDoFs::init (const unsigned int cl, const unsigned int fl, const unsigned int dofs_per_vertex) { + if (indices != 0) { + delete[] indices; + indices = 0; + } + + if (indices_offset != 0) { + delete[] indices_offset; + indices_offset = 0; + } + + coarsest_level = cl; + finest_level = fl; + + if (cl > fl) + return; + + const unsigned int n_levels = finest_level - coarsest_level + 1; + const unsigned int n_indices = n_levels * dofs_per_vertex; + + indices = new unsigned int[n_indices]; + Assert (indices != 0, ExcNoMemory ()); + + for (unsigned int i = 0; i < n_indices; ++i) + indices[i] = DoFHandler::invalid_dof_index; + + indices_offset = new unsigned int[n_levels]; + Assert (indices != 0, ExcNoMemory ()); + + for (unsigned int i = 0; i < n_levels; ++i) + 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 { + return finest_level; +} + /*-------------- Explicit Instantiations -------------------------------*/ #include "dof_handler.inst"