namespace RepartitioningPolicyTools
{
/**
- * A base class of a repartitioning policy.
+ * The base class for repartitioning policies.
+ *
+ * Used in
+ * MGTransferGlobalCoarseningTools::create_geometric_coarsening_sequence().
+ * See the description of RepartitioningPolicyTools for more information.
*/
template <int dim, int spacedim = dim>
class Base
};
/**
- * A policy that allows to specify a minimal number of cells per process. If
- * a threshold is reached, processes might be left without cells.
+ * A policy that allows to specify a minimal number of cells per
+ * process. If a threshold is reached, processes might be left
+ * without cells. The cells will be distributed evenly among the
+ * remaining processes.
*/
template <int dim, int spacedim = dim>
class MinimalGranularityPolicy : public Base<dim, spacedim>
/**
* Similar to the above function but taking in a constant version of
- * @p tria and as a consequence not allowing to directly use it for
- * coarsening, requiring that internally a temporal copy is created.
+ * @p tria. As a consequence, it can not be used for coarsening directly,
+ * so a temporary copy will be created internally.
*/
template <int dim, int spacedim>
std::vector<std::shared_ptr<const Triangulation<dim, spacedim>>>
// a repartitioning kicks in with the aim that all processes that own
// cells have at least the specified number of cells
- const unsigned int n_global_active_cells = tria_in.n_global_active_cells();
+ const types::global_cell_index n_global_active_cells =
+ tria_in.n_global_active_cells();
const unsigned int n_partitions =
std::max<unsigned int>(1,
- std::min(n_global_active_cells / n_min_cells,
- Utilities::MPI::n_mpi_processes(comm)));
+ std::min<types::global_cell_index>(
+ n_global_active_cells / n_min_cells,
+ Utilities::MPI::n_mpi_processes(comm)));
const unsigned int min_cells = n_global_active_cells / n_partitions;
Utilities::MPI::internal::mpi_type_id(&total_weight),
n_subdomains - 1,
mpi_communicator);
+ AssertThrowMPI(ierr);
// setup partition
LinearAlgebra::distributed::Vector<double> partition(partitioner);