Hello,
The following code (run with mpirun -np 4) reproduces the problem I have. I want to assemble a global matrix that has non-zero contributions on the DOFs corresponding to vertices that lie in the shared edges of partitioned mesh. Why do I get an empty matrix upon assembly?
** Edited from original question to incorporate MiroK's suggestion. However problem persists - see reply **
from dolfin import *
comm = mpi_comm_world()
mpirank = MPI.rank(comm)
mpisize = MPI.size(comm)
ny = 5
mesh = UnitSquareMesh(ny-1, ny-1)
meshtopo = mesh.topology()
V = FunctionSpace(mesh, 'Lagrange', 1)
interfaces = FacetFunction('size_t', mesh)
interfaces.set_all(0)
shared_edges = meshtopo.shared_entities(1)
for edge in shared_edges.keys():
interfaces[edge] = 1
dS = Measure('dS', domain=mesh, subdomain_data=interfaces)
u = TrialFunction(V)
v = TestFunction(V)
mrobin = inner(u('-'),v('-'))*dS(1)
Mrobin = assemble(mrobin)
print Mrobin.array()