Parallelization in dolfinx heavily relies on the index_map. You’ll find that construct whenever arrays of data need to be distributed. Are you looking for something like this?
V0, V0_localdofs = V.sub(0).collapse() # V0 dofs in V local on this core
V_indexmap = V.dofmap.index_map
V0_globaldofs = np.setdiff1d( V_indexmap.local_to_global(np.array(V0_localdofs)), V_indexmap.ghosts ) # getting the global V0 dofs that live on this core
Thanks a lot, this is what I wanted. For context: I am using this information to create PETSc.IS objects so that I can suitably define the fields for the fiedslplit preconditioner. If there is any built-in way with dolfinx to do so, I would be happy to know.