definedon in mixed formulatons

Hello Forum!
I want to have mixed formulations in certain sections of the domain, so there are different weak forms governing in different sections. I build the finite element space and the bilinear form like this:

fesCurl = HCurl(mesh, order = 3, nograds = True)
fes1_iron = H1(mesh, order = 3, definedon = “iron”)
fesm = FESpace([fesCurl, fes1_iron])
u, s = fesm.TrialFunction()
v, t = fesm.TestFunction()
a = BilinearForm(fesm)
a += SymbolicBFI(curl(u)curl(v))
a += SymbolicBFI(v
grad(s)*s + grad(s)*grad(t), definedon = “iron”)

This results in the following error message:

Traceback (most recent call last):
File “”, line 8, in
a += SymbolicBFI(v*grad(s)*s + grad(s)*grad(t), definedon = “iron”)
TypeError: Cannot convert Python object to C Array

This message only appears if there is the option definedon = “iron”.
Is there any way to fix that?

Best regards,
Nils

Hi Nils,
You have to give a regions object to the integrator (this is mainly because the integrator needs some mesh-information which is stored in the region object)
The correct way to call it is:

a += SymbolicBFI(v*grad(s)*s + grad(s)*grad(t), definedon = mesh.Materials("iron"))

But I agree, the error message is not very helpful. We will fix that.
Best
Christopher