[Paraview] Particle trajectories with Paraview
Biddiscombe, John A.
biddisco at cscs.ch
Thu Feb 11 10:44:54 EST 2010
Alex, (I'm cc'ing this back to the list as similar questions crop up from time to time)
> I have a charged particle simulation code and I would like to visualize the
> resulting particle trajectories (basically positions in 3D) in Paraview. The
> attached CSV-file contains some sample data, columns have the following
> meaning:
> Field 0: Unique particle ID
> Field 1: Parent particle ID
> Field 2: Generation
> Field 3: Energy
> Field 4: X position
> Field 5: Y position
> Field 6: Z position
> Field 7: X direction cosine
> Field 8: Y direction cosine
> Field 9: Z direction cosine
The pathline filter (vtkTemporalPathLineFilter) is intended to operate on a series of particles, say N of them. At timestep t, It generates a point representing each particle and stores it. Then the next time step arrives at t+1 and the pathline filter extends the (polyline) pathline to the new position, it incrementally builds up pathlines as you animate through a dataset.
What you have got, is 'all' the timesteps inside one file, so it's not a 'temporal' data format (if you follow me).
Question :
Is the original data stored as complete paths like the csv file you attached, or does the simulation generate one file per step? If it generates one file per step and you have collated it all into a csv file, then we can ...
a) go back to the original data and knock up a reader which loads them one at a time and updates in a 'temporal' way - reading particles one step at a time - this creates nice animations in paraview with the trails incrementing as the particles move. The length of trail can be adjusted and each trail can be coloured nicely. If you store your data in h5part or some other format that is supported well by paraview, then even better.
b) Load the csv file as you have done and generate polylines from the disjoint particles using the ID as a key. I have a csv reader I wrote a few years back which could be tweaked to do this (it assumes successive points are part of the same line - so it'd need a bit of work to recognize the Ids in your data). I don't think there's a filter already in paraview like 'table to points' (or vice versa) which will convert the points into polylines as you require.
I would recommend a) and as you're from ETHZ I can help you with it. However I'm away all next week, so don't get your hopes up too high.
JB
--
John Biddiscombe, email:biddisco @ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
More information about the ParaView
mailing list