AngelFP / VisualPIC

Data Visualization for Particle-in-Cell Codes.
GNU General Public License v3.0
47 stars 13 forks source link

First, rough implementation of openPMD support for VisualPIC #7

Closed RemiLehe closed 6 years ago

RemiLehe commented 6 years ago

This is a quick implementation of openPMD support for VisualPIC.

The general idea is to use the light-weight package openPMD-viewer to access the data. This is in order to avoid duplicating a lot of code (for reading data, inferring dimension, etc.) which is already present in openPMD-viewer. While this drastically reduces the amount of code to be implemented in VisualPIC, it also adds an additional dependency.

The implementation creates multiple instances of OpenPMDTimeSeries (e.g. one per FieldDataReader and RawDataReader) which is not ideal: Each time one of these instance is created, the whole data folder is scanned over again, which can take some time. I used the option check_all_files=False which prevents openPMD-viewer from doing additional consistency checks between the different files corresponding to different time steps. That way, the folder scan is limited to the minimum (listing the files and getting the corresponding time and timesteps).

This implementation can be tested for instance with files from: https://github.com/openPMD/openPMD-example-datasets

Note that I removed the unimplemented stubs for PIConGPU and replaced them by the equivalent openPMD methods. (since PIConGPU now uses openPMD)

Also, sorry for all the empty white line suppression, which makes this PR slightly more difficult to read ; this is an automatic setting of my text editor that I forgot to turn off.

Here are few things that could be improved, through future pull requests:

RemiLehe commented 6 years ago

@AngelFP Please let me know if you would like me to change anything in the PR.

Also, since this is a very first and quick implementation, I expect that it might still contain a few bugs. However, these bugs might be best detected by starting to use VisualPIC with openPMD.

AngelFP commented 6 years ago

Hi @RemiLehe, thanks a lot for your work! I will check it out as soon as im back in Hamburg (around the 16th), since I'm now somewhere in the north of canada.

I would have liked to discuss about it on friday too, but i had to leave the conference a bit earlier than planned.

RemiLehe commented 6 years ago

No worries :) Enjoy your trip!

AngelFP commented 6 years ago

Hi everyone,

I've finally had some time to work on this and the 3D rendering problem with openPMD data should now be fixed. This is a quick render I made with the sample data from the link above: image

The 3D visualizer is still quite buggy in itself, but at least these bugs should be independent of the data source. ;)

The other mentioned issues still remain, and of particular importace is the implementation of a way of reading data units from the files. Until then, some data might be displayed incorrectly or the unit conversion might fail.

For the moment, since this is only a preliminary implementation of openPMD support, I'll merge this pull request.

RemiLehe commented 6 years ago

This is great! Thanks a lot for your work on this @AngelFP! The 3D picture looks fantastic!

ax3l commented 6 years ago

Yay, wonderful!