# Which mesh/coordinate is used to compute dx(du) after moving mesh

**URL:** <https://community.freefem.org/t/which-mesh-coordinate-is-used-to-compute-dx-du-after-moving-mesh/788>\
**Category:** General Discussion\
**Created:** [February 7, 2021, 10:54am UTC](https://community.freefem.org/t/which-mesh-coordinate-is-used-to-compute-dx-du-after-moving-mesh/788 "2021-02-07T10:54:00Z")\
**Posts on this page:** 3\
**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:** [February 7, 2021, 10:54am UTC](https://community.freefem.org/t/which-mesh-coordinate-is-used-to-compute-dx-du-after-moving-mesh/788/1 "2021-02-07T10:54:00Z")

</div>

Hi,

I am a bit confused with the following dxd(u) – based upon which mesh the derivative is calculated?

Tho=Th;  
fespace Vh(Th,P2);  
fespace Vho(Tho,P2);  
Vh u;  
Vho uo;  
…  
Tho=Th;  
uo=u;  
Th=movemesh (Th, …);  
**dxd(u);** //first  
u=u; // Is this just an interpolation?  
**dxd(u);** // second  
u[] = uo[]; // is this a Larangian update?  
**dxd(u);** //third

Can I say the first dxd(u) is computed using the old mesh, and the second dxd(u) uses the new mesh, but the derivatives are the same? both of which are different to the third dxd(u)?

Best,  
Yongxing.

---

<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:** [February 8, 2021, 4:44pm UTC](https://community.freefem.org/t/which-mesh-coordinate-is-used-to-compute-dx-du-after-moving-mesh/788/2 "2021-02-08T16:44:12Z")

</div>

dx(u) is the derivative of Finite element function u def on mesh Th.  
if u is almost == x then du(u) is almost == 1 and this do not depend of the mesh.

---

<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:** [February 8, 2021, 10:03pm UTC](https://community.freefem.org/t/which-mesh-coordinate-is-used-to-compute-dx-du-after-moving-mesh/788/3 "2021-02-08T22:03:36Z")

</div>

The problem is when you say u==x, this is still a Eulerian view, isn’t it? Once you define u=x, for example the density function, on a mesh, then you move (may twist or squeeze) the mesh and let the assiciated u follow the mesh, i.e. a Lagrangian movement, the u cannot be x on the new mesh anymore.  
Anyway, can I confirm that in FreeFEM++, u[]=uold[] is just a Lagrangian update?
