ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
309 stars 195 forks source link

Rigid injection: Center field scaling around the v push #5389

Closed RemiLehe closed 2 weeks ago

RemiLehe commented 1 month ago

In the rigid injection, the fields where scale by the fraction of time spent between n*dt and (n+1)*dt to the right of the injection plane. However, to be consistent with the leap-frog velocity update, this needs to be between (n-1/2)*dt and (n+1/2)*dt instead.

As a side-effect of this PR, saving and re-setting u and optical_depth to their original value is not needed anymore since the scaling factor for E and B is 0 for particles to the left of the plane.