# DG for Steady Stokes

**URL:** <https://community.freefem.org/t/dg-for-steady-stokes/3900>\
**Category:** General Discussion\
**Created:** [May 6, 2025, 4:14am UTC](https://community.freefem.org/t/dg-for-steady-stokes/3900 "2025-05-06T04:14:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![weixj](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@weixj](https://community.freefem.org/u/weixj)\
**Post date:** [May 6, 2025, 4:14am UTC](https://community.freefem.org/t/dg-for-steady-stokes/3900/1 "2025-05-06T04:14:27Z")

</div>

I am trying to solve the stabilized stokes equation using the DG method with P2dc-P1dc elements to give an exact solution and verify the order of spatial convergence. This is my code, and the code run shows that the convergence order is guaranteed to be correct after adding the stabilization term.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/2/206c3700f9ce3b9505940a3956ca5b2e0c0f9f84.png)

```auto
macro interstab(p, pp)(jump(p)*jump(pp)) //

```

```auto
+ intalledges(Th)( (1-nTonEdge)*interstab(p, pp) )

```

However I also tried programming in Matlab and found that the optimal spatial convergence order can be achieved without the stabilization term.

[steady\_stokes.edp](https://community.freefem.org/uploads/short-url/hkdrGEqCltQbjUjNYvzmIqD9MdW.edp) (4.5 KB)
