WarpX
Loading...
Searching...
No Matches
warpx::particles::deposition Namespace Reference

Classes

class  VarianceAccumulationBuffer
 

Enumerations

enum class  TemperatureDepositionType : int { SINGLE_PASS , DOUBLE_PASS }
 
enum class  TemperatureDepositionPass : int { FIRST , SECOND }
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_INLINE void varianceDepositionSubKernel (amrex::ParticleReal vx, amrex::ParticleReal vy, amrex::ParticleReal vz, const amrex::IntVectND< 3 > &ixv, const amrex::IntVectND< 3 > &iyv, const amrex::IntVectND< 3 > &izv, amrex::Real wpx_var, amrex::Real wpy_var, amrex::Real wpz_var, const amrex::Array4< int > &nx_arr, const amrex::Array4< int > &ny_arr, const amrex::Array4< int > &nz_arr, const amrex::Array4< amrex::Real > &wx_arr, const amrex::Array4< amrex::Real > &wy_arr, const amrex::Array4< amrex::Real > &wz_arr, const amrex::Array4< amrex::Real > &w2x_arr, const amrex::Array4< amrex::Real > &w2y_arr, const amrex::Array4< amrex::Real > &w2z_arr, const amrex::Array4< amrex::Real > &vxbar_arr, const amrex::Array4< amrex::Real > &vybar_arr, const amrex::Array4< amrex::Real > &vzbar_arr, const TemperatureDepositionType type, const TemperatureDepositionPass pass)
 
template<int depos_order>
AMREX_GPU_HOST_DEVICE AMREX_INLINE void doVarianceDepositionShapeNKernel (const amrex::ParticleReal xp, const amrex::ParticleReal yp, const amrex::ParticleReal zp, const amrex::ParticleReal wp, const amrex::ParticleReal vx, const amrex::ParticleReal vy, const amrex::ParticleReal vz, const amrex::Array4< int > &nx_arr, const amrex::Array4< int > &ny_arr, const amrex::Array4< int > &nz_arr, const amrex::Array4< amrex::Real > &wx_arr, const amrex::Array4< amrex::Real > &wy_arr, const amrex::Array4< amrex::Real > &wz_arr, const amrex::Array4< amrex::Real > &w2x_arr, const amrex::Array4< amrex::Real > &w2y_arr, const amrex::Array4< amrex::Real > &w2z_arr, const amrex::Array4< amrex::Real > &vxbar_arr, const amrex::Array4< amrex::Real > &vybar_arr, const amrex::Array4< amrex::Real > &vzbar_arr, const amrex::IntVect &varx_type, const amrex::IntVect &vary_type, const amrex::IntVect &varz_type, const TemperatureDepositionType type, const TemperatureDepositionPass pass, const amrex::Real relative_time, const amrex::XDim3 &dinv, const amrex::XDim3 &xyzmin, const amrex::Dim3 lo, const int n_rz_azimuthal_modes)
 Kernel for the direct current deposition for thread thread_num.
 
template<int depos_order>
void doVarianceDepositionShapeN (const GetParticlePosition< PIdx > &GetPosition, const amrex::ParticleReal *wp, const amrex::ParticleReal *uxp, const amrex::ParticleReal *uyp, const amrex::ParticleReal *uzp, amrex::FArrayBox &varx_fab, amrex::FArrayBox &vary_fab, amrex::FArrayBox &varz_fab, amrex::IArrayBox &nx_iab, amrex::IArrayBox &ny_iab, amrex::IArrayBox &nz_iab, amrex::FArrayBox &wx_fab, amrex::FArrayBox &wy_fab, amrex::FArrayBox &wz_fab, amrex::FArrayBox &w2x_fab, amrex::FArrayBox &w2y_fab, amrex::FArrayBox &w2z_fab, amrex::FArrayBox &vxbar_fab, amrex::FArrayBox &vybar_fab, amrex::FArrayBox &vzbar_fab, const TemperatureDepositionType type, const TemperatureDepositionPass pass, const long np_to_deposit, const amrex::Real relative_time, const amrex::XDim3 &dinv, const amrex::XDim3 &xyzmin, const amrex::Dim3 lo, const int n_rz_azimuthal_modes)
 Temperature Deposition Algorithm from Bell (1979) https://dl.acm.org/doi/pdf/10.1145/359146.359153 This can run either WV1 (Double Pass), or WV4 (Single Pass) Algorithms It should be noted that becuase of GPU Weak memory ordering in kernels it is quite difficult to perform online update algorithms (i.e.) WV2 and WV3 because of difficulties creating critical regions in kernels for all GPU kernel types.
 

Enumeration Type Documentation

◆ TemperatureDepositionPass

Enumerator
FIRST 
SECOND 

◆ TemperatureDepositionType

Enumerator
SINGLE_PASS 
DOUBLE_PASS 

Function Documentation

◆ doVarianceDepositionShapeN()

template<int depos_order>
void warpx::particles::deposition::doVarianceDepositionShapeN ( const GetParticlePosition< PIdx > & GetPosition,
const amrex::ParticleReal * wp,
const amrex::ParticleReal * uxp,
const amrex::ParticleReal * uyp,
const amrex::ParticleReal * uzp,
amrex::FArrayBox & varx_fab,
amrex::FArrayBox & vary_fab,
amrex::FArrayBox & varz_fab,
amrex::IArrayBox & nx_iab,
amrex::IArrayBox & ny_iab,
amrex::IArrayBox & nz_iab,
amrex::FArrayBox & wx_fab,
amrex::FArrayBox & wy_fab,
amrex::FArrayBox & wz_fab,
amrex::FArrayBox & w2x_fab,
amrex::FArrayBox & w2y_fab,
amrex::FArrayBox & w2z_fab,
amrex::FArrayBox & vxbar_fab,
amrex::FArrayBox & vybar_fab,
amrex::FArrayBox & vzbar_fab,
const TemperatureDepositionType type,
const TemperatureDepositionPass pass,
const long np_to_deposit,
const amrex::Real relative_time,
const amrex::XDim3 & dinv,
const amrex::XDim3 & xyzmin,
const amrex::Dim3 lo,
const int n_rz_azimuthal_modes )

Temperature Deposition Algorithm from Bell (1979) https://dl.acm.org/doi/pdf/10.1145/359146.359153 This can run either WV1 (Double Pass), or WV4 (Single Pass) Algorithms It should be noted that becuase of GPU Weak memory ordering in kernels it is quite difficult to perform online update algorithms (i.e.) WV2 and WV3 because of difficulties creating critical regions in kernels for all GPU kernel types.

Template Parameters
depos_orderdeposition order
Parameters
GetPositionA functor for returning the particle position.
wpPointer to array of particle weights.
uxp,uyp,uzpPointer to arrays of particle momentum.
varx_fab,vary_fab,varz_fabFArrayBox of variance, either full array or tile.
nx_iab,ny_iab,nz_iabIArrayBox of sample count buffer, either full array or tile.
wx_fab,wy_fab,wz_fabFArrayBox for running weights buffer, either full array or tile.
w2x_fab,w2y_fab,w2z_fabFArrayBox for weights^2 buffer, either full array or tile.
vxbar_fab,vybar_fab,vzbar_fabFArrayBox of current density, either full array or tile.
typeThe type of deposition routine, either SINGLE_PASS or DOUBLE_PASS
passThe pass that is occurring, either FIRST or SECOND
np_to_depositNumber of particles for which current is deposited.
relative_timeTime at which to deposit J, relative to the time of the current positions of the particles. When different than 0, the particle position will be temporarily modified to match the time of the deposition.
dinv3D cell size inverse
xyzminPhysical lower bounds of domain.
loIndex lower bounds of domain.
n_rz_azimuthal_modesNumber of azimuthal modes when using RZ geometry.

◆ doVarianceDepositionShapeNKernel()

template<int depos_order>
AMREX_GPU_HOST_DEVICE AMREX_INLINE void warpx::particles::deposition::doVarianceDepositionShapeNKernel ( const amrex::ParticleReal xp,
const amrex::ParticleReal yp,
const amrex::ParticleReal zp,
const amrex::ParticleReal wp,
const amrex::ParticleReal vx,
const amrex::ParticleReal vy,
const amrex::ParticleReal vz,
const amrex::Array4< int > & nx_arr,
const amrex::Array4< int > & ny_arr,
const amrex::Array4< int > & nz_arr,
const amrex::Array4< amrex::Real > & wx_arr,
const amrex::Array4< amrex::Real > & wy_arr,
const amrex::Array4< amrex::Real > & wz_arr,
const amrex::Array4< amrex::Real > & w2x_arr,
const amrex::Array4< amrex::Real > & w2y_arr,
const amrex::Array4< amrex::Real > & w2z_arr,
const amrex::Array4< amrex::Real > & vxbar_arr,
const amrex::Array4< amrex::Real > & vybar_arr,
const amrex::Array4< amrex::Real > & vzbar_arr,
const amrex::IntVect & varx_type,
const amrex::IntVect & vary_type,
const amrex::IntVect & varz_type,
const TemperatureDepositionType type,
const TemperatureDepositionPass pass,
const amrex::Real relative_time,
const amrex::XDim3 & dinv,
const amrex::XDim3 & xyzmin,
const amrex::Dim3 lo,
const int n_rz_azimuthal_modes )

Kernel for the direct current deposition for thread thread_num.

Template Parameters
depos_orderdeposition order
Parameters
xp,yp,zpThe particle positions.
wpThe weight of the macroparticle
vx,vy,vzThe particle velocities
nx_arr,ny_arr,nz_arrArray4<int> of velocity variance sample count, either full array or tile.
wx_arr,wy_arr,wz_arrArray4 of weight sums, either full array or tile.
w2x_arr,w2y_arr,w2z_arrArray4 of weight**2 sums, either full array or tile.
vxbar_arr,vybar_arr,vzbar_arrArray4 of current density, either full array or tile.
varx_type,vary_type,varz_typeThe grid types along each direction, either NODE or CELL
typeThe type of deposition routine, either SINGLE_PASS or DOUBLE_PASS
passThe pass that is occurring, either FIRST or SECOND
relative_timeTime at which to deposit J, relative to the time of the current positions of the particles. When different than 0, the particle position will be temporarily modified to match the time of the deposition.
dinv3D cell size inverse
xyzminThe lower bounds of the domain
loIndex lower bounds of domain.
n_rz_azimuthal_modesNumber of azimuthal modes when using RZ geometry.

defined(WARPX_DIM_1D_Z)

◆ varianceDepositionSubKernel()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void warpx::particles::deposition::varianceDepositionSubKernel ( amrex::ParticleReal vx,
amrex::ParticleReal vy,
amrex::ParticleReal vz,
const amrex::IntVectND< 3 > & ixv,
const amrex::IntVectND< 3 > & iyv,
const amrex::IntVectND< 3 > & izv,
amrex::Real wpx_var,
amrex::Real wpy_var,
amrex::Real wpz_var,
const amrex::Array4< int > & nx_arr,
const amrex::Array4< int > & ny_arr,
const amrex::Array4< int > & nz_arr,
const amrex::Array4< amrex::Real > & wx_arr,
const amrex::Array4< amrex::Real > & wy_arr,
const amrex::Array4< amrex::Real > & wz_arr,
const amrex::Array4< amrex::Real > & w2x_arr,
const amrex::Array4< amrex::Real > & w2y_arr,
const amrex::Array4< amrex::Real > & w2z_arr,
const amrex::Array4< amrex::Real > & vxbar_arr,
const amrex::Array4< amrex::Real > & vybar_arr,
const amrex::Array4< amrex::Real > & vzbar_arr,
const TemperatureDepositionType type,
const TemperatureDepositionPass pass )