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