I'm not entirely sure this is the right place to ask this sort of question, but still. I have a problem with plotting 3D simulation data that I get with SPH. Basically, I want to be able to plot a 'slice' of the computational domain at z = 0. To do that I generate sort of a eulerian grid and interpolate particle data (density, energy, vector components, etc.) on the grid nodes using SPH approximation.
This way I can plot 2D color maps of data (like the density distribution) with gnuplot (since it sort of requires a mesh to do that).
However the density plot seems to be only accurate for the initial conditions (in my case it's a sphere of gas made up of uniformly spaced particles with equal mass). As particle move the mesh seems to get severe spikes in density in the central region (it's a collapsing cloud). Increasing mesh resolution doesn't help. I tried moving the interpolation points with the flow to account for changes in particle density but it didn't help.
I feel like the spacing of those interpolation points must somehow change with the changing spacing/smoothing length of particles, but I don't know how. Also that would probably make "the mesh" unsuitable for the pm3d command in gnuplot.
I don't know.