Hi-PACE / hipace

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

Fix boundary conditions #1064

Closed AlexanderSinn closed 2 months ago

AlexanderSinn commented 9 months ago

This PR removes geometry.is_periodic, fields.extended_solve and fields.open_boundary and replaces them with boundary.field = Dirichlet/Periodic/Open, boundary.particle = Reflecting/Periodic/Absorbing, boundary.particle_lo and boundary.particle_hi. Additionally, some boundary related bugs are fixed such as incorrectly using FillBoundary instead of SumBoundary, some noise developing from the level 1 boundary with MR and the boundary condition not being applied to beam particles after they are initialized.

Test with many plasma wavelength, MR at -10:10 and a beam radius of 7. This PR significantly reduces the noise from MR, however there is a little bit remaining around -1e3:-12/12. PR: image Dev: image