# \[SOLVED\] Prolongation/restriction matrix

**URL:** <https://community.freefem.org/t/solved-prolongation-restriction-matrix/841>\
**Category:** General Discussion\
**Created:** [March 8, 2021, 9:33am UTC](https://community.freefem.org/t/solved-prolongation-restriction-matrix/841 "2021-03-08T09:33:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucasPa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/lucaspa/32/347_2.png) [@LucasPa](https://community.freefem.org/u/LucasPa)\
**Post date:** [March 8, 2021, 9:33am UTC](https://community.freefem.org/t/solved-prolongation-restriction-matrix/841/1 "2021-03-08T09:33:18Z")

</div>

Hi everyone !

I am solving Navier-Stokes equations, on a [P2, P2, P1] space (velocity-velocity-pressure):

> func PuPuPp=[P2, P2, P1];  
> fespace Uvvp(Th, PuPuPp);  
> Uvvp [ux,uy,up];

Moreover I define a space just for the velocity:

> func PuPu=[P2, P2];  
> fespace Uvv(Th, PuPu);  
> Uvv [ffx,ffy];

I would like to define a prolongation matrix and a restriction matrix that could be used such that:

> matrix projectionMatrix = ???;  
> matrix restrictionMatrix = ???;  
> ux = projectionMatrix \* ffx;  
> ffx = restrictionMatrix \* ux;

Can anyone, please, explain me how to define such matrices?

Best,

Lucas

---

<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:** [March 8, 2021, 10:17am UTC](https://community.freefem.org/t/solved-prolongation-restriction-matrix/841/2 "2021-03-08T10:17:43Z")

</div>

You can have a look at the [documentation](https://doc.freefem.org/documentation/finite-element.html#interpolation-matrix) to use the `interpolate` keyword.

---

<div class="post-metadata">

**Author:** ![LucasPa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/lucaspa/32/347_2.png) [@LucasPa](https://community.freefem.org/u/LucasPa)\
**Post date:** [March 8, 2021, 3:38pm UTC](https://community.freefem.org/t/solved-prolongation-restriction-matrix/841/3 "2021-03-08T15:38:16Z")

</div>

Thank you, that is exactly what I needed!
