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.

Integrate only on material

More
3 years 10 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
3 years 10 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
3 years 10 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
3 years 9 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
3 years 9 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.131 seconds