# Dispatching RT0 components from sol

**URL:** https://community.freefem.org/t/dispatching-rt0-components-from-sol/485
**Category:** General Discussion
**Created:** [June 30, 2020, 9:57am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485 "2020-06-30T09:57:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://community.freefem.org/u/hamed)
#### Post date: [June 30, 2020, 9:57am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/1 "2020-06-30T09:57:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [June 30, 2020, 9:59am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/2 "2020-06-30T09:59:22Z")

</div>

Try this instead. `Ax[] = sol;`

---

<div class="post-metadata">

### Author: ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://community.freefem.org/u/hamed)
#### Post date: [June 30, 2020, 10:07am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/3 "2020-06-30T10:07:10Z")

</div>

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](https://community.freefem.org/uploads/short-url/o2JEbWICB6bj8a9szqSmKsYrKZ5.edp) (3.5 KB) [LaminatedGeometry.idp](https://community.freefem.org/uploads/short-url/yTT9oN8Ogltz3D82tZ387eFHFmO.idp) (4.8 KB)

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [June 30, 2020, 10:10am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/4 "2020-06-30T10:10:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://community.freefem.org/u/hamed)
#### Post date: [June 30, 2020, 10:21am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/5 "2020-06-30T10:21:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [June 30, 2020, 10:56am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/6 "2020-06-30T10:56:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://community.freefem.org/u/hamed)
#### Post date: [June 30, 2020, 11:18am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/7 "2020-06-30T11:18:10Z")

</div>

Thank you again.

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

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [June 30, 2020, 11:23am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/8 "2020-06-30T11:23:17Z")

</div>

That is indeed a different story 🙂

---

<div class="post-metadata">

### Author: ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://community.freefem.org/u/hamed)
#### Post date: [June 30, 2020, 11:37am UTC](https://community.freefem.org/t/dispatching-rt0-components-from-sol/485/9 "2020-06-30T11:37:39Z")

</div>

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 🤕
