warpx icon indicating copy to clipboard operation
warpx copied to clipboard

loading particles from openpmd

Open rl3418 opened this issue 1 year ago • 3 comments

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.

rl3418 avatar May 24 '24 09:05 rl3418

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.

rl3418 avatar May 24 '24 10:05 rl3418

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.

RemiLehe avatar May 24 '24 12:05 RemiLehe

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?

rl3418 avatar May 24 '24 15:05 rl3418

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.

archermarx avatar May 28 '24 20:05 archermarx