- Thank you received: 0
Integration over a cross section
5 years 2 months ago #1812
by vuong
Integration over a cross section was created 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
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
5 years 2 months ago #1814
by schruste
Replied by schruste on topic Integration over a cross section
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:
.
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
.
Best,
Christoph
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
5 years 2 months ago #1815
by vuong
Replied by vuong on topic Integration over a cross section
Dear Schruste,
Thank you very much for the information.
Best,
Vu
Thank you very much for the information.
Best,
Vu
5 years 2 months ago #1823
by joachim
Replied by joachim on topic Integration over a cross section
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
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
Attachments:
Time to create page: 0.113 seconds