From 84159795f3f59e24677b1eff5bc11729aef546fc Mon Sep 17 00:00:00 2001 From: hartmann Date: Fri, 14 Jun 2002 13:13:50 +0000 Subject: [PATCH] MGDoFTools::make_flux_sparsity_pattern function restores user_flags after using/changing them. git-svn-id: https://svn.dealii.org/trunk@6128 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/multigrid/mg_dof_tools.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index 1781bb1176..a2904071ef 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -224,7 +224,17 @@ MGTools::make_flux_sparsity_pattern (const MGDoFHandler &dof, flux_dof_mask[i][j] = true; } - (const_cast& > (dof.get_tria())).clear_user_flags(); + // 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; + dof.get_tria().save_user_flags(user_flags); + const_cast &>(dof.get_tria()).clear_user_flags (); for (; cell!=endc; ++cell) { @@ -271,6 +281,9 @@ MGTools::make_flux_sparsity_pattern (const MGDoFHandler &dof, } } } + + // finally restore the user flags + const_cast &>(dof.get_tria()).load_user_flags(user_flags); } -- 2.39.5