# Interpolate functions defined on different meshes

**URL:** <https://fenicsproject.discourse.group/t/interpolate-functions-defined-on-different-meshes/14516>\
**Category:** dolfinx\
**Created:** [May 3, 2024, 7:55am UTC](https://fenicsproject.discourse.group/t/interpolate-functions-defined-on-different-meshes/14516 "2024-05-03T07:55:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![niccobaldi](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@niccobaldi](https://fenicsproject.discourse.group/u/niccobaldi)\
**Post date:** [May 3, 2024, 7:55am UTC](https://fenicsproject.discourse.group/t/interpolate-functions-defined-on-different-meshes/14516/1 "2024-05-03T07:55:56Z")

</div>

Hi everybody, I am trying to compare two functions (say u1 and u2) defined on different meshes (say mesh1 and mesh2) where mesh1 is the unit square 10x10 and mesh2 is the unit square 5x5. Is there any way to do that? I tried to use u1.interpolate(u2) and viceversa but nothing worked. The DOLFINx version I’m using is 0.7.3. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![francesco-ballarin](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@francesco-ballarin](https://fenicsproject.discourse.group/u/francesco-ballarin)\
**Post date:** [May 3, 2024, 8:10am UTC](https://fenicsproject.discourse.group/t/interpolate-functions-defined-on-different-meshes/14516/2 "2024-05-03T08:10:42Z")

</div>

See for instance [dolfinx/python/test/unit/fem/test\_interpolation.py at v0.7.3 · FEniCS/dolfinx · GitHub](https://github.com/FEniCS/dolfinx/blob/v0.7.3/python/test/unit/fem/test_interpolation.py#L720)

---

<div class="post-metadata">

**Author:** ![niccobaldi](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@niccobaldi](https://fenicsproject.discourse.group/u/niccobaldi)\
**Post date:** [June 1, 2024, 1:59pm UTC](https://fenicsproject.discourse.group/t/interpolate-functions-defined-on-different-meshes/14516/3 "2024-06-01T13:59:34Z")

</div>

The function I serached for was the same written for interpolating functions on overlapping mashes with some adjustments. (I write that for future users). Thank you so much 🙂
