Different result when using fenics_mixed_dimensional branch

Hi, I am using “fenics_mixed_dimensional” branch downloaded from Docker Hub.

To test the use of mixed dimension works, I ran the following simple script:

import numpy as np
import dolfin as dl


class BottomBoundary(dl.SubDomain):
    def inside(self, x, on_boundary):
        return dl.near(x[1], 0) and on_boundary


nx = 1
nz = 1

mesh = dl.UnitSquareMesh(nx, nz)
bottom_bd = BottomBoundary()

marker = dl.MeshFunction("size_t", mesh, mesh.topology().dim() - 1, 0)
bottom_bd.mark(marker, 1)
submesh = dl.MeshView.create(marker, 1)

Vh0 = dl.FunctionSpace(mesh, "Lagrange", 1)
Vh1 = dl.FunctionSpace(submesh, "Lagrange", 1)

v0 = dl.Function(Vh0)
m0 = dl.Function(Vh0)
m1 = dl.Function(Vh1)

v0.vector()[:] = np.random.rand(Vh0.dim())
m0.vector()[:] = np.ones(Vh0.dim())
m1.vector()[:] = np.ones(Vh1.dim())

ds = dl.Measure("ds", domain=mesh, subdomain_data=marker)
f0 = v0 * m0 * ds(1)

ds1 = dl.Measure("dx", domain=submesh)
f1 = v0 * m1 * ds1

print(dl.assemble(f0))
print(dl.assemble_mixed(f1))

I expect the printed results should be same, but they are different.

Could you please help me out of this issue? Thank you!

Hi,
Indeed the assembly of f0 and f1 should give the same result! I was able to reproduce your problem with the latest Docker, and I noticed that older Docker containers were giving the expected result.
I pushed an updated Docker container with a fix and I added your MWE as a test to make sure this keep giving the expected result;)