From: hartmann Date: Wed, 28 Nov 2001 12:08:02 +0000 (+0000) Subject: refine and coarsen functions failed when criteria.all_zero()==true. This is now fixed. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=283cf33774525592a457c38504fbd30619f4d90d;p=dealii-svn.git refine and coarsen functions failed when criteria.all_zero()==true. This is now fixed. git-svn-id: https://svn.dealii.org/trunk@5291 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/grid_refinement.cc b/deal.II/deal.II/source/grid/grid_refinement.cc index 0f7c109390..d0e22723bf 100644 --- a/deal.II/deal.II/source/grid/grid_refinement.cc +++ b/deal.II/deal.II/source/grid/grid_refinement.cc @@ -82,6 +82,12 @@ void GridRefinement::refine (Triangulation &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::active_cell_iterator cell = tria.begin_active(); const unsigned int n_cells = criteria.size();