]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Modifies the testing of FETools::Extrapolate.
authorGuilhem Poy <guilhem.poy@umontpellier.fr>
Fri, 25 Apr 2025 06:00:30 +0000 (08:00 +0200)
committerGuilhem Poy <guilhem.poy@umontpellier.fr>
Fri, 25 Apr 2025 06:00:30 +0000 (08:00 +0200)
This modification ensures that the compression failure of LinearAlgebra::distributed::Vector is properly detected by modifying the test triangulation with a simple inversion symmetry of the refinement pattern. It does not change the norms of solution vector evaluated during the testing since the tested function is invariant under the inversion symmetry. However, it introduces locally owned DoFs at interfaces between coarse locally owned cells and refined ghost cells, which is precisely the reason the compression failure arises.

tests/mpi/fe_tools_extrapolate_common.h

index 1271abc3f36af27676764cd2daf4c81f8e9c3979..b98f69237329c04d4fcd445da54e552705b84c4e 100644 (file)
@@ -24,6 +24,7 @@
 #include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_tools.h>
 
+#include <deal.II/grid/filtered_iterator.h>
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_iterator.h>
@@ -42,7 +43,7 @@
 
 #include "../tests.h"
 
-// #define DEBUG_OUTPUT_VTK
+#define DEBUG_OUTPUT_VTK
 
 template <int dim>
 class TestFunction : public Function<dim>
@@ -78,16 +79,16 @@ make_tria()
   typename parallel::distributed::Triangulation<dim>::active_cell_iterator cell;
   GridGenerator::hyper_cube(*tria, 0., 1.);
   tria->refine_global(2);
-  for (int i = 0; i < 2; ++i)
+  for(auto &cell : tria->active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
     {
-      cell = tria->begin_active();
-      cell->set_refine_flag();
-      ++cell;
-      if (cell != tria->end())
+      auto p = cell->barycenter();
+      bool refine_cell = p[0]>0.5 && p[1]>0.5;
+      if (dim==3)
+        refine_cell = refine_cell && p[2]>0.75;
+      if (refine_cell)
         cell->set_refine_flag();
-
-      tria->execute_coarsening_and_refinement();
     }
+  tria->execute_coarsening_and_refinement();
   return tria;
 }
 

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.