Integrate only on material

More
4 years 5 months ago #2746 by mischl
Hey, I have a function gfu and I want to integrate it on a domain which is a subset of my mesh

When creating my geometry I did
Code:
geo.SetMaterial(2,"rectangle")
and integrating on the mesh works fine
Code:
Integrate(gfu_old, mesh)

However, when I try to integrate on my rectangle, it doesn't work

Integrate(gfu_old, definedon=mesh.Materials("rectangle"))
Integrate(gfu_old, mesh.Materials("rectangle"))
Integrate(gfu_old, "rectangle")

I checked the help for integrate and mesh and google. Do I understand correct, that definedon is for my function spaces? Thanks for the answer, I assume it is an obvious one
More
4 years 5 months ago #2748 by mneunteufel
Hi mischl,

the correct syntax should by
Code:
Integrate(gfu_old, mesh, definedon=mesh.Materials("rectangle"))

It needs the mesh and the region as two separate arguments.

Best
Michael
The following user(s) said Thank You: mischl
More
4 years 5 months ago #2752 by joachim
Replied by joachim on topic Integrate only on material
with the coming nightly version also the shorter form
Code:
Integrate(gfu_old, mesh.Materials("rectangle"))
is working,

Joachim
The following user(s) said Thank You: mischl
More
4 years 5 months ago #2792 by mischl
Replied by mischl on topic Integrate only on material
Ah, thanks! So I didn't understand the help regarding this
More
4 years 5 months ago #2793 by mischl
Replied by mischl on topic Integrate only on material
that's so cool Joachim, thanks alot
Time to create page: 0.109 seconds