I talked with many other modeleres, and none of them is solving a new finite element problem for obtaining magnetic fields H from electric fields E during postprocessing in electromagnetic modeling.
The documentation says that we need to solve a new FE system, either using the “project” command or formulating the new system manually. That’s what I’m doing for a long time and it works, but it requires about 30% of the solution time of the main E-field system. There is also no need for me to calculate the H-fields in the complete mesh, I need them only at some coordinates.
Hence, I’d like to evaluate the curl manually within elements, but I have no clue how to start.
I think you are proposing interpolation of \nabla \times E. It’s worth noting by Céa’s lemma: the projection of a function onto an FE space is the best approximation of that function in that FE space. Interpolation will introduce additional interpolation error.
In terms of advice for achieving what you want:
I’m not sure how to implement direct interpolation in a simple manner.
To improve performance of projection you can assemble the problem: find H_h \in V^h
(H_h, G) = (\nabla \times E, G) \quad \forall G \in V^h,
where V^h is an appropriate FE space.
Note that this problem is linear, and you need only assemble the mass matrix once. Furthermore, if your problem is small enough, once you’ve computed the LU factorisation of the mass matrix, you can reuse it, greatly improving successive solve times.
Finally, if you only need to compute this problem on a subdomain of your total domain, you can choose V^h to be an appropriate DG space. Making this choice means that you only need to solve the local contributions of each element in the projection operation. No global solve is required. DOLFIN has LocalAssembler and LocalSolver classes for this purpose. This also means that you can compute the projection on a subdomain in a straightforward manner.