]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor adjustments to FETools::extrapolate().
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 10 Jun 2023 03:29:56 +0000 (21:29 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 10 Jun 2023 03:29:56 +0000 (21:29 -0600)
include/deal.II/fe/fe_tools_extrapolate.templates.h

index 9bf3e705df193fac2d3bffbfc34ed31cd950af19..27e2813d7007dd7200b4f6829d3e5be29f0adef2 100644 (file)
@@ -1224,9 +1224,15 @@ namespace FETools
       const CellData &       cell_data,
       std::vector<CellData> &cells_list)
     {
+      // Find the place to insert the cell:
       typename std::vector<CellData>::iterator bound =
         std::lower_bound(cells_list.begin(), cells_list.end(), cell_data);
 
+      // There are three possibilities: The cell needs to be inserted
+      // at the end, the cell needs to be inserted just before the place
+      // std::lower_bound found, or the cell already exists in the list
+      // and no longer needs to be inserted. In that last case,
+      // cell_data==*bound.
       if ((bound == cells_list.end()) || (cell_data < *bound))
         cells_list.insert(bound, 1, cell_data);
     }
@@ -1267,8 +1273,8 @@ namespace FETools
       unsigned int ready = 0;
       do
         {
-          for (unsigned int i = 0; i < received_needs.size(); ++i)
-            cell_data_insert(received_needs[i], cells_to_compute);
+          for (const auto &need : received_needs)
+            cell_data_insert(need, cells_to_compute);
 
           compute_cells(dof2, u, cells_to_compute, computed_cells, new_needs);
 

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.