"transfer" in PETSc-complex interface

Dear all,

I would like to use “transfer” function in PETSc-complex interface.
In FreeFEM v 4.8, the following code worked well:

//load “PETSc”
load “PETSc-complex”
macro dimension()2// EOM
include “macro_ddm.idp”

meshN Sh1=square(30,30,[x,y]);
meshN Sh2=square(50,50,[x,y]);

buildDmesh(Sh1)
buildDmesh(Sh2)

fespace Ph1(Sh1, P2);
Ph1 u=sin(4x)+cos(5y);

fespace Ph2(Sh2, P2);
Ph2 v;
// v=u;

macro defPlot(u)u//
transfer(Sh1, P2, u, Sh2, P2, v);

This code was borrowed from the previous topic:

However, I could not run the above example with FreeFEM v 4.9.
Would you have any solutions to this issue?

Thank you so much in advance,
Best regards,

Yuki

You need this commit Fixes renumv + adds PetscScalar in .edp · FreeFem/FreeFem-sources@723520e · GitHub which is in 4.9, so please consider updating your FreeFEM installation.
Also, your FE function needs to live in Ph1<complex> (resp. Ph2<complex>), not Ph1 (resp. Ph2).

Thank you for your advice.
I could transfer the solution in FreeFEM v 4.9 by changing FE spaces from Phk to Phk (k=1,2).