I have been trying to debug a code which uses a mixed function space to solve the real and imaginary parts of the E-field. I think I have narrowed the bug down to a mapping problem. For now I would like to understand why following doesn't produce a list with a one-to-one index correspondence. My expectation was that mapping shared entities to global DOFs mean that for every dof index on processor a, there would be a single matching index on processor b.
Note: In this example, I have assumed that, due to the mixed function space, the dofmap maps edges N:2*N to corresponding DOFS if N is the number of edges.
from dolfin import *
import numpy as np
comm = mpi_comm_world()
mpirank = MPI.rank(comm)
mesh = UnitCubeMesh(2, 2, 2)
Vr = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
Vi = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
V = Vr * Vi
meshtopo = mesh.topology()
dofmap = V.dofmap()
e2d = dofmap.dofs(mesh, 1)
e2dg = np.array([dofmap.local_to_global_index(i) for i in e2d])
shared_entities = meshtopo.shared_entities(1)
for k, n in shared_entities.items():
print mpirank, e2dg[k]