]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
MGDoFTools::make_flux_sparsity_pattern function restores user_flags after using/chang...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 14 Jun 2002 13:13:50 +0000 (13:13 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 14 Jun 2002 13:13:50 +0000 (13:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@6128 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/multigrid/mg_dof_tools.cc

index 1781bb1176380e0ceb82daa36addb9cbc20dcb27..a2904071efb9bf0396a29b13c197f0dafd533d78 100644 (file)
@@ -224,7 +224,17 @@ MGTools::make_flux_sparsity_pattern (const MGDoFHandler<dim> &dof,
          flux_dof_mask[i][j] = true;
       }
   
-  (const_cast<Triangulation<dim>& > (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<bool> user_flags;
+  dof.get_tria().save_user_flags(user_flags);
+  const_cast<Triangulation<dim> &>(dof.get_tria()).clear_user_flags ();
   
   for (; cell!=endc; ++cell)
     {
@@ -271,6 +281,9 @@ MGTools::make_flux_sparsity_pattern (const MGDoFHandler<dim> &dof,
            }
        }
     }
+
+                                  // finally restore the user flags
+  const_cast<Triangulation<dim> &>(dof.get_tria()).load_user_flags(user_flags);
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.