Hello,
In version 0.9 of C++ Dolfinx, I could not find a way to perform load balancing on a mesh using weights per cell, as proposed by the Parmetis API.
I just want to check that I didn’t miss the right solution, as I did what I wanted anyway with the following C++ code :
header
CPP with a partial copy of partitioners.cpp (only the modified part is shown).
and before calling parmetis
which can be used as follow:
// weights computed above the way you want
const auto partitioner = dolfinx::graph::parmetis::partitionerWithWeight(weights);
auto cell_part= dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::none,partitioner);
// here some code to provides correct arguments to create_mesh
auto new_mesh = dolfinx::mesh::create_mesh(......., cell_part);
This is not safe, as the weights and function returned by partitionerWithWeight must be used with the same mesh dual graph. However, it is quick to implement and safe in my context. In future, it might be interesting to add edge dual graph weights, optional arguments, and Python exposure, unless this approach is deemed too insecure.
Thanks in advance