WarpX
Loading...
Searching...
No Matches
UpdatePosition.H File Reference
#include "Utils/WarpXConst.H"
#include <AMReX.H>
#include <AMReX_FArrayBox.H>
#include <AMReX_REAL.H>

Go to the source code of this file.

Functions

AMREX_GPU_HOST_DEVICE AMREX_INLINE void UpdatePosition (amrex::ParticleReal &x, amrex::ParticleReal &y, amrex::ParticleReal &z, const amrex::ParticleReal ux, const amrex::ParticleReal uy, const amrex::ParticleReal uz, const amrex::Real dt, amrex::ParticleReal const mass)
 Push the particle position over one time step, given the value of its momenta ux, uy, uz, using the standard leapfrog algorithm x(t+dt) = x(t) + v(t+dt/2)*dt.
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal GetImplicitGammaInverse (const amrex::ParticleReal uxp_n, const amrex::ParticleReal uyp_n, const amrex::ParticleReal uzp_n, const amrex::ParticleReal uxp_nph, const amrex::ParticleReal uyp_nph, const amrex::ParticleReal uzp_nph) noexcept
 Compute the inverse Lorentz factor for the position update in the implicit methods, which is the average of gamma at time levels n and n+1.
 
AMREX_GPU_HOST_DEVICE AMREX_INLINE void UpdatePositionImplicit (amrex::ParticleReal &x, amrex::ParticleReal &y, amrex::ParticleReal &z, const amrex::ParticleReal ux_n, const amrex::ParticleReal uy_n, const amrex::ParticleReal uz_n, const amrex::ParticleReal ux, const amrex::ParticleReal uy, const amrex::ParticleReal uz, const amrex::Real dt)
 Push the particle's positions over one timestep, given the value of its momenta ux, uy, uz. The implicit version is the Crank-Nicolson scheme, x^{n+1} - x^{n} = dt*(u^{n+1} + u^{n})/(gamma^{n+1} + gamma^{n}) See Eqs. 15 and 17 in Chen, JCP 407 (2020) 109228.
 
AMREX_GPU_HOST_DEVICE AMREX_INLINE void PositionNorm (const amrex::ParticleReal dxp, const amrex::ParticleReal dyp, const amrex::ParticleReal dzp, const amrex::ParticleReal dxp_save, const amrex::ParticleReal dyp_save, const amrex::ParticleReal dzp_save, const amrex::ParticleReal idxg2, const amrex::ParticleReal idyg2, const amrex::ParticleReal idzg2, amrex::ParticleReal &step_norm)
 Check particle position for convergence. This is used by the Picard method used to achieve a self-consistent time-centered update of the particles for given electric and magnetic fields on the grid.
 

Function Documentation

◆ GetImplicitGammaInverse()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal GetImplicitGammaInverse ( const amrex::ParticleReal uxp_n,
const amrex::ParticleReal uyp_n,
const amrex::ParticleReal uzp_n,
const amrex::ParticleReal uxp_nph,
const amrex::ParticleReal uyp_nph,
const amrex::ParticleReal uzp_nph )
noexcept

Compute the inverse Lorentz factor for the position update in the implicit methods, which is the average of gamma at time levels n and n+1.

◆ PositionNorm()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void PositionNorm ( const amrex::ParticleReal dxp,
const amrex::ParticleReal dyp,
const amrex::ParticleReal dzp,
const amrex::ParticleReal dxp_save,
const amrex::ParticleReal dyp_save,
const amrex::ParticleReal dzp_save,
const amrex::ParticleReal idxg2,
const amrex::ParticleReal idyg2,
const amrex::ParticleReal idzg2,
amrex::ParticleReal & step_norm )

Check particle position for convergence. This is used by the Picard method used to achieve a self-consistent time-centered update of the particles for given electric and magnetic fields on the grid.

◆ UpdatePosition()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void UpdatePosition ( amrex::ParticleReal & x,
amrex::ParticleReal & y,
amrex::ParticleReal & z,
const amrex::ParticleReal ux,
const amrex::ParticleReal uy,
const amrex::ParticleReal uz,
const amrex::Real dt,
amrex::ParticleReal const mass )

Push the particle position over one time step, given the value of its momenta ux, uy, uz, using the standard leapfrog algorithm x(t+dt) = x(t) + v(t+dt/2)*dt.

◆ UpdatePositionImplicit()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void UpdatePositionImplicit ( amrex::ParticleReal & x,
amrex::ParticleReal & y,
amrex::ParticleReal & z,
const amrex::ParticleReal ux_n,
const amrex::ParticleReal uy_n,
const amrex::ParticleReal uz_n,
const amrex::ParticleReal ux,
const amrex::ParticleReal uy,
const amrex::ParticleReal uz,
const amrex::Real dt )

Push the particle's positions over one timestep, given the value of its momenta ux, uy, uz. The implicit version is the Crank-Nicolson scheme, x^{n+1} - x^{n} = dt*(u^{n+1} + u^{n})/(gamma^{n+1} + gamma^{n}) See Eqs. 15 and 17 in Chen, JCP 407 (2020) 109228.