-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Introduce create_identity_partitioner
for refined mesh partitioning
#3661
base: main
Are you sure you want to change the base?
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") |
Also, I have tested the implementation with the above code snippet - not sure how to extend that to a reasonable unit test though. |
create_identity_partitioner
for refined mesh partitioning
I have a problem with the It comes down to: how can a |
Introduces
create_identity_partitioner
which facilitates the exchange of ghost cells of a refined mesh whilst maintaining the partition of the coarse mesh.This fixes (partially) #3443.
Additionally, this changes
compute_destination_ranks
from anonymous namespace todolfinx::graph
,dolfinx.mesh.refine
'spartitioner
default argument value was not aligning with cpp layer, fixed,refine
'soption
arg changed fromOption::none
toOption::parent_cell
,partitioner
argument ofrefine
is nowstd::optional
, allows for handling of case of not provided (which is different from providingnullptr
as callable).