std::vector<types::global_dof_index> global_gathered_numbers(
this->dof_handler->n_dofs(), 0);
- // as we call DoFRenumbering::subdomain_wise (*dof_handler) from
+ // as we call DoFRenumbering::subdomain_wise(*dof_handler) from
// distribute_dofs(), we need to support sequential-like input.
// Distributed-like input from, for example, component_wise renumbering
// is also supported.
- if (new_numbers.size() == this->dof_handler->n_dofs())
+ const bool uses_sequential_numbering =
+ new_numbers.size() == this->dof_handler->n_dofs();
+ bool all_use_sequential_numbering = false;
+ Utilities::MPI::internal::all_reduce<bool>(
+ MPI_LAND,
+ ArrayView<const bool>(&uses_sequential_numbering, 1),
+ tr->get_communicator(),
+ ArrayView<bool>(&all_use_sequential_numbering, 1));
+ if (all_use_sequential_numbering)
{
global_gathered_numbers = new_numbers;
}
template <int dim>
void
-test()
+test(const unsigned int n_global_refinements)
{
parallel::shared::Triangulation<dim> triangulation(
MPI_COMM_WORLD,
DoFHandler<dim> dof_handler(triangulation);
GridGenerator::hyper_cube(triangulation);
- triangulation.refine_global(2);
+ triangulation.refine_global(n_global_refinements);
const unsigned int n_refinements[] = {0, 4, 3, 2};
for (unsigned int i = 0; i < n_refinements[dim]; ++i)
MPILogInitAll all;
- deallog.push("2d");
- test<2>();
+ deallog.push("2d, no global refinements");
+ test<2>(0);
+ deallog.pop();
+
+ // To preserve output with an older version of this test reseed here:
+ Testing::srand(1);
+
+ deallog.push("2d, global refinements");
+ test<2>(2);
deallog.pop();
deallog.push("3d");
- test<3>();
+ test<3>(2);
deallog.pop();
}
-DEAL:0:2d::n_dofs: 818
-DEAL:0:2d::n_dofs: 1754
-DEAL:0:2d::n_dofs: 3056
+DEAL:0:2d, no global refinements::n_dofs: 114
+DEAL:0:2d, no global refinements::n_dofs: 272
+DEAL:0:2d, no global refinements::n_dofs: 652
+DEAL:0:2d, global refinements::n_dofs: 818
+DEAL:0:2d, global refinements::n_dofs: 1754
+DEAL:0:2d, global refinements::n_dofs: 3056
DEAL:0:3d::n_dofs: 13282
DEAL:0:3d::n_dofs: 41826
-DEAL:1:2d::n_dofs: 818
-DEAL:1:2d::n_dofs: 1754
-DEAL:1:2d::n_dofs: 3056
+DEAL:1:2d, no global refinements::n_dofs: 114
+DEAL:1:2d, no global refinements::n_dofs: 272
+DEAL:1:2d, no global refinements::n_dofs: 652
+DEAL:1:2d, global refinements::n_dofs: 818
+DEAL:1:2d, global refinements::n_dofs: 1754
+DEAL:1:2d, global refinements::n_dofs: 3056
DEAL:1:3d::n_dofs: 13282
DEAL:1:3d::n_dofs: 41826
-DEAL:2:2d::n_dofs: 818
-DEAL:2:2d::n_dofs: 1754
-DEAL:2:2d::n_dofs: 3056
+DEAL:2:2d, no global refinements::n_dofs: 114
+DEAL:2:2d, no global refinements::n_dofs: 272
+DEAL:2:2d, no global refinements::n_dofs: 652
+DEAL:2:2d, global refinements::n_dofs: 818
+DEAL:2:2d, global refinements::n_dofs: 1754
+DEAL:2:2d, global refinements::n_dofs: 3056
DEAL:2:3d::n_dofs: 13282
DEAL:2:3d::n_dofs: 41826