]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjusted thresholds for refine_and_coarsen_fixed_number() for both GridRefinement...
authormarcfehling <marc.fehling@gmx.net>
Thu, 5 Dec 2019 20:53:58 +0000 (21:53 +0100)
committermarcfehling <marc.fehling@gmx.net>
Thu, 5 Dec 2019 22:19:04 +0000 (23:19 +0100)
doc/news/changes/incompatibilities/20191205Fehling1 [new file with mode: 0644]
source/distributed/grid_refinement.cc
source/grid/grid_refinement.cc

diff --git a/doc/news/changes/incompatibilities/20191205Fehling1 b/doc/news/changes/incompatibilities/20191205Fehling1
new file mode 100644 (file)
index 0000000..a1e1352
--- /dev/null
@@ -0,0 +1,6 @@
+Changed: Adjusted threshold for fixed number adaptation: The last qualifying
+cells for refinement and coarsening now specify their respective threshold.
+This affects both GridRefinement::fixed_number_refinement() and
+parallel::distributed::GridRefinement::fixed_number_refinement().
+<br>
+(Marc Fehling, 12/05/2019)
index 8a89ceb141778131eb10d66459b0c2328fa13621..47e9d439d2278dd6054a7198bec5190ce0536b87 100644 (file)
@@ -481,8 +481,8 @@ namespace parallel
           bottom_threshold = RefineAndCoarsenFixedNumber::compute_threshold(
             locally_owned_indicators,
             global_min_and_max,
-            static_cast<unsigned int>((1 - adjusted_fractions.second) *
-                                      tria.n_global_active_cells()),
+            static_cast<unsigned int>(std::ceil(
+              (1 - adjusted_fractions.second) * tria.n_global_active_cells())),
             mpi_communicator);
         else
           {
index 0c6af2b6cc22c760425d3087eb2eda3215fa51ca..d60f062b7d00fe4228c368db5e8f380677de2d5d 100644 (file)
@@ -231,10 +231,10 @@ GridRefinement::refine_and_coarsen_fixed_number(
           else
             {
               std::nth_element(tmp.begin(),
-                               tmp.begin() + refine_cells,
+                               tmp.begin() + refine_cells - 1,
                                tmp.end(),
                                std::greater<double>());
-              refine(tria, criteria, *(tmp.begin() + refine_cells));
+              refine(tria, criteria, *(tmp.begin() + refine_cells - 1));
             }
         }
 

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.