# Interpolation with zero extension

**URL:** <https://community.freefem.org/t/interpolation-with-zero-extension/1106>\
**Category:** General Discussion\
**Created:** [July 19, 2021, 4:45pm UTC](https://community.freefem.org/t/interpolation-with-zero-extension/1106 "2021-07-19T16:45:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [July 19, 2021, 4:45pm UTC](https://community.freefem.org/t/interpolation-with-zero-extension/1106/1 "2021-07-19T16:45:10Z")

</div>

interpolate from a small mesh **Ths** to a larger mesh **Th** , for example

fespace Vh(Th, P2);  
Vh u;

fespace Vhs(Ths, P2);  
Vh us=sin(x+y);

In default, **u=us** would extend the value of us to the whole Th, how can we let u=0 on Th-Ths (zero extension)?

---

<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:** [December 6, 2021, 12:55pm UTC](https://community.freefem.org/t/interpolation-with-zero-extension/1106/2 "2021-12-06T12:55:35Z")

</div>

Yes a add the function Chi to solve this problem : Chi(Ths) and Chi(Th)

so just do

just write u\*Chi(Th) ( zero outside of Th).
