From 49e8894eb4b373557199088a7a9e15e2852fb2f4 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 29 Jul 2006 20:06:10 +0000 Subject: [PATCH] Come up with a better assertion. git-svn-id: https://svn.dealii.org/trunk@13499 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/dofs/dof_accessor.templates.h | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index 8b16e784ac..19f0d14240 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -290,22 +290,21 @@ DoFObjectAccessor<1,DH>::get_dof_indices (std::vector &dof_indices typename BaseClass::ExcVectorDoesNotMatch()); // this function really only makes - // sense on non-active objects if + // sense if either a) there are + // degrees of freedom defined on + // the present object, or b) the + // object is non-active objects but // all degrees of freedom are // located on vertices, since // otherwise there are degrees of // freedom on sub-objects which are // not allocated for this // non-active thing -// TODO: This assertion leads to problems with the do_make_hp_hanging_node_constraints -// method!. Check how this assertion can be stated that it does not create a conflict -// with the above mentioned method. -/* - Assert (!this->has_children() || + Assert (this->fe_index_is_active (fe_index) + || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 2*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - typename BaseClass::ExcNotActive()); -*/ + ExcInternalError()); const unsigned int dofs_per_vertex = this->dof_handler->get_fe()[fe_index].dofs_per_vertex, dofs_per_line = this->dof_handler->get_fe()[fe_index].dofs_per_line; @@ -371,23 +370,21 @@ DoFObjectAccessor<2,DH>::get_dof_indices (std::vector &dof_indices typename BaseClass::ExcVectorDoesNotMatch()); // this function really only makes - // sense on non-active objects if + // sense if either a) there are + // degrees of freedom defined on + // the present object, or b) the + // object is non-active objects but // all degrees of freedom are // located on vertices, since // otherwise there are degrees of // freedom on sub-objects which are // not allocated for this // non-active thing - -// TODO: This assertion leads to problems with the do_make_hp_hanging_node_constraints -// method!. Check how this assertion can be stated that it does not create a conflict -// with the above mentioned method. -/* - Assert (!this->has_children() || + Assert (this->fe_index_is_active (fe_index) + || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 4*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - typename BaseClass::ExcNotActive()); -*/ + ExcInternalError()); Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -476,22 +473,22 @@ DoFObjectAccessor<3,DH>::get_dof_indices (std::vector &dof_indices ExcMessage ("DoFHandler not initialized")); // this function really only makes - // sense on non-active objects if + // sense if either a) there are + // degrees of freedom defined on + // the present object, or b) the + // object is non-active objects but // all degrees of freedom are // located on vertices, since // otherwise there are degrees of // freedom on sub-objects which are // not allocated for this // non-active thing -// TODO: This assertion leads to problems with the do_make_hp_hanging_node_constraints -// method!. Check how this assertion can be stated that it does not create a conflict -// with the above mentioned method. -/* - Assert (!this->has_children() || + Assert (this->fe_index_is_active (fe_index) + || (this->dof_handler->get_fe()[fe_index].dofs_per_cell == 8*this->dof_handler->get_fe()[fe_index].dofs_per_vertex), - typename BaseClass::ExcNotActive()); -*/ + ExcInternalError()); + Assert (static_cast(this->present_level) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); -- 2.39.5