hamed
(hamed)
June 30, 2020, 9:57am
#1
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.

prj
June 30, 2020, 9:59am
#2
Try this instead. `Ax[] = sol;`

hamed
(hamed)
June 30, 2020, 10:07am
#3
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,
Hamed

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

prj
June 30, 2020, 10:10am
#4
Well, of course, in your post you use a `Eh<complex> [Ax,Ay];`

while in your code you use a `Eh [wx,wy];`

…

hamed
(hamed)
June 30, 2020, 10:21am
#5
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.

prj
June 30, 2020, 10:56am
#6
My solution work if you remove your remove your definition of `[wx,wy]`

.

hamed
(hamed)
June 30, 2020, 11:18am
#7
Thank you again.

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

prj
June 30, 2020, 11:23am
#8
That is indeed a different story

hamed
(hamed)
June 30, 2020, 11:37am
#9
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