From: David Wells Date: Sun, 1 May 2016 00:42:33 +0000 (-0400) Subject: Remove unnecessary const_cast. X-Git-Tag: v8.5.0-rc1~1059^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2572%2Fhead;p=dealii.git Remove unnecessary const_cast. The non-multigrid algorithms have never needed to use user flags to indicate progress. --- diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index dcd1f3d60d..816b49f8b3 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -97,10 +97,6 @@ namespace internal dset_dof_index (d, next_free_dof++); - // note that this cell has been - // processed - cell->set_user_flag (); - return next_free_dof; } @@ -145,10 +141,6 @@ namespace internal for (unsigned int d=0; dset_dof_index (d, next_free_dof++); - - // note that this cell has been processed - cell->set_user_flag (); - return next_free_dof; } @@ -208,11 +200,6 @@ namespace internal for (unsigned int d=0; dset_dof_index (d, next_free_dof++); - - // note that this cell has been - // processed - cell->set_user_flag (); - return next_free_dof; } @@ -230,17 +217,8 @@ namespace internal const types::subdomain_id subdomain_id, DoFHandler &dof_handler) { - const dealii::Triangulation &tria - = dof_handler.get_triangulation(); - Assert (tria.n_levels() > 0, ExcMessage("Empty triangulation")); - - // Clear user flags because we will need them. But first we save - // them and make sure that we restore them later such that at the - // end of this function the Triangulation will be in the same state - // as it was at the beginning of this function. - std::vector user_flags; - tria.save_user_flags(user_flags); - const_cast &>(tria).clear_user_flags (); + Assert (dof_handler.get_triangulation().n_levels() > 0, + ExcMessage("Empty triangulation")); types::global_dof_index next_free_dof = offset; typename DoFHandler::active_cell_iterator @@ -261,9 +239,6 @@ namespace internal if (!cell->is_artificial()) cell->update_cell_dof_indices_cache (); - // finally restore the user flags - const_cast &>(tria).load_user_flags(user_flags); - return next_free_dof; }