loading particles from openpmd
I am trying to load particles from an openpmd file. I got an error message saying that key 'positionOffset' does not exist (read-only).
Pull #3810 (https://github.com/ECP-WarpX/WarpX/pull/3810) mentioned something about adding the quantity positionOffset, but there is nothing in the documentation for input parameters. It would be great if I could get an example script to generate the input openpmd file for particle initialisation.
I have figure out how the positionOffset parameter works. It is also requesting the 'weighting' parameter from the openpmd file. I am not sure what is the definition of this parameter in WarpX and what is the dimension.
Is it just suppose to be an array of ones for equally weighted particles? The charge parameter already specifies the amount of charge corresponding to each macroparticle. I am not sure what the weighting parameter defines.
Thanks for the question @rl3418 The weighting is related to the fact that PIC simulations use "macroparticles" instead of physical particles. Its definition is given in this document for instance: https://github.com/openPMD/openPMD-standard/blob/latest/EXT_ED-PIC.md Let us know if you have any further question.
So <species_name>.charge is the charge of each physical particle, and the weighting is the number of physical particles represented by each macroparticle. Could you confirm if that is correct?
Hi @rl3418
That is correct. Additionally, note that velocities are provided in openPMD output as u = v / c, where c is the speed of light, v is the particle velocity in SI units. See https://github.com/ECP-WarpX/WarpX/issues/4891 for more info.