# How to Calculate magnetic and electric field in 2D Magnetotelluric using Edge based Finite Element

I calculate 2D Model of Magnetotelluric responses which are apparent resistivity and phase. I do the calculation for Transverse Electric (TE) mode. Then I used edge based finite element with triangular element. When using finite element there are no problems till I get the result of the finite element calculation. I get the magnetic field (H) value from the calculation using edge based finite element. But I don't know how I can get the y-component (Hy) and x-component (Hz) of the magnetic field resulted from finite element?. And how I can calculate the electric field (E) from the magnetic field resulted from finite element?. Here I give the equation of H which I solve using finite element and E.

• It's not clear from your question what exactly the problem is. You seem to be calculating the solution $H$ of the problem using finite elements. This $H$ is a vector-valued field $\vec H(\vec x)$. To get its components, you just need to take the second and third element of the vector. Or do I misunderstand what the issue is? Commented Jul 23, 2021 at 18:31
• This is not my strong suite, but, I believe @yihaa means he got a scalar. In my limited knowledge, I believe that with Edge FEM the unusual thing is that the basis functions are vector oriented. I think you are just looking at the coefficient you solved for, and you need to construct $\vec{H} = H_i \vec{N}_i$. How you do that in whatever software you are using, I don't know. Commented Jul 23, 2021 at 22:08
• @WolfgangBangerth thank you for your answer. Well, I calculate the solution of H using edge based finite element for the first equation. Then I get the H value as a scalar just like Mikael Öhman said. There are H of the edge 1, H of the edge 2 and H of the edge 3 for each element. I need to know the y-component of H and x-component of H to calculate the second equation. Commented Jul 24, 2021 at 11:25
• @MikaelÖhman thank you for your answer. And I just did like you said that is $H^{e}=\sum_{i=1}^{3}(H_{i}^{e}N_{i}^{e})$ for each element. But I am confused with the N equation. Is it based on the basis function that I used?. Then after that, How can I calculate the second equation of my question to determine the E value? Commented Jul 24, 2021 at 11:25
• As I've understood it, edge based FEM, quoting a old text i googled: "The basis functions associated with the edges are vector functions. Thus edge elements are vector oriented." which is necessary for eletromagnetics due to continuity constraints. But I never actually studied an implementation so I've got no concrete recommendations here. Commented Jul 24, 2021 at 11:33

Disclaimer: I'm outside my area of expertise here.

Due to continuity constraints, when solving electromagnetic simulations with FEM, one uses edge based vector basis functions.

After solving, I would expect you to construct your solution field $$\vec{H}(x) = \sum_i H_i \vec{N}_i(x)$$ or, element-wise $$\vec{H}(x) = \sum_i H^e_i \vec{N}^e_i(x) \quad\forall x \in V_e$$ Note the $$\vec{\bullet}$$ which I use to indicate that it is a vector quantity. This is one source of confusion in your question, as you are referring to $$H$$, which, as you can see above, doesn't exist. If you have already managed to construct your (vector) $$\vec{H}$$ for the region you are interested in, then it is already a vector with 3 components, so just pick the one you want.

For your second question, you, note that this quantity is already evaluated inside your original equation! $$\nabla \times \underbrace{(\frac{1}{\sigma} \nabla \times \vec{H})}_{=\vec{E}} + i\omega\mu_0 \vec{H} = \vec{0}$$

Depending on how the finite element code is implemented, you may values of $$\vec{E}$$ or $$\nabla\times\vec{H}$$ stored in the integration points of your element. But, they are also simple to re-compute from a given solution, since we now know $$\vec{H}(x)$$ after all. $$\sigma\vec{E} = \nabla\times\vec{H} = \sum_i H_i (\nabla\times\vec{N}_i)$$

Since this is used to solve the FE-system , you should be able to locate this somewhere in your solver code, often named "B", e.g. $$\vec{B}_i = \nabla\times\vec{N}_i$$ which you can use to construct $$\vec{E}(x) = \frac{1}{\sigma}\sum_i H_i \vec{B}_i(x)$$ or, element-wise $$\vec{E}(x) = \sum_i H^e_i \vec{B}^e_i(x) \quad\forall x \in V_e$$

• thank you for your explanation. I needed time to understand it but now I understand it. You explain it clearly. The point is that I have to use my basis function $\vec{N}$ to get the $\vec{H}$ value and this $\nabla\times\vec{N}$ to get $\vec{E}$ value, is it right??. I think I will try it to my codes. Hopefully, I could get the result that it should be. I really appreciate your help. Thank you very much. Commented Jul 25, 2021 at 14:55
• Yes. You should already be doing all of these computations somewhere when integrating over the elements. When solving heat transfer or mechanical FE-problems, the "gradient/strain" ($\approx \nabla \times \vec{H}$ here) and "flux/stress" ($\approx \vec{E}$ here) are typically stored in the integration points as one solves the problem, so if you have that, you don't need to recompute anything. I'm not sure if such a strategy is common for electromagnetics though. Commented Jul 25, 2021 at 15:02
• I'm not really sure too but I think the concept of FE should be the same. When it comes to the nodal element the value stored in the node and when it comes to the edge element the value stored in the edge. That I know for sure is that in electromagnetics the FE result is very sensitive with the mesh that is used. Commented Jul 25, 2021 at 16:00
• I believe you are confusing the primary field (e.g. displacements, temperatures, magnetic field) that are interpolated using the basis functions and the unknowns we directly solve for. But there are also internal fields (e.g. strain, stress, heat flux) which are stored for each integration points used during the numerical integration of the weak form. The same could be present here, unless electromagnetics also require something similar to a mixed formulation (like with partial stress-control FEM used for incompressibility). Commented Jul 25, 2021 at 16:10