]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use the documented way to partition a p::s::Triangulation by hand. 4863/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 15 Aug 2017 17:49:37 +0000 (11:49 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 15 Aug 2017 17:49:37 +0000 (11:49 -0600)
tests/sharedtria/hp_no_cells_01.cc
tests/sharedtria/no_cells_01.cc

index e58177a52099019e1be5911b9ca55746643fa28c..a5302748f2efdf08d7750704277fc5b9d07c49f6 100644 (file)
@@ -46,16 +46,21 @@ template <int dim>
 void test()
 {
   parallel::shared::Triangulation<dim>
-  triangulation (MPI_COMM_WORLD);
+  triangulation (MPI_COMM_WORLD, typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::limit_level_difference_at_vertices), true,
+                 parallel::shared::Triangulation<dim>::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<dim> fe;
   fe.push_back(FE_Q<dim>(1));
index 1d7d9e59997d9c276610bb62f2e397bd0f1f65dc..259a7fade3acc7675ebc86419b2a7077457a0064 100644 (file)
@@ -42,17 +42,21 @@ template <int dim>
 void test()
 {
   parallel::shared::Triangulation<dim>
-  triangulation (MPI_COMM_WORLD);
+  triangulation (MPI_COMM_WORLD, typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::limit_level_difference_at_vertices), true,
+                 parallel::shared::Triangulation<dim>::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<dim> fe(1);
 
   DoFHandler<dim> dof_handler (triangulation);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.