From d25d5aee0b0f44564bad030a7fc84a672b2ca0b2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 15 Aug 2017 11:49:37 -0600 Subject: [PATCH] Use the documented way to partition a p::s::Triangulation by hand. --- tests/sharedtria/hp_no_cells_01.cc | 17 +++++++++++------ tests/sharedtria/no_cells_01.cc | 18 +++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/tests/sharedtria/hp_no_cells_01.cc b/tests/sharedtria/hp_no_cells_01.cc index e58177a520..a5302748f2 100644 --- a/tests/sharedtria/hp_no_cells_01.cc +++ b/tests/sharedtria/hp_no_cells_01.cc @@ -46,16 +46,21 @@ template void test() { parallel::shared::Triangulation - triangulation (MPI_COMM_WORLD); + triangulation (MPI_COMM_WORLD, typename Triangulation::MeshSmoothing + (Triangulation::limit_level_difference_at_vertices), true, + parallel::shared::Triangulation::partition_custom_signal); + triangulation.signals.post_refinement.connect ([&triangulation]() + { + // partition the triangulation by hand + for (auto cell : triangulation.active_cell_iterators()) + cell->set_subdomain_id (cell->active_cell_index() % + Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)); + } + ); GridGenerator::hyper_cube(triangulation); triangulation.refine_global (1); - // partition the triangulation by hand - for (auto cell : triangulation.active_cell_iterators()) - cell->set_subdomain_id (cell->active_cell_index() % - Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)); - hp::FECollection fe; fe.push_back(FE_Q(1)); diff --git a/tests/sharedtria/no_cells_01.cc b/tests/sharedtria/no_cells_01.cc index 1d7d9e5999..259a7fade3 100644 --- a/tests/sharedtria/no_cells_01.cc +++ b/tests/sharedtria/no_cells_01.cc @@ -42,17 +42,21 @@ template void test() { parallel::shared::Triangulation - triangulation (MPI_COMM_WORLD); + triangulation (MPI_COMM_WORLD, typename Triangulation::MeshSmoothing + (Triangulation::limit_level_difference_at_vertices), true, + parallel::shared::Triangulation::partition_custom_signal); + triangulation.signals.post_refinement.connect ([&triangulation]() + { + // partition the triangulation by hand + for (auto cell : triangulation.active_cell_iterators()) + cell->set_subdomain_id (cell->active_cell_index() % + Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)); + } + ); GridGenerator::hyper_cube(triangulation); triangulation.refine_global (1); - // partition the triangulation by hand - for (auto cell : triangulation.active_cell_iterators()) - cell->set_subdomain_id (cell->active_cell_index() % - Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)); - - FE_Q fe(1); DoFHandler dof_handler (triangulation); -- 2.39.5