Kassiopeia
Kassiopeia copied to clipboard
Enhancement: Implementation of FastMultipole method also for magnetostatic problems.
Currently magnetostatic problems are either solved using zonal harmonics (if the geometry is cylinder symmetric) or has to be solved using numerical integration of the Biot-Savart law (for all non cylinder symmetric setups). For sufficient complex current / wire distributions the numerical integration of the Biot-Savart law is a major bottleneck at run time as for each particle step the magnetic field has to be reevaluated including the numerical integration over all wires.
For electrostatic fields the FastMultipole method was implemented that allows to precompute boundary charges on a surface and using a tree representation for fast evaluation at run time. The method is based on the fact that the volume of interest is charge free and thus the E field is divergent and curl free and thus can be described by a potential that has to fulfill the Laplace equation.
For magnetic fields we usually are also interested in the current free region (we are not tracking particles through wires) and thus the magnetic field is divergent and curl free and can also be described by a potential that has to fulfill the Laplace equation.
Thus we can make use of the same mathematical description as in the case of electromagnetic problems which are described by a set of surface charges sigma_i on an enclosing surface. For electrostatic fields the surface charges have to be derived from Direchlet and Neuman boundary conditions. The surface charges are given by sigma(r') = - eps_0 normal(surface) * grad(potential(r')) . We can make use of -grad(potential(r')) = B(r') and thus can directly calculate sigma(r') = const * normal(surface) * B(r'). In this case we can calculate B(r') using the Biot-Savart law at initialization time to get the surface charges and the FastMultipole representation. This has a speed up because 1. we have to evaluate B(r') only at a surface and not for the full volume, 2. we only do it at initialization time once and not at every particle step and 3. we can save the representation for other executions.
Implementation: We need a new class for magnetostatic problems what calculates "pseudo" surface charges using the Biot-Savart integration (which is already implemented). Based on the "pseudo" surface charges we generate the tree representation of the FastMultipole method (already implemented) and at runtime we use the FastMultipole method (already implemented) also for magnetic fields. Thus implementation is basically the work of writing wrapper functions to already existing tools.