From: Wolfgang Bangerth Date: Mon, 1 Dec 2014 16:24:37 +0000 (-0600) Subject: Rewrite parts of the implementation to make it easier to read. X-Git-Tag: v8.2.0-rc1~26^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F281%2Fhead;p=dealii.git Rewrite parts of the implementation to make it easier to read. --- 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