From bf5a467c0fd8ae15d2a99efeec9fc250ad364417 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 13 Mar 2021 15:14:47 +0100 Subject: [PATCH] Fix TriangulationBase::reset_global_cell_indices() --- source/distributed/tria_base.cc | 9 ++++++--- source/dofs/dof_handler.cc | 7 ++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index c497bc94c5..515081dac2 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -400,14 +400,17 @@ namespace parallel for (unsigned int i = 0; i < n_subdomains; ++i) cell_counter[i + 1] += cell_counter[i]; + AssertDimension(cell_counter.back(), this->n_active_cells()); + // create partitioners - IndexSet is_local(cell_counter.back()); + IndexSet is_local(this->n_active_cells()); is_local.add_range(cell_counter[my_subdomain], cell_counter[my_subdomain + 1]); - IndexSet is_ghost(cell_counter.back()); number_cache.active_cell_index_partitioner = std::make_shared( - is_local, is_ghost, this->mpi_communicator); + is_local, + complete_index_set(this->n_active_cells()), + this->mpi_communicator); // set global active cell indices and increment process-local counters for (const auto &cell : this->active_cell_iterators()) diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index eb430f395f..e7ba6ba8a2 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -2711,11 +2711,8 @@ DoFHandler::prepare_coarsening_and_refinement( dynamic_cast *>( &(*tria))) { - const auto &partitioner = - *parallel_tria->global_active_cell_index_partitioner().lock(); - future_levels.reinit(partitioner.locally_owned_range(), - partitioner.ghost_indices(), - partitioner.get_mpi_communicator()); + future_levels.reinit( + parallel_tria->global_active_cell_index_partitioner().lock()); } else { -- 2.39.5