-
-
Notifications
You must be signed in to change notification settings - Fork 221
Introduce create_identity_partitioner for refined mesh partitioning
#3661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Verification code: import febug
import pyvista
import dolfinx
import dolfinx.mesh
from mpi4py import MPI
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 4, 4)
mesh.topology.create_entities(2 - 1)
mesh.topology.create_connectivity(2 - 1, 2)
mesh.topology.create_entities(1)
[refined_mesh, _, _] = dolfinx.mesh.refine(
mesh, option=dolfinx.mesh.RefinementOption.parent_cell
)
subplotter = pyvista.Plotter(shape=(2, 1))
subplotter.subplot(0, 0)
febug.plot_mesh(mesh, plotter=subplotter)
subplotter.subplot(1, 0)
febug.plot_mesh(refined_mesh, plotter=subplotter)
# subplotter.show()
subplotter.save_graphic(f"out_{MPI.COMM_WORLD.rank}.pdf") |
|
|
create_identity_partitioner for refined mesh partitioning
|
I have a problem with the It comes down to: how can a |
|
My first reaction is that supporting If there are three options, perhaps an enum is better. |
|
The three cases are
Problem is that the |
|
How about we introduce aliases for |
|
I don't see how aliases would work. Python A |
Would only have worked on the C++ layer.
That's a fix - also realigns the python interface. No longer requires the additional |
|
This looks good to me - expensive repartitioning is now the default option, and it was always a bit odd that repartitioning would throw your mesh across all processes in the default case. It would be interesting to look at providing examples of other useful custom partitioners or calls into ParMETIS with non-default arguments. |
Introduces
create_identity_partitionerwhich facilitates the exchange of ghost cells of a refined mesh whilst maintaining the partition of the coarse mesh. This introduces the necessity of a new sentinel variableredistributefor the pythonrefinefunctionality to distinguish between the C++ cases ofnullptrandnulloptcorrectly.This fixes (partially) #3443.
Additionally, this changes
compute_destination_ranksfrom anonymous namespace todolfinx::graph,dolfinx.mesh.refine'spartitionerdefault argument value was not aligning with cpp layer, fixed,refine'soptionarg changed fromOption::nonetoOption::parent_cell,partitionerargument ofrefineis nowstd::optional, allows for handling of case of not provided (which is different from providingnullptras callable).