I always wanted to look into visualizing all my fancy simulations. Never had the time, nor the motivation to do so. Until last night, at least with respect to the motivation, time I still don't have, but, oh well... I started to read up on how
POV-Ray supports volumetric density media. Paul Bourke has a
very nice article on that topic, which basically explains everything I needed. So the only thing that I need to do is to read all the particles from the simulation snapshot and put them on a grid. In a first approximation I used a cloud in cell (CIC) prescription, which means that a particle gives it's mass only to the cell it is located in, to calculate the density field. Once that density field is converted to a suitable binary file all that it is left to do is to write a really small POV-Ray scene. I basically used the MRI example from Paul's page to construct my scene and have a first working colour map (the tricky part).
And 'lo and behold, that is what I got (click for larger pop-up):
Not too bad. I need to play around with the colour map though to highlight the structure better. But already in this rough first attempt you can nicely see the filamentary and clumpy structure of the matter distribution. It is good to have a potent machine to do that on though. The density field is generated from 512³ particles (that is, 134 and a bit million). The raw particle data is already 4GB, the resulting density field (16bit dynamical range) 1GB since I used 800³ grid cells. The actually rendering was quite fast, 5 minutes on a normal P4 desktop machine.