Unexpected behaviour of GhostMode.shared_vertex

Dear community,

I’m testing how dolfinx handles ghost elements with different ghost_mode settings. I’m using a small distributed mesh and printing the number of local and ghost cells on each rank.

Here’s my minimal example, on my 0.9.0 version of dolfinx:

from dolfinx import mesh
from mpi4py import MPI

domain = mesh.create_unit_square(
    MPI.COMM_WORLD, 4, 4, mesh.CellType.triangle,
    ghost_mode=mesh.GhostMode.shared_vertex  # or shared_facet
)

tdim = domain.topology.dim
num_local = domain.topology.index_map(tdim).size_local
num_ghost = domain.topology.index_map(tdim).num_ghosts

print(f"[rank {domain.comm.rank}] local cells: {num_local}, ghost cells: {num_ghost}")

My expectation was that GhostMode.shared_vertex would lead to more ghost cells than shared_facet, since it includes cells sharing even just a vertex.

However, both settings return the same number of ghost cells. How is it possible?

Thanks a lot,
Giacomo

shared_vertex is currently not supported. I am suprised this doesn’t throw an error.
I’ll make an issue.

Thanks a lot @dokken, unfortunately I’ve never get an error with this option.
Do you have any thoughts about when it will be supported in future versions?

I have some ideas on how to support it.
It was initially removed as it was very expensive to use.