Integrate a function on the interior skeleton of the mesh.

More
2 years 2 months ago - 2 years 2 months ago #4492 by Jindong
Hello everyone,

I am doing a test for integrating a function on the skeleton of the mesh with the following code:

from ngsolve import *
from ngsolve.meshes import *
N = 1
mesh = MakeStructured2DMesh(quads=False, nx=N, ny=N)
exact = x
I = Integrate(exact*dx(skeleton=True), mesh)

Then it gives I 0.5. It seems to give the integration of the functiion over the whole mesh instead of the skeleton (interior facet). So is the code above wrong? The following code can give the result I want.

I = (Integrate(exact*dx(element_boundary=True), mesh) -  Integrate(exact*ds(skeleton=True), mesh))/2

I wonder if there is an alternative and direct way to compute the integration on the skeleton of the mesh (interior facet) so that I can compute the following error defined on the interior facets
\sum_{F} \| [u-u_exact] \|_{L^2(F)}^2where := u_{left}-u{right} for a DG function u.

Any help would be really appreciated.
Thank you.
Last edit: 2 years 2 months ago by Jindong.
Time to create page: 0.108 seconds