From: Peter Munch Date: Sat, 13 Mar 2021 14:14:47 +0000 (+0100) Subject: Fix TriangulationBase::reset_global_cell_indices() X-Git-Tag: v9.3.0-rc1~327^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf5a467c0fd8ae15d2a99efeec9fc250ad364417;p=dealii.git Fix TriangulationBase::reset_global_cell_indices() --- 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 {