# About Scott–Vogelius element

**URL:** <https://community.freefem.org/t/about-scott-vogelius-element/2000>\
**Category:** General Discussion\
**Created:** [September 10, 2022, 5:09am UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000 "2022-09-10T05:09:53Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 6, 2024, 6:10pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/21 "2024-02-06T18:10:48Z")

</div>

Running your new plugin I observe that the Powell-Sabin mesh is correct, but there is some difficulty:

When solving the Stokes linear system it takes 6 times more in cpu to get the solution. This indicates a stiff problem.  
I think that making the computations of the intersection between the edge and the line joining the two triangle centers in C++ is not accurate enough compared to the same computation in FreeFem++ (that I did).  
The consequence is that the points are not accurately enough aligned.  
I had such problems before when saving my mesh into mesh1.msh:  
I had to indicate a large number of digits when writing into the file.  
Is it possible to use higher accuracy in your splitmesh6.cpp script ?  
Francois.

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [February 7, 2024, 8:34am UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/22 "2024-02-07T08:34:18Z")

</div>

Ok, so I will put this new version in the develop version to day.

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [February 7, 2024, 9:00am UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/23 "2024-02-07T09:00:10Z")

</div>

Con you send me you script, because I am suprise about the Stokes probleme.  
The code is trivial, I think the problem is “ailleurs”.

mon script test …  
[Scott–Vogelius.edp](https://community.freefem.org/uploads/short-url/5wq6gL1HlDqt4BXOHAzK8dGZA5f.edp) (753 Bytes)

---

<div class="post-metadata">

**Author:** ![thingway](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/thingway/32/2353_2.png) [@thingway](https://community.freefem.org/u/thingway)\
**Post date:** [May 14, 2024, 2:43pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/24 "2024-05-14T14:43:54Z")

</div>

Dear teacher, the command “ **splitmesh6** ” does produce the powell-sabin mesh (in most situations), but it only suits two dimensions. Is there a similar command for producing the powell-sabin mesh in a **three-dimensional** area?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [May 14, 2024, 3:59pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/25 "2024-05-14T15:59:53Z")

</div>

`splitmesh12` is what you are looking for.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [May 14, 2024, 4:18pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/26 "2024-05-14T16:18:26Z")

</div>

In 3d this is called Worsey-Farin, see  
Low-order divergence-free approximations for the Stokes problem on  
Worsey–Farin and Powell–Sabin splits, Comput. Methods Appl. Mech. Engrg. 390 (2022) 114444

The Powell-Sabin split for arbitrary 2d mesh splitmesh6PowellSabin,  
and the Worsey-Farin split for arbitrary 3d mesh splitmesh12WorseyFarin are available on the developer branch of FreeFem, but you can get them as plugins  
[https://perso.math.u-pem.fr/bouchut.francois/splitmesh6.cpp](https://perso.math.u-pem.fr/bouchut.francois/splitmesh6.cpp)  
[https://perso.math.u-pem.fr/bouchut.francois/splitmesh12.cpp](https://perso.math.u-pem.fr/bouchut.francois/splitmesh12.cpp)  
(thanks Frederic Hecht for these update versions).  
You can call them by (for example)

```auto
load “splitmesh6”
mesh Th=splitmesh6PowellSabin(Th0);

```

```auto
load "splitmesh12"
mesh3 Th=splitmesh12WorseyFarin(Th0);

```

the previous commands (still available) splitmesh6 and splitmesh12 are simplified versions that work only for square() or cube() meshes.

---

<div class="post-metadata">

**Author:** ![thingway](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/thingway/32/2353_2.png) [@thingway](https://community.freefem.org/u/thingway)\
**Post date:** [May 14, 2024, 5:10pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/28 "2024-05-14T17:10:42Z")

</div>

Dear teacher, I am very grateful for your reply. And I get your idea. But when I use the Scott-V element (e.g., P2-P1disc), I need some restrictions on mesh for the inf\_sup condition. In 2D, we need the barycenter refinement and the powell-sabin refinement for 3D. So, using W-F mesh (splitmesh12) can also satisfy the LBB condition for the SV element ? Thank you again honestly.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [May 14, 2024, 7:14pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/29 "2024-05-14T19:14:52Z")

</div>

For short, the adapted split to satisfy the inf-sup condition is

– For P1/P0,  
splitmesh6PowellSabin in 2d  
splitmesh12WorseyFarin in 3d  
– For P2/P1dc  
splitmesh3 in 2d  
splitmesh4 in 3d

Indeed the inf-sup condition is satisfied on V\_h\times M\_h with V\_h either P1 or P2 according to the above, and M\_h a certain subspace of P0 or P1dc, containing the image of V\_h by the div operator. The precise definition of M\_h is not important (it is not the full space), what is important is that it contains \mathop{\rm div}V\_h.

---

<div class="post-metadata">

**Author:** ![thingway](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/thingway/32/2353_2.png) [@thingway](https://community.freefem.org/u/thingway)\
**Post date:** [May 15, 2024, 5:37am UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/30 "2024-05-15T05:37:59Z")

</div>

I used splitmesh4 and P2/P1dc for the 3D-Cavity\_Driven test, and it’s worked! Appreciation from my heart!

---

<div class="post-metadata">

**Author:** ![hanweiwei](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hanweiwei](https://community.freefem.org/u/hanweiwei)\
**Post date:** [April 9, 2026, 1:38pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/31 "2026-04-09T13:38:02Z")

</div>

Hi Professor,

For P1/P0, splitmesh6PowellSabin in 2d, splitmesh12WorseyFarin in 3d. V\_h = P1 for velocity, however, P0 is not the true space M\_h for pressure. Actually, M\_h is the subspace of P0, thus \nable \cdot V\_h \subset M\_h , which satisfies the divergence-free. So, how to define the true finite element space by using the FreeFem. I read your code given the above. You define the original mesh and then split it. Define the finite element space based on “For P1/P0, splitmesh6PowellSabin in 2d, splitmesh12WorseyFarin in 3d”. Finally, you define the weak formulation for Stokes like using the Taylor-Hood element pair. However, the space P0 is not the real space M\_h for pressure. How do you deal with it?

The paper “Low-order divergence-free approximations for the Stokes problem on  
Worsey–Farin and Powell–Sabin splits, Comput. Methods Appl. Mech. Engrg. 390 (2022) 114444“ gives an idea for achieving the real M\_h. Your above code is consistent with the idea? If not, could you have an idea to achieve this and give me a code example? Thanks for your attention!

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [April 10, 2026, 10:01am UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/32 "2026-04-10T10:01:05Z")

</div>

Dear Wenyue,  
You are right, the case P1/P0 is more involved. Here is the way I do it.

The space M\_h for pressure is a subspace of P0, defined locally by some linear relations between the dofs of P0(Th). Th is the mesh obtained by Powell-Sabin split of the mesh Th0.  
When solving \int q\mathop{\rm div} u=0, not all q\in P0 are necessary, we need only q\in M\_h, since M\_h=\mathop{\rm div} V\_h. Thus some lines of the matrix of the Stokes problem set on P0 are unnecessary. The principle is to replace these lines by the linear relations that we want to impose on the dofs of the pressure p.  
However, implementing this is not so easy because we need to identify the local dofs. They are related to the geometry of the split Th0–\>Th. Thus we need to identify these geometrical relations. This is done in the section “pressure space reduction”.  
Moreover we have to be careful of having a nonsingular system, and take care of the arbitrary constant in the pressure, and the fact the the test function q=1 is not necessary.  
Code:  
[stokes-powell-sabin.edp](https://community.freefem.org/uploads/short-url/7neawDYBIy0rl4JNeEcwpPlZmRv.edp) (12.3 KB)

This code is for the Stokes problem  
-\mathop{\rm div}Du+\nabla p=f, \qquad\mathop{\rm div}u=0,\qquad with Du\equiv (\nabla u+(\nabla u)^t)/2,  
with Dirichlet boundary conditions.  
Unfortunately if we change the boundary conditions, for example take Neumann, then the space reduction has to be modified for the boundary edges.

In the code there is also a simplified approach (obtained by taking “macro FEchoice()P1/P0eps” instead of “macro FEchoice()P1/P0”).  
The principle is to replace \mathop{\rm div}u=0 by \mathop{\rm div}u+\varepsilon p=0, for some small \varepsilon (taken 1e-8 in the code). Then we can simply get p=-\mathop{\rm div}u/\varepsilon and get the equation on u as  
-\mathop{\rm div}Du-\frac{1}{\varepsilon}\nabla\mathop{\rm div}u =f.  
This method of elimination of pressure is rather efficient, although it does not give exact free divergence. Notice that the Powell-Sabin split is here necessary in order to get the inf-sup condition that ensures the stability of the scheme.

---

<div class="post-metadata">

**Author:** ![hanweiwei](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hanweiwei](https://community.freefem.org/u/hanweiwei)\
**Post date:** [April 15, 2026, 9:32am UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/33 "2026-04-15T09:32:19Z")

</div>

Professor, thank you very much. I ran the code and found that the divergence of the velocity field is very small, about O( 10^(-15) ). So the velocity is exactly div-free. However, how to implement it is also difficult. So, if we use the P2/P1dc with barycenter refinement of the mesh, is it necessary to perform “pressure space reduction“? The code using P2/P1dc to perform numerical tests is similar to the usual Taylor-Hood finite element? Thanks again.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [April 28, 2026, 1:15pm UTC](https://community.freefem.org/t/about-scott-vogelius-element/2000/34 "2026-04-28T13:15:51Z")

</div>

The scheme with pressure space reduction is complicate. This is why I have proposed the simplified approach, which does not need it. Then the div is of order \varepsilon. This parameter has to be small, but not too much otherwise the error in the momentum equation becomes not negligible. I proposed to take a medium value \varepsilon=1e-8=\sqrt{1e-16} in order to balance the two errors (error in the div and error in the momentum). It leads to a divergence error of about 1e-8, which is good enough.

In the case of P2/P1dc with splitmesh3, there is no need of pressure space reduction. The algorithm is simple in this case.  
[stokes-hct.edp](https://community.freefem.org/uploads/short-url/5v62XW003MC40bl21ywsVXif3u3.edp) (6.5 KB)  
the exact case is `macro linearsystem()velpressmatrix//`  
the simplified case (similar to the P1/P0 above) is `macro linearsystem()eliminatepressure//`  
another simplified is `macro linearsystem()directsolve//` (more intuitive, but most costly than the previous)

[Previous page](https://community.freefem.org/t/about-scott-vogelius-element/2000.md?page=1)
