# How can I deform the Vh together with Th, with movemesh

**URL:** <https://community.freefem.org/t/how-can-i-deform-the-vh-together-with-th-with-movemesh/1432>\
**Category:** General Discussion\
**Created:** [January 14, 2022, 2:36pm UTC](https://community.freefem.org/t/how-can-i-deform-the-vh-together-with-th-with-movemesh/1432 "2022-01-14T14:36:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![huiprobable](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@huiprobable](https://community.freefem.org/u/huiprobable)\
**Post date:** [January 14, 2022, 2:36pm UTC](https://community.freefem.org/t/how-can-i-deform-the-vh-together-with-th-with-movemesh/1432/1 "2022-01-14T14:36:40Z")

</div>

Assume we have a 2D elastic object represented by a mesh Th, we solve for elasticity equations obtaining displacement u, v, as a fespace object Vh(Th, P2). Then we move the mesh Th according to the displacement, to get Th2. Then I can define another Vh object, let’s say, D=dx(u)+dy(v), as the divergence of the displacement. D is defined on mesh Th, how can I map it to a field D2 on mesh Th2? I mean, if X is a vertex in Th, and X becomes vertex X2 in Th2, then I would like to have D2(X2)=D(X).

---

<div class="post-metadata">

**Author:** ![huiprobable](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@huiprobable](https://community.freefem.org/u/huiprobable)\
**Post date:** [January 14, 2022, 9:44pm UTC](https://community.freefem.org/t/how-can-i-deform-the-vh-together-with-th-with-movemesh/1432/2 "2022-01-14T21:44:43Z")

</div>

I think I find a solution myself.

mesh Th2 = movemesh(Th, [x+u, y+v]);  
fespace Vh2(Th2, P2);  
Vh2 u2, v2;  
D2 = D(x-u, y-v);
