From 283cf33774525592a457c38504fbd30619f4d90d Mon Sep 17 00:00:00 2001 From: hartmann Date: Wed, 28 Nov 2001 12:08:02 +0000 Subject: [PATCH] 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 --- deal.II/deal.II/source/grid/grid_refinement.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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(); -- 2.39.5