Dispatching RT0 components from sol

I have a solution obtained by variational form of RT0 fespace

fespace Eh(Th,RT0Ortho);
Eh<complex> [Ax,Ay];
varf vK11([ux,uy],[vx,vy])
            =int2d(Th)( nu * (dx(vy)-dy(vx)) * (dx(uy)-dy(ux))
                        + 1i*2*pi*freqf*sig* [vx,vy]' * [ux,uy] ) 
            -int2d(Th)( sig * [vx,vy]' * [E0x,E0y] )
            +on(CoilTerminalIn,CoilTerminalOut, ux=0,uy=0)
            +on(AirInBot1,AirOutBot,AirOutLeft, ux=0,uy=0);
matrix<complex> Kside = vK11(Eh,Eh);
complex[int] bside = vK11(0,Eh);
set(Kside, solver=UMFPACK);
complex[int] sol;
sol = Kside^-1 * bside;

how can I dispatch Ax and Ay from sol
it seems [Ax[],Ay[]]=sol; is the wrong approach.

Try this instead. Ax[] = sol;

Thank you for your prompt response.

Your solution didn’t work.
I attached my code so your can try it on your own device.

Best regards,

LaminatedFreqAnalysis.edp (3.5 KB) LaminatedGeometry.idp (4.8 KB)

Well, of course, in your post you use a Eh<complex> [Ax,Ay]; while in your code you use a Eh [wx,wy];

Sorry for my disorganized code.
I am a little bit confused about handling data in sol.

I defined and tried both Eh<complex> [Ax,Ay]; and Eh [wx,wy]; but none of these solutions worked for me:

[Ax[],Ay[]] = sol;
Ax[] = sol;
[wx[],wy[]] = sol;
wx[] = sol;

I can’t understand why your solution Ax[] = sol; does not work.

My solution work if you remove your remove your definition of [wx,wy].

Thank you again.

I guess there is an issue with definition of the problem since it encounters sth like ERROR UMFPACK status -5

That is indeed a different story :slight_smile:

It seems solving in matrix format using varf requires much more expertise than I thought.
I solved exactly the same problem using solve (which were commented on the attached file).

I think it would be better to simply give up :face_with_head_bandage: