How to compute the sum of jump errors on edges in DG

More
3 years 7 months ago #3626 by Younghigh
Hello, everyone.

Recently, I am studying the DG methods to solve the Stokes equation. The computation of L2 error, H1error and Diverror is OK, but I cannot find a simple operation to compute the jump error.

The following code is to computate the L2 error:

exactux = x
exactuy = -y
ux_num = gfu.components[0]
uy_num = gfu.components[1]
uL2err = sqrt(Integrate((ux_num-exactux)*(ux_num-exactux)+ (uy_num-exactuy)*(uy_num-exactuy), mesh))

Please help me! How to code for jump error \Sigma||[uh]|| on all edges?
More
3 years 7 months ago #3636 by mneunteufel
Hi Younghigh,

a quick try of computing the jump ||[\nabla u_h \cdot n]|| via
Code:
Integrate((grad(gfu)-grad(gfu).Other())*n*dx(skeleton=True), mesh)
led to the exception

netgen.libngpy._meshing.NgException: other mir not set, pls report to developers.

But with the exact solution at hand the following code should do the job (might not work for older NGSolve versions)
Code:
Integrate( (gfu-u_ex)**2*dx(element_boundary=True), mesh)
Note, that you get two values at each inner edge as a loop over elements and then over each element boundary is done.

Best
Michael
The following user(s) said Thank You: Younghigh
Time to create page: 0.113 seconds