From c48e15138bf1846b54bbba369cfe5f5167a4e735 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 7 Mar 2017 18:24:31 +0100 Subject: [PATCH] Fix a bug in cell similarity detection after GridTools::transform --- include/deal.II/grid/grid_tools.h | 3 +++ tests/mappings/mapping_q_generic_cell_cache.cc | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index a0feb09058..7b1f2e9369 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -1727,6 +1727,9 @@ namespace GridTools + cell->face(face)->vertex(2) + cell->face(face)->vertex(3)) / 4.0; } } + + // Make sure FEValues notices that the mesh has changed + triangulation.signals.post_refinement(); } diff --git a/tests/mappings/mapping_q_generic_cell_cache.cc b/tests/mappings/mapping_q_generic_cell_cache.cc index 436cdb0847..fe484c80b6 100644 --- a/tests/mappings/mapping_q_generic_cell_cache.cc +++ b/tests/mappings/mapping_q_generic_cell_cache.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -// Test high order MappingQ on a ChartManifold. +// Test cell similarity over GridTools::transform (here: scale) #include "../tests.h" @@ -34,6 +34,12 @@ int main() { initlog (); + // there used to be a bug in the cell similarity detection beyond the + // GridTools::transform method , but cell similarity is only enabled without + // threads. to make sure this test is effective, manually set the thread + // limit to 1. + MultithreadInfo::set_thread_limit(1); + Triangulation<2> triangulation; FE_DGQ<2> fe(0); QMidpoint<2> qf_cell; -- 2.39.5