From: Guilhem Poy Date: Fri, 25 Apr 2025 06:00:30 +0000 (+0200) Subject: Modifies the testing of FETools::Extrapolate. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1de1b85718a3a46f32af84817e6024315ad56d1d;p=dealii.git 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. --- 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; }