MHD in divergence form : a computational method for astrophysical flow