From 8269cad2321387b9173ea97936a8fa28c7cd8467 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 1 Dec 2014 10:24:37 -0600 Subject: [PATCH] Rewrite parts of the implementation to make it easier to read. --- source/grid/grid_refinement.cc | 61 ++++++++++------------------------ 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index 19cb654542..5dace02757 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2000 - 2013 by the deal.II authors +// Copyright (C) 2000 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -527,57 +527,32 @@ GridRefinement::refine_and_coarsen_optimize (Triangulation &tria, for (unsigned int i=0; i::max(); - - // in the worst case, refine all cells: - unsigned int minArg = N-1; - - // the sum of the expected error reduction on refinement - // in those elements which were marked - double s0 = 0; - - // note that the number of cells - // to be refined is M+1 - for (unsigned int M=0; M::max(); + unsigned int min_arg = 0; - // the function we want to minimize - const double min_M = std::pow(((std::pow(2.,dim)-1)*(1.+M)+N), (double) order/dim) * (E-s0); + for (unsigned int M = 0; M