7 #ifndef WARPX_ACCELERATORLATTICE_LATTICEELEMENTS_HARDEDGEDPLASMALENS_H_
8 #define WARPX_ACCELERATORLATTICE_LATTICEELEMENTS_HARDEDGEDPLASMALENS_H_
49 std::vector<amrex::ParticleReal>
h_dEdx;
50 std::vector<amrex::ParticleReal>
h_dBdx;
93 const amrex::ParticleReal x,
94 const amrex::ParticleReal y,
95 const amrex::ParticleReal z,
96 const amrex::ParticleReal zpvdt,
97 amrex::ParticleReal& Ex,
98 amrex::ParticleReal& Ey,
99 amrex::ParticleReal& Bx,
100 amrex::ParticleReal& By)
const
107 const amrex::ParticleReal dEdx = frac*
d_dEdx_arr[ielement];
108 const amrex::ParticleReal dBdx = frac*
d_dBdx_arr[ielement];
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal hard_edged_fraction(const amrex::ParticleReal z, const amrex::ParticleReal zpvdt, const amrex::ParticleReal zs, const amrex::ParticleReal ze)
Calculate the residence correction, the fraction of the time step the particle spends inside of the h...
Definition: HardEdged_K.H:25
Definition: HardEdgedPlasmaLens.H:66
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void get_field(const int ielement, const amrex::ParticleReal x, const amrex::ParticleReal y, const amrex::ParticleReal z, const amrex::ParticleReal zpvdt, amrex::ParticleReal &Ex, amrex::ParticleReal &Ey, amrex::ParticleReal &Bx, amrex::ParticleReal &By) const
Fetch the field of the specified element at the given location.
Definition: HardEdgedPlasmaLens.H:92
const amrex::ParticleReal *AMREX_RESTRICT d_ze_arr
Definition: HardEdgedPlasmaLens.H:78
const amrex::ParticleReal *AMREX_RESTRICT d_dBdx_arr
Definition: HardEdgedPlasmaLens.H:81
int nelements
Definition: HardEdgedPlasmaLens.H:75
void InitHardEdgedPlasmaLensDevice(HardEdgedPlasmaLens const &h_plasmalens)
Initializes the data and pointer needed to reference the lattice element info.
Definition: HardEdgedPlasmaLens.cpp:55
const amrex::ParticleReal *AMREX_RESTRICT d_zs_arr
Definition: HardEdgedPlasmaLens.H:77
const amrex::ParticleReal *AMREX_RESTRICT d_dEdx_arr
Definition: HardEdgedPlasmaLens.H:80
Definition: HardEdgedPlasmaLens.H:26
std::vector< amrex::ParticleReal > h_dEdx
Definition: HardEdgedPlasmaLens.H:49
~HardEdgedPlasmaLens()=default
HardEdgedPlasmaLensDevice GetDeviceInstance() const
Returns the device level instance with the lattice information.
Definition: HardEdgedPlasmaLens.cpp:47
amrex::Gpu::DeviceVector< amrex::ParticleReal > d_dBdx
Definition: HardEdgedPlasmaLens.H:53
void WriteToDevice()
Write the element information to the device.
Definition: HardEdgedPlasmaLens.cpp:36
HardEdgedPlasmaLens()
Definition: HardEdgedPlasmaLens.cpp:14
void AddElement(amrex::ParmParse &pp_element, amrex::ParticleReal &z_location)
Read in an element and add it to the lists.
Definition: HardEdgedPlasmaLens.cpp:20
std::vector< amrex::ParticleReal > h_dBdx
Definition: HardEdgedPlasmaLens.H:50
amrex::Gpu::DeviceVector< amrex::ParticleReal > d_dEdx
Definition: HardEdgedPlasmaLens.H:52
Definition: LatticeElementBase.H:18