Integration over a cross section

More
5 years 2 months ago #1812 by vuong
Dear All,

I need your help. My sample is a 3D cuboid. I want to take a 2D integration over a cross section parallel to the x-y plane and cuts the z-axis at z = z0. I only know Integrate(function, mesh) for an integration over the whole sample.
How can I do the cross section integration with NGSolve?

Any help is much appreciated.

Best regards,
Vu
More
5 years 2 months ago #1814 by schruste
Dear vuong,

If the plane z=z0 is part of the mesh as a boundary you can integrate on the boundary using a proper region flag:
Code:
defined=mesh.Boundaries("myplane")
.
Otherwise there is no core functionality in NGSolve. However, you can use ngs-xfem, which is a small add-on module for things like that ( see ngsxfemhttps://github.com/ngsxfem/ngsxfem ). There you have to provide a level set function where the zero level corresponds to your plane, i.e. this would look like
Code:
Integrate(levelset_domain = { "levelset" : z, "domain_type" : IF }, cf = your_integrand)
.

Best,
Christoph
More
5 years 2 months ago #1815 by vuong
Dear Schruste,

Thank you very much for the information.

Best,
Vu
More
5 years 2 months ago #1823 by joachim
Hi Vu,

now we have also another possibility for this purpose:

You define a second, independent (surface) mesh for the integration, e.g. your cut surface.

You can integrate the solution GridFunction from the original mesh over the second mesh, using interpolation in the integration points.

The attached example gives this result:
integral = 0.0249999999999999

You need the coming nightly release for this to work.

Best, Joachim
Time to create page: 0.113 seconds