# How to use interpolate operator to define problem

**URL:** <https://community.freefem.org/t/how-to-use-interpolate-operator-to-define-problem/1826>\
**Category:** General Discussion\
**Created:** [June 20, 2022, 7:49am UTC](https://community.freefem.org/t/how-to-use-interpolate-operator-to-define-problem/1826 "2022-06-20T07:49:40Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [June 20, 2022, 7:49am UTC](https://community.freefem.org/t/how-to-use-interpolate-operator-to-define-problem/1826/1 "2022-06-20T07:49:40Z")

</div>

Now, we need to difine bilinear form like this: ((id - I\_{h})\nable p\_h,(id - I\_{h})\nable q\_h)  
p\_h , q\_h \in fespace(Th,P2)  
I\_{h} is interpolate operator to fespace(Th,P1);

define problem as follows:  
mesh Th = square(16,16);  
fespace Vh (Th,P2);  
fespace Mh(Th,P1);  
matrix interMx = interpolate(Mh,Vh,op = 1);//dx  
matrix interMy = interpolate(Mh,Vh,op=2);//dy

problem pressure(p\_h, q\_h)  
int2d(Th)(dx(p\_h) \* dx(q\_h) + dy(p\_h) \* dy(q\_h) )  
+int2d(Th)((interMx \* p\_h) \* (interMx \* q\_h) + (interMy \* p\_h) \* (interMy \* q\_h) )  
-int2d(Th)( dx(p\_h) \* (interMx \* q\_h) + dy(p\_h) \* (interMy \* q\_h))  
-int2d(Th)( dx(q\_h) \* (interMx \* p\_h) + dy(q\_h) \* (interMy \* p\_h))

when try to run this code, some compile error ocuring  
can we define this problem, or using matrix formulations
