I don’t understand the meaning/order of the arguments in `MeshFunction`

, for examples this code gives error when uncommenting one of the two lines:

```
from dolfin import *
Len = 10.0
W = 2.0
H = 2.0
mesh = BoxMesh(Point(0.0, 0.0, 0.0), Point(Len, W, H), 10, 2, 2)
V = VectorFunctionSpace(mesh, "Lagrange", 1)
class Omega0(SubDomain):
def inside(self, x, on_boundary):
return True if x[0] <= Len / 2 else False
class Omega1(SubDomain):
def inside(self, x, on_boundary):
return True if x[0] > Len / 2 else False
subdomains = MeshFunction("size_t", mesh, mesh.topology().dim(), 0) # GIVES ERROR
#subdomains = MeshFunction("size_t", mesh, 0) # THIS WORKS
subdomain0 = Omega0().mark(subdomains, 0)
subdomain1 = Omega1().mark(subdomains, 1)
V1 = FunctionSpace(mesh, "CG", 1)
u = Function(V1)
v2d = vertex_to_dof_map(V1)
u.vector()[v2d] = subdomains.array()
#from vtkplotter.dolfin import plot
#plot(subdomains)
```

Traceback (most recent call last):

File “test.py”, line 28, in

u.vector()[v2d] = subdomains.array()

IndexError: Index mismatch

How do I set correctly the `u.vector()`

in the first case when I get the error message? Thanks!