From: Wolfgang Bangerth Date: Tue, 20 Jun 2017 09:21:29 +0000 (-0600) Subject: Remove hp::DoFHandler::MGVertexDoFs. X-Git-Tag: v9.0.0-rc1~1484^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=494aeffd310e775979815b37c28962a8ce5102a1;p=dealii.git Remove hp::DoFHandler::MGVertexDoFs. The hp::DoFHandler class does not support multilevel DoFs, and so having a remnant part of the infrastructure for them makes no sense. Removing this part from the class, however, requires a couple of specializations of functions in the DoFAccessor class that may have previously compiled, but would likely have led to segmentation faults if anyone tried to use them. --- diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 18048bba53..b50ff4376a 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -687,6 +687,58 @@ namespace internal } + template + static + types::global_dof_index + mg_vertex_dof_index (const dealii::DoFHandler &dof_handler, + const int level, + const unsigned int vertex_index, + const unsigned int i) + { + return dof_handler.mg_vertex_dofs[vertex_index].get_index (level, i); + } + + + template + static + types::global_dof_index + mg_vertex_dof_index (const dealii::hp::DoFHandler &, + const int, + const unsigned int, + const unsigned int) + { + Assert (false, ExcMessage ("hp::DoFHandler does not implement multilevel DoFs.")); + return numbers::invalid_dof_index; + } + + + template + static + void + set_mg_vertex_dof_index (dealii::DoFHandler &dof_handler, + const int level, + const unsigned int vertex_index, + const unsigned int i, + types::global_dof_index index) + { + return dof_handler.mg_vertex_dofs[vertex_index].set_index (level, i, index); + } + + + template + static + void + set_mg_vertex_dof_index (dealii::hp::DoFHandler &, + const int, + const unsigned int, + const unsigned int, + types::global_dof_index) + { + Assert (false, ExcMessage ("hp::DoFHandler does not implement multilevel DoFs.")); + } + + + template static bool @@ -1668,9 +1720,17 @@ DoFAccessor::mg_vertex_dof_index (co { (void)fe_index; Assert (this->dof_handler != nullptr, ExcInvalidObject ()); - Assert (vertex < GeometryInfo::vertices_per_cell, ExcIndexRange (vertex, 0, GeometryInfo::vertices_per_cell)); - Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex)); - return this->dof_handler->mg_vertex_dofs[this->vertex_index (vertex)].get_index (level, i); + Assert (vertex < GeometryInfo::vertices_per_cell, + ExcIndexRange (vertex, 0, GeometryInfo::vertices_per_cell)); + Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex)); + + return + dealii::internal::DoFAccessor::Implementation::mg_vertex_dof_index + (*this->dof_handler, + level, + this->vertex_index(vertex), + i); } @@ -1703,9 +1763,18 @@ DoFAccessor::set_mg_vertex_dof_index { (void)fe_index; Assert (this->dof_handler != nullptr, ExcInvalidObject ()); - Assert (vertex < GeometryInfo::vertices_per_cell, ExcIndexRange (vertex, 0, GeometryInfo::vertices_per_cell)); - Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex)); - this->dof_handler->mg_vertex_dofs[this->vertex_index (vertex)].set_index (level, i, index); + Assert (vertex < GeometryInfo::vertices_per_cell, + ExcIndexRange (vertex, 0, GeometryInfo::vertices_per_cell)); + Assert (i < this->dof_handler->get_fe ()[fe_index].dofs_per_vertex, + ExcIndexRange (i, 0, this->dof_handler->get_fe ()[fe_index].dofs_per_vertex)); + + return + dealii::internal::DoFAccessor::Implementation::set_mg_vertex_dof_index + (*this->dof_handler, + level, + this->vertex_index(vertex), + i, + index); } diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index 29ad295bac..45b3763871 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -734,15 +734,6 @@ namespace hp */ DoFHandler &operator = (const DoFHandler &); - class MGVertexDoFs - { - public: - MGVertexDoFs (); - ~MGVertexDoFs (); - types::global_dof_index get_index (const unsigned int level, const unsigned int dof_number) const; - void set_index (const unsigned int level, const unsigned int dof_number, const types::global_dof_index index); - }; - /** * Free all used memory. */ @@ -866,8 +857,6 @@ namespace hp */ std::vector vertex_dofs_offsets; - std::vector mg_vertex_dofs; // we should really remove this field! - /** * Array to store the information if a cell on some level has children or * not. It is used by the signal slots as a persistent buffer during the @@ -1050,41 +1039,6 @@ namespace hp return *tria; } - - - template - inline - DoFHandler::MGVertexDoFs::MGVertexDoFs() - { - Assert (false, ExcNotImplemented ()); - } - - template - inline - DoFHandler::MGVertexDoFs::~MGVertexDoFs() - { - Assert (false, ExcNotImplemented ()); - } - - template - inline - types::global_dof_index DoFHandler::MGVertexDoFs::get_index (const unsigned int, - const unsigned int) const - { - Assert (false, ExcNotImplemented ()); - return invalid_dof_index; - } - - template - inline - void DoFHandler::MGVertexDoFs::set_index (const unsigned int, - const unsigned int, - types::global_dof_index) - { - Assert (false, ExcNotImplemented ()); - } - - #endif }