Divergence-free Interpolation

Colin P. McNally

Email: colin AT colinmcnally dot ca

You might have been lead to this page by a search while trying to find my main website at www.colinmcnally.ca.

This is the code which accompanies the paper "Divergence-free interpolation of vector fields from point values - exact div B=0 in numerical simulations". It runs in Python 2.6 with the matplotlib and numpy packages, but should work on similar versions of Python. The code has been designed to be simple and minimal, so that the reader can approeciate that the radial basis function based method is conceptually no more compicated than Taylor-series based finite-difference approaches. A consequence of these design choices is that the demonstration code here is utterly unsuited to solving any real astrophysical problems.

07/06/2011 - Lauri Perkkio has brough to my attention a typo in equation 7, where the expression for phi_12 is missing a factor of xy. You can see the correct expression in line 87 of the file rbfvmod.py in the sample code.

Back to my main website at www.colinmcnally.ca.