From f2d7714cfe79ee42dc8c134d2d7f57f96f58ef41 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 13 Aug 2017 13:21:43 -0600 Subject: [PATCH] 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. --- include/deal.II/dofs/dof_accessor.h | 2 +- include/deal.II/dofs/dof_accessor.templates.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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) -- 2.39.5