From: Wolfgang Bangerth Date: Tue, 15 Aug 2017 17:49:37 +0000 (-0600) Subject: Use the documented way to partition a p::s::Triangulation by hand. X-Git-Tag: v9.0.0-rc1~1241^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d25d5aee0b0f44564bad030a7fc84a672b2ca0b2;p=dealii.git Use the documented way to partition a p::s::Triangulation by hand. --- 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);