definedon in mixed formulatons

More
5 years 7 months ago #1564 by NilsHM
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 "<ipython-input-18-d8234699cab8>", line 8, in <module>
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
More
5 years 7 months ago - 5 years 7 months ago #1565 by christopher
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:
Code:
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
Last edit: 5 years 7 months ago by christopher.
The following user(s) said Thank You: NilsHM
Time to create page: 0.108 seconds