aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/Pusher/UpdatePositionPhoton.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/Pusher/UpdatePositionPhoton.H')
-rw-r--r--Source/Particles/Pusher/UpdatePositionPhoton.H12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Particles/Pusher/UpdatePositionPhoton.H b/Source/Particles/Pusher/UpdatePositionPhoton.H
index 0fba0e234..ce3203a58 100644
--- a/Source/Particles/Pusher/UpdatePositionPhoton.H
+++ b/Source/Particles/Pusher/UpdatePositionPhoton.H
@@ -13,15 +13,15 @@ void UpdatePositionPhoton(
const amrex::Real ux, const amrex::Real uy, const amrex::Real uz,
const amrex::Real dt )
{
- // Compute inverse of momentum modulus
- const amrex::Real inv_u_mod = 1./std::sqrt(1. + (ux*ux + uy*uy + uz*uz));
-
+ // Compute speed of light over inverse of momentum modulus
+ const amrex::Real c_over_umod = PhysConst::c/std::sqrt(ux*ux + uy*uy + uz*uz);
+
// Update positions over one time step
- x += ux * inv_u_mod * dt;
+ x += ux * c_over_umod * dt;
#if (AMREX_SPACEDIM == 3) || (defined WARPX_DIM_RZ) // RZ pushes particles in 3D
- y += uy * inv_u_mod * dt;
+ y += uy * c_over_umod * dt;
#endif
- z += uz * inv_u_mod * dt;
+ z += uz * c_over_umod * dt;
}