A demonstration package for Divergence-free Interpolation

Colin P. McNally 2010, 2011, 2019
colin at


Divergence-free interpolation of vector fields from point values - exact div(B)= 0 in numerical simulations
McNally, Colin P.
Monthly Notices of the Royal Astronomical Society: Letters, Volume 413, Issue 1, pp. L76-L80.

This code is not very fast, it's here to show you how things can be done.
This code is released under GPLv3-or-later.

The files here will do the Alfven wave problem as set up, and you can play with other things.
The numerical method actually implemented isn't good for much research, the point it to 
demonstrate by construction that divergence-free interpolation stencils can be used for MHD.

The visualization commands in will pop up a window the refreshes the plots on each time step.