# Pass value between different vector fespaces

**URL:** <https://community.freefem.org/t/pass-value-between-different-vector-fespaces/1067>\
**Category:** General Discussion\
**Created:** [June 28, 2021, 1:34pm UTC](https://community.freefem.org/t/pass-value-between-different-vector-fespaces/1067 "2021-06-28T13:34:47Z")\
**Posts on this page:** 2\
**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:** [June 28, 2021, 1:34pm UTC](https://community.freefem.org/t/pass-value-between-different-vector-fespaces/1067/1 "2021-06-28T13:34:47Z")

</div>

Dear all,

if we have

Vh fespace (Th, [P2, P2, P1]);  
Wh fespace (Th, [P2,P2]);  
Vh [ux, uy, p];  
Wh [wx, wy];

After moving the mesh of Th, what shall we usually do if want to

1. pass the nodal values of ux and uy to wx and wy respectively?
2. interpolate [ux, uy] to [wx, wy]?

My initial though was

1. wx[] = ux[]
2. [wx, wy] = [ux, uy]

However, I am still confused. It seems [ux, uy] is not allowed, we have to use [ux, uy, p]. I am also not sure wx[] = ux[] is right or wrong, because the right-hand side has three components, whose order may be mixed up.

Best,  
Yongxing.

---

<div class="post-metadata">

**Author:** ![zhaog6](https://avatars.discourse-cdn.com/v4/letter/z/4af34b/32.png) [@zhaog6](https://community.freefem.org/u/zhaog6)\
**Post date:** [July 2, 2021, 3:49am UTC](https://community.freefem.org/t/pass-value-between-different-vector-fespaces/1067/2 "2021-07-02T03:49:42Z")

</div>

Why not use the following way?

```auto
real[int] tmp = ux[];
Th = movemesh(...);
[ux, uy, p] = [ux, uy, p];
ux[] = tmp;

```

> I am also not sure wx = ux is right or wrong, because the right-hand side has three components, whose order may be mixed up.

It’s wrong. `wx[]` and `ux[]` are different array. You can do a simple test: take `[ux, uy, p] = [1, 2, 3]` and check what happened.
