]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
refine and coarsen functions failed when criteria.all_zero()==true. This is now fixed.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 Nov 2001 12:08:02 +0000 (12:08 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 Nov 2001 12:08:02 +0000 (12:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@5291 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_refinement.cc

index 0f7c10939011084b0eaa542b2f0f1a7ef9cc15d6..d0e22723bfc0a2af59ee2aab38df18418a3726b2 100644 (file)
@@ -82,6 +82,12 @@ void GridRefinement::refine (Triangulation<dim>   &tria,
          ExcInvalidVectorSize(criteria.size(), tria.n_active_cells()));
   Assert (*std::min_element(criteria.begin(), criteria.end()) >= 0,
          ExcInvalidParameterValue());
+
+                                  // when all indicators are zero we
+                                  // do not need to refine but only
+                                  // to coarsen
+  if (criteria.all_zero())
+    return;
   
   typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active();
   const unsigned int n_cells = criteria.size();

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.