From 1de1b85718a3a46f32af84817e6024315ad56d1d Mon Sep 17 00:00:00 2001 From: Guilhem Poy Date: Fri, 25 Apr 2025 08:00:30 +0200 Subject: [PATCH] Modifies the testing of FETools::Extrapolate. 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 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/mpi/fe_tools_extrapolate_common.h b/tests/mpi/fe_tools_extrapolate_common.h index 1271abc3f3..b98f692373 100644 --- a/tests/mpi/fe_tools_extrapolate_common.h +++ b/tests/mpi/fe_tools_extrapolate_common.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -42,7 +43,7 @@ #include "../tests.h" -// #define DEBUG_OUTPUT_VTK +#define DEBUG_OUTPUT_VTK template class TestFunction : public Function @@ -78,16 +79,16 @@ make_tria() typename parallel::distributed::Triangulation::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; } -- 2.39.5