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.

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

More
3 years 2 weeks 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 2 weeks 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.138 seconds