Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

definedon in mixed formulatons

More
5 years 1 week 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 1 week ago - 5 years 1 week 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 1 week ago by christopher.
The following user(s) said Thank You: NilsHM
Time to create page: 0.132 seconds