Skip to content

Commit

Permalink
Update Source/Particles/PhysicalParticleContainer.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Remi Lehe <[email protected]>
  • Loading branch information
aeriforme and RemiLehe authored Feb 22, 2024
1 parent 33e6123 commit 179321a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Particles/PhysicalParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ PhysicalParticleContainer::AddGaussianBeam (
Real v_dot_n = v_x * n_x + v_y * n_y + v_z * n_z;
Real t = ((x_f-x)*n_x + (y_f-y)*n_y + (z_f-z)*n_z) / v_dot_n;

// Displace particles in the direction orthogonal to the beam bulk momentum
// i.e. orthogonal to (n_x, n_y, n_z)
#if defined(WARPX_DIM_3D) || defined(WARPX_DIM_RZ)
x = x - (v_x - v_dot_n*n_x) * t;
y = y - (v_y - v_dot_n*n_y) * t;
Expand Down

0 comments on commit 179321a

Please sign in to comment.