# OpenFOAM Solution to FreeFEM Solution Interpolation

**URL:** <https://community.freefem.org/t/openfoam-solution-to-freefem-solution-interpolation/1691>\
**Category:** General Discussion\
**Created:** [April 21, 2022, 11:35am UTC](https://community.freefem.org/t/openfoam-solution-to-freefem-solution-interpolation/1691 "2022-04-21T11:35:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![D\_N\_Sarkar](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@D\_N\_Sarkar](https://community.freefem.org/u/D_N_Sarkar)\
**Post date:** [April 21, 2022, 11:35am UTC](https://community.freefem.org/t/openfoam-solution-to-freefem-solution-interpolation/1691/1 "2022-04-21T11:35:22Z")

</div>

I have a flow field solution that has been computed in OpenFOAM. But I would like to interpolate the solution to FreeFEM.

What is the method/process to carry out this interpolation on FreeFEM mesh?

---

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [April 21, 2022, 12:06pm UTC](https://community.freefem.org/t/openfoam-solution-to-freefem-solution-interpolation/1691/2 "2022-04-21T12:06:55Z")

</div>

For 2D, you can use the `triangulate` function to create a mesh in which the vertices are the points where the data is given. Then, you can create a `P1` finite element space, assign the function values at the vertex points. In 3D the procedure is the same, but you need to use `tetgconvexhull` instead of `triangulate`.

---

<div class="post-metadata">

**Author:** ![zese](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zese/32/917_2.png) [@zese](https://community.freefem.org/u/zese)\
**Post date:** [April 22, 2022, 7:56am UTC](https://community.freefem.org/t/openfoam-solution-to-freefem-solution-interpolation/1691/3 "2022-04-22T07:56:57Z")

</div>

I used MATLAB interpolation. You create a mesh which can be read in Freefem then import it to matlab and interpolate the field on it then you can read both mesh and field in P1 seperately in freefem.
