Pass value between different vector fespaces

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.

Why not use the following way?

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.