* Return partitioner for the global indices of the cells on the active
* level of the triangulation.
*/
- const Utilities::MPI::Partitioner &
+ const std::weak_ptr<const Utilities::MPI::Partitioner>
global_active_cell_index_partitioner() const;
/**
* Return partitioner for the global indices of the cells on the given @p
* level of the triangulation.
*/
- const Utilities::MPI::Partitioner &
+ const std::weak_ptr<const Utilities::MPI::Partitioner>
global_level_cell_index_partitioner(const unsigned int level) const;
/**
/**
* Partitioner for the global active cell indices.
*/
- Utilities::MPI::Partitioner active_cell_index_partitioner;
+ std::shared_ptr<const Utilities::MPI::Partitioner>
+ active_cell_index_partitioner;
/**
* Partitioner for the global level cell indices for each level.
*/
- std::vector<Utilities::MPI::Partitioner> level_cell_index_partitioners;
+ std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
+ level_cell_index_partitioners;
NumberCache();
};
is_ghost.add_indices(is_ghost_vector.begin(), is_ghost_vector.end());
number_cache.active_cell_index_partitioner =
- Utilities::MPI::Partitioner(is_local, is_ghost, this->mpi_communicator);
+ std::make_shared<const Utilities::MPI::Partitioner>(
+ is_local, is_ghost, this->mpi_communicator);
// 6) proceed with multigrid levels if requested
if (this->is_multilevel_hierarchy_constructed() == true)
is_ghost_vector.end());
number_cache.level_cell_index_partitioners[l] =
- Utilities::MPI::Partitioner(is_local,
- is_ghost,
- this->mpi_communicator);
+ std::make_shared<const Utilities::MPI::Partitioner>(
+ is_local, is_ghost, this->mpi_communicator);
}
}
template <int dim, int spacedim>
- const Utilities::MPI::Partitioner &
+ const std::weak_ptr<const Utilities::MPI::Partitioner>
TriangulationBase<dim, spacedim>::global_active_cell_index_partitioner() const
{
return number_cache.active_cell_index_partitioner;
}
template <int dim, int spacedim>
- const Utilities::MPI::Partitioner &
+ const std::weak_ptr<const Utilities::MPI::Partitioner>
TriangulationBase<dim, spacedim>::global_level_cell_index_partitioner(
const unsigned int level) const
{
deallog << cell->id() << " -> " << cell->subdomain_id() << " "
<< cell->global_active_cell_index() << std::endl;
- const auto &part = tria.global_active_cell_index_partitioner();
+ const Utilities::MPI::Partitioner &part =
+ *tria.global_active_cell_index_partitioner().lock();
part.locally_owned_range().print(deallog);
part.ghost_indices().print(deallog);
deallog << cell->id() << " -> " << cell->level_subdomain_id() << " "
<< cell->global_level_cell_index() << std::endl;
- const auto &part = tria.global_level_cell_index_partitioner(l);
+ const Utilities::MPI::Partitioner &part =
+ *tria.global_level_cell_index_partitioner(l).lock();
part.locally_owned_range().print(deallog);
part.ghost_indices().print(deallog);