From: Wolfgang Bangerth Date: Sun, 13 Aug 2017 19:21:43 +0000 (-0600) Subject: Make DoFAccessor::set_active_fe_index() a 'const' function. X-Git-Tag: v9.0.0-rc1~1273^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4817%2Fhead;p=dealii.git Make DoFAccessor::set_active_fe_index() a 'const' function. We are not being very consistent in marking which DoFAccessor functions are 'const' because it's difficult to actually define what 'const' would mean: does it change the accessor, or does it change the DoFHandler it points to. As a consequence, the TriaAccessor member functions are *all* const, but the DoFAccessor functions are more or less random. Rather than attacking this problem altogether, I'm making the minimal change that solves the problem I currently have. --- diff --git a/include/deal.II/dofs/dof_accessor.h b/include/deal.II/dofs/dof_accessor.h index b7944069fe..c848eb9de9 100644 --- a/include/deal.II/dofs/dof_accessor.h +++ b/include/deal.II/dofs/dof_accessor.h @@ -1710,7 +1710,7 @@ public: * associated with them without having any degrees of freedom. Consequently, * this function will produce an exception when called on non-active cells. */ - void set_active_fe_index (const unsigned int i); + void set_active_fe_index (const unsigned int i) const; /** * @} */ diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 881af450ac..a7953d7273 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -3116,7 +3116,7 @@ namespace internal template static void - set_active_fe_index (DoFCellAccessor, level_dof_access> &accessor, + set_active_fe_index (const DoFCellAccessor, level_dof_access> &accessor, const unsigned int i) { typedef dealii::DoFAccessor, level_dof_access> BaseClass; @@ -3771,7 +3771,7 @@ DoFCellAccessor::active_fe_index () const template inline void -DoFCellAccessor::set_active_fe_index (const unsigned int i) +DoFCellAccessor::set_active_fe_index (const unsigned int i) const { Assert ((dynamic_cast*> (this->dof_handler) != nullptr)