From: Daniel Arndt Date: Sun, 20 Aug 2017 10:42:06 +0000 (+0200) Subject: Add an Assert for DoFHandler::get_finite_element() X-Git-Tag: v9.0.0-rc1~1189^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79d4cae1756caefd3846608469931f543fbbd191;p=dealii.git Add an Assert for DoFHandler::get_finite_element() --- diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 2d4f0aa5a2..7fa090decb 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -836,9 +836,11 @@ public: /** * Return a constant reference to the selected finite element object. + * Since there is only one FiniteElement @index must be equal to zero + * which is also the default value. */ const FiniteElement & - get_finite_element (const unsigned int number=0) const; + get_finite_element (const unsigned int index=0) const; /** * Return a constant reference to the set of finite element objects that @@ -1243,8 +1245,10 @@ template inline const FiniteElement & DoFHandler::get_finite_element -(const unsigned int) const +(const unsigned int index) const { + (void) index; + Assert(index == 0, ExcMessage("There is only one FiniteElement stored. The index must be zero!")); Assert(selected_fe!=nullptr, ExcMessage("You are trying to access the DoFHandler's FiniteElement object before it has been initialized.")); return *selected_fe; diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index c3b1d33b12..12961669b2 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -665,11 +665,11 @@ namespace hp const hp::FECollection &get_fe () const DEAL_II_DEPRECATED; /** - * Return a constant reference to the ith finite element object that is + * Return a constant reference to the indexth finite element object that is * used by this @p DoFHandler. */ const FiniteElement & - get_finite_element (const unsigned int i) const; + get_finite_element (const unsigned int index) const; /** * Return a constant reference to the set of finite element objects that