# Transformations and FEM space

**URL:** <https://community.freefem.org/t/transformations-and-fem-space/320>\
**Category:** General Discussion\
**Created:** [April 7, 2020, 8:55pm UTC](https://community.freefem.org/t/transformations-and-fem-space/320 "2020-04-07T20:55:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amina](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@amina](https://community.freefem.org/u/amina)\
**Post date:** [April 7, 2020, 8:55pm UTC](https://community.freefem.org/t/transformations-and-fem-space/320/1 "2020-04-07T20:55:19Z")

</div>

Hi all,

I would like to create an interpolation matrix between two finite element spaces associated to the same mesh, but the geometry is transformed (rotated and translated).  
Actually, the connectivity at the FE space level is not the same although the geometry and the mesh (including its connectivity) are the same.

Thanks,

---

<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:** [April 8, 2020, 7:31am UTC](https://community.freefem.org/t/transformations-and-fem-space/320/2 "2020-04-08T07:31:01Z")

</div>

Dear amina,

I sorry, I don’t understand your problem,

1. you can build the interpolate matrix form the 2 finite element space associer to the two meshes, but I think you do not want that

2. you want to transport also the data, so in this case the interpolation matrix is the Identity.

Frederic Hecht

---

<div class="post-metadata">

**Author:** ![amina](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@amina](https://community.freefem.org/u/amina)\
**Post date:** [April 8, 2020, 1:10pm UTC](https://community.freefem.org/t/transformations-and-fem-space/320/3 "2020-04-08T13:10:17Z")

</div>

Dear Pr. Hecht,

Thank you very much for your willingness to help.

Actually, I want to transport the data as you say. The issue is that the nodes are not numbered the same way in the two meshes (before and after rotation+translation), which leads to non identical stiffness matrices and all other data.

Specifically, I need the permutation (transfer matrix i.e. matrice de passage) that transforms the data from a FEM space to another, and the identity doesn’t work since the numbering is different.

Best,  
Amina.

---

<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:** [April 9, 2020, 8:31am UTC](https://community.freefem.org/t/transformations-and-fem-space/320/4 "2020-04-09T08:31:58Z")

</div>

Please give a script example ,  
because if you do a **movemesh** to you get the same numbering,  
but of coarse if do the transformation of the boundary and you rebuild the mesh  
then I can say nothing.

Now the other problem is you solve elasticity problem, then the rotation must be taken in account.

---

<div class="post-metadata">

**Author:** ![amina](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@amina](https://community.freefem.org/u/amina)\
**Post date:** [April 9, 2020, 11:10pm UTC](https://community.freefem.org/t/transformations-and-fem-space/320/5 "2020-04-09T23:10:15Z")

</div>

Actually, I had applied a truncation of the mesh (which was the combination of 2 submeshes as you can see below) to get my submesh before rotation, which may have affected boundary conditions. Thanks for confirming that the connectivity should be the same. My problem is therefore solved.

mesh Th = ThHole+ ThBend;

int nPos = Th(L/5., 0.).region;  
int nNeg = Th(-D/12., 0.).region;  
func abscisse = x;

int[int] l1=[nNeg,200];  
mesh Th10=trunc(Th,(abscisse\<=0));  
Th10 = change(Th10,region=l1);  
// medit(“th2”, Th1);  
mesh Th20=trunc(Th,(abscisse\>=0));  
int[int] l2=[nPos,300];  
Th20 = change(Th20,region=l2);

Th = Th10 + Th20;
