Hi-PACE / hipace

Highly efficient Plasma Accelerator Emulation, quasistatic particle-in-cell code
https://hipace.readthedocs.io
Other
51 stars 14 forks source link

Fix SALAME overloaded beam removal #1097

Closed AlexanderSinn closed 4 months ago

AlexanderSinn commented 4 months ago

Since #1090 changed the beam id format in hipace, the first 2^24 beam particles have id=0 according to the amrex IDWrapper. This breaks the id = -id to make the particle invalid. This PR fixes this by using is_valid and make_valid functions that only look at the first bit of the id and are compatible with both formats.