With a raytracer this is a trivial problem, but with rasterization it sounds pretty complex, if not impossible.
As a fake solution, I suppose if you treat each pixel on the screen as an atom (a single, floating particle), then you could manipulate (twist, swirl, and stretch) those atoms around your gravity wells. Draw the scene once normally, then again to manipulate the frame buffer results in a fragment shader. You could calculate the distance of each pixel to the gravity well (whose positions are supplied as fragment parameters) and then given some time T (another parameter), you could project where the pixel should have been (distortion). This is very simple at best, with a lot of issues still to be addressed (such as missing gaps generated)