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 a function on the interior skeleton of the mesh.

More
1 year 7 months ago - 1 year 7 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: 1 year 7 months ago by Jindong.
Time to create page: 0.146 seconds