Hipace
Functions
FieldGather.H File Reference
#include "particles/particles_utils/ShapeFactors.H"
#include "utils/GPUUtil.H"
#include <AMReX.H>

Go to the source code of this file.

Functions

template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherShapeN (const amrex::Real xp, const amrex::Real yp, amrex::Real &ExmByp, amrex::Real &EypBxp, amrex::Real &Ezp, amrex::Real &Bxp, amrex::Real &Byp, amrex::Real &Bzp, Array3< amrex::Real const > const &slice_arr, const int psi_comp, const int ez_comp, const int bx_comp, const int by_comp, const int bz_comp, const amrex::Real dx_inv, const amrex::Real dy_inv, const amrex::Real x_pos_offset, const amrex::Real y_pos_offset)
 Field gather for a single particle. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherShapeN (const amrex::ParticleReal xp, const amrex::ParticleReal yp, amrex::ParticleReal &ExmByp, amrex::ParticleReal &EypBxp, amrex::ParticleReal &Ezp, amrex::ParticleReal &Bxp, amrex::ParticleReal &Byp, amrex::ParticleReal &Bzp, Array3< amrex::Real const > const &slice_arr, const int psi_comp, const int ez_comp, const int bx_comp, const int by_comp, const int bz_comp, const amrex::Real dx_inv, const amrex::Real dy_inv, const amrex::Real x_pos_offset, const amrex::Real y_pos_offset, const int depos_order_xy)
 Field gather for a single particle. More...
 
template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doBxByGatherShapeN (const amrex::Real xp, const amrex::Real yp, amrex::Real &Bxp, amrex::Real &Byp, Array3< amrex::Real const > const &slice_arr, const int bx_comp, const int by_comp, const amrex::Real dx_inv, const amrex::Real dy_inv, const amrex::Real x_pos_offset, const amrex::Real y_pos_offset)
 Field gather for a single particle of just Bx and By. More...
 
template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doLaserGatherShapeN (const amrex::Real xp, const amrex::Real yp, amrex::Real &Aabssqp, amrex::Real &AabssqDxp, amrex::Real &AabssqDyp, Array3< amrex::Real const > const &a_arr, const amrex::Real dx_inv, const amrex::Real dy_inv, const amrex::Real x_pos_offset, const amrex::Real y_pos_offset)
 Laser field gather for a single particle. More...
 
template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doLaserGatherShapeN (const amrex::Real xp, const amrex::Real yp, amrex::Real &Aabssqp, Array3< amrex::Real const > const &a_arr, const amrex::Real dx_inv, const amrex::Real dy_inv, const amrex::Real x_pos_offset, const amrex::Real y_pos_offset)
 Laser field gather for a single particle. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherEz (const amrex::Real xp, const amrex::Real yp, amrex::Real &Ezp, Array3< amrex::Real const > const &slice_arr, const int ez_comp, const amrex::Real dx_inv, const amrex::Real dy_inv, const amrex::Real x_pos_offset, const amrex::Real y_pos_offset)
 

Function Documentation

◆ doBxByGatherShapeN()

template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doBxByGatherShapeN ( const amrex::Real  xp,
const amrex::Real  yp,
amrex::Real &  Bxp,
amrex::Real &  Byp,
Array3< amrex::Real const > const &  slice_arr,
const int  bx_comp,
const int  by_comp,
const amrex::Real  dx_inv,
const amrex::Real  dy_inv,
const amrex::Real  x_pos_offset,
const amrex::Real  y_pos_offset 
)

Field gather for a single particle of just Bx and By.

Template Parameters
depos_order_xyOrder of the transverse shape factor for the field gather
Parameters
[in]xpParticle position x
[in]ypParticle position y
[in,out]BxpMagnetic field on particles: Bx
[in,out]BypMagnetic field on particles: By
[in]slice_arrslice array for WhichSlice::This
[in]bx_compfield array for field Bx
[in]by_compfield array for field By
[in]dx_invinverse cell spacing in x direction
[in]dy_invinverse cell spacing in y direction
[in]x_pos_offsetoffset for converting positions to indexes
[in]y_pos_offsetoffset for converting positions to indexes

◆ doGatherEz()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherEz ( const amrex::Real  xp,
const amrex::Real  yp,
amrex::Real &  Ezp,
Array3< amrex::Real const > const &  slice_arr,
const int  ez_comp,
const amrex::Real  dx_inv,
const amrex::Real  dy_inv,
const amrex::Real  x_pos_offset,
const amrex::Real  y_pos_offset 
)

◆ doGatherShapeN() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherShapeN ( const amrex::ParticleReal  xp,
const amrex::ParticleReal  yp,
amrex::ParticleReal &  ExmByp,
amrex::ParticleReal &  EypBxp,
amrex::ParticleReal &  Ezp,
amrex::ParticleReal &  Bxp,
amrex::ParticleReal &  Byp,
amrex::ParticleReal &  Bzp,
Array3< amrex::Real const > const &  slice_arr,
const int  psi_comp,
const int  ez_comp,
const int  bx_comp,
const int  by_comp,
const int  bz_comp,
const amrex::Real  dx_inv,
const amrex::Real  dy_inv,
const amrex::Real  x_pos_offset,
const amrex::Real  y_pos_offset,
const int  depos_order_xy 
)

Field gather for a single particle.

Parameters
[in]xpParticle position x
[in]ypParticle position y
[in,out]ExmBypField on particle: Ex - c*By
[in,out]EypBxpField on particle: Ey + c*Bx
[in,out]EzpField on particle: Ez
[in,out]BxpMagnetic field on particles: Bx
[in,out]BypMagnetic field on particles: By
[in,out]BzpMagnetic field on particles: Bz
[in]slice_arrslice array for WhichSlice::This
[in]psi_compfield component for field Psi
[in]ez_compfield array for field Ez
[in]bx_compfield array for field Bx
[in]by_compfield array for field By
[in]bz_compfield array for field Bz
[in]dx_invinverse cell spacing in x direction
[in]dy_invinverse cell spacing in y direction
[in]x_pos_offsetoffset for converting positions to indexes
[in]y_pos_offsetoffset for converting positions to indexes
[in]depos_order_xyOrder of the transverse shape factor for the field gather

◆ doGatherShapeN() [2/2]

template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherShapeN ( const amrex::Real  xp,
const amrex::Real  yp,
amrex::Real &  ExmByp,
amrex::Real &  EypBxp,
amrex::Real &  Ezp,
amrex::Real &  Bxp,
amrex::Real &  Byp,
amrex::Real &  Bzp,
Array3< amrex::Real const > const &  slice_arr,
const int  psi_comp,
const int  ez_comp,
const int  bx_comp,
const int  by_comp,
const int  bz_comp,
const amrex::Real  dx_inv,
const amrex::Real  dy_inv,
const amrex::Real  x_pos_offset,
const amrex::Real  y_pos_offset 
)

Field gather for a single particle.

Template Parameters
depos_order_xyOrder of the transverse shape factor for the field gather
Parameters
[in]xpParticle position x
[in]ypParticle position y
[in,out]ExmBypField on particle: Ex - c*By
[in,out]EypBxpField on particle: Ey + c*Bx
[in,out]EzpField on particle: Ez
[in,out]BxpMagnetic field on particles: Bx
[in,out]BypMagnetic field on particles: By
[in,out]BzpMagnetic field on particles: Bz
[in]slice_arrslice array for WhichSlice::This
[in]psi_compfield component for field Psi
[in]ez_compfield array for field Ez
[in]bx_compfield array for field Bx
[in]by_compfield array for field By
[in]bz_compfield array for field Bz
[in]dx_invinverse cell spacing in x direction
[in]dy_invinverse cell spacing in y direction
[in]x_pos_offsetoffset for converting positions to indexes
[in]y_pos_offsetoffset for converting positions to indexes

◆ doLaserGatherShapeN() [1/2]

template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doLaserGatherShapeN ( const amrex::Real  xp,
const amrex::Real  yp,
amrex::Real &  Aabssqp,
amrex::Real &  AabssqDxp,
amrex::Real &  AabssqDyp,
Array3< amrex::Real const > const &  a_arr,
const amrex::Real  dx_inv,
const amrex::Real  dy_inv,
const amrex::Real  x_pos_offset,
const amrex::Real  y_pos_offset 
)

Laser field gather for a single particle.

Template Parameters
depos_order_xyOrder of the transverse shape factor for the field gather
Parameters
[in]xpParticle position x
[in]ypParticle position y
[in]Aabssqp|a|^2 field at particle position
[in]AabssqDxpd/dx |a|^2 field at particle position
[in]AabssqDypd/dy |a|^2 field at particle position
[in]a_arra field array
[in]dx_invinverse cell spacing in x direction
[in]dy_invinverse cell spacing in y direction
[in]x_pos_offsetoffset for converting positions to indexes
[in]y_pos_offsetoffset for converting positions to indexes

◆ doLaserGatherShapeN() [2/2]

template<int depos_order_xy>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doLaserGatherShapeN ( const amrex::Real  xp,
const amrex::Real  yp,
amrex::Real &  Aabssqp,
Array3< amrex::Real const > const &  a_arr,
const amrex::Real  dx_inv,
const amrex::Real  dy_inv,
const amrex::Real  x_pos_offset,
const amrex::Real  y_pos_offset 
)

Laser field gather for a single particle.

Template Parameters
depos_order_xyOrder of the transverse shape factor for the field gather
Parameters
[in]xpParticle position x
[in]ypParticle position y
[in,out]AabssqpField on particle: |a|^2
[in]a_arrfield array for field a
[in]dx_invinverse cell spacing in x direction
[in]dy_invinverse cell spacing in y direction
[in]x_pos_offsetoffset for converting positions to indexes
[in]y_pos_offsetoffset for converting positions to indexes