Searching for an appropriate File format for a PIC simulation

Hello :slight_smile:

I want to play around with some plasma simulations → PIC
Therefore I am considering ParaView as a result viewer.
Not my questions is, what would be the best file formate to save my data?

It needs to support simple 2D meshes for the magnetic and electric field. Both are time dependent.
Additionally, i need to store a lot of particles (ions and electrons) with their positions and velocities over time.

Would you suggest to use plain .csv?
Since I have not yet worked with ParaView, i hope the answers provide a great starting point :slight_smile:

Hi @olgidos ,

No.

Any geometrical format would work, the question is which format can you export to ?

Best,

Hi @olgidos, I use hdf5 format to save my data from PIC simulation and view it through paraview. It works neat.

Hello both, thanks for your replies!

  1. I can fully decide which format I can use, so no restrictions there

  2. I did now tried using .vtk file and seems to work already great good for field information, particle are not yet stored. Are there any advantages of hdf5 over vtk? :slight_smile:

Hi @olgidos,

I would say there are some advantages to using the hdf5 framework in general: IO speed, built-in read and write parallelism and data flexibility. Here is a relatively detailed post on the benefits of hdf5 I found on stack overflow: https://stackoverflow.com/questions/27710245/is-there-an-analysis-speed-or-memory-usage-advantage-to-using-hdf5-for-large-arr

However, hdf5 is less of a file format than a file encoding. The analogy for csv files is that csv is the format but the files are usually encoded as text files. The hdf5 encoding corresponds to the text file in this comparison.

That being said, here is a VTKHDF file specification that is relatively new that could interest you: https://vtk.org/doc/nightly/html/VTKHDFFileFormat.html.

Hope that helps!

Best regards,

Julien

1 Like

Hallo Julien,

Thank you for all the information! I will have a look. :slight_smile:
Storage in binary format is probably needed in the future when working with larger datasets.

1 Like