- Thank you received: 0
definedon in mixed formulatons
5 years 7 months ago #1564
by NilsHM
definedon in mixed formulatons was created 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
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
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
5 years 7 months ago - 5 years 7 months ago #1565
by christopher
Replied by christopher on topic definedon in mixed formulatons
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:
But I agree, the error message is not very helpful. We will fix that.
Best
Christopher
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"))
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