7 #ifndef WARPX_ACCELERATORLATTICE_LATTICEELEMENTS_HARDEDGEDPLASMALENS_H_ 8 #define WARPX_ACCELERATORLATTICE_LATTICEELEMENTS_HARDEDGEDPLASMALENS_H_ 50 std::vector<amrex::ParticleReal>
h_dEdx;
51 std::vector<amrex::ParticleReal>
h_dBdx;
94 const amrex::ParticleReal x,
95 const amrex::ParticleReal y,
96 const amrex::ParticleReal z,
97 const amrex::ParticleReal zpvdt,
98 amrex::ParticleReal& Ex,
99 amrex::ParticleReal& Ey,
100 amrex::ParticleReal& Bx,
101 amrex::ParticleReal& By)
const 106 amrex::ParticleReal
const frac =
hard_edged_fraction(z, zpvdt, d_zs_arr[ielement], d_ze_arr[ielement]);
108 amrex::ParticleReal dEdx = frac*d_dEdx_arr[ielement];
109 amrex::ParticleReal dBdx = frac*d_dBdx_arr[ielement];
120 #endif // WARPX_ACCELERATORLATTICE_LATTICEELEMENTS_HARDEDGEDPLASMALENS_H_ 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:26
std::vector< amrex::ParticleReal > h_dEdx
Definition: HardEdgedPlasmaLens.H:50
~HardEdgedPlasmaLens()=default
amrex::Gpu::DeviceVector< amrex::ParticleReal > d_dBdx
Definition: HardEdgedPlasmaLens.H:54
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:93
int nelements
Definition: LatticeElementBase.H:47
void WriteToDevice()
Write the element information to the device.
Definition: HardEdgedPlasmaLens.cpp:38
const amrex::ParticleReal *AMREX_RESTRICT d_dEdx_arr
Definition: HardEdgedPlasmaLens.H:81
void AddElement(amrex::ParmParse &pp_element, amrex::ParticleReal &z_location)
Read in an element and add it to the lists.
Definition: HardEdgedPlasmaLens.cpp:22
Definition: HardEdgedPlasmaLens.H:25
Definition: HardEdgedPlasmaLens.H:66
#define AMREX_FORCE_INLINE
std::vector< amrex::ParticleReal > h_dBdx
Definition: HardEdgedPlasmaLens.H:51
#define AMREX_GPU_HOST_DEVICE
HardEdgedPlasmaLensDevice GetDeviceInstance() const
Returns the device level instance with the lattice information.
Definition: HardEdgedPlasmaLens.cpp:49
HardEdgedPlasmaLens()
Definition: HardEdgedPlasmaLens.cpp:16
amrex::Gpu::DeviceVector< amrex::ParticleReal > d_dEdx
Definition: HardEdgedPlasmaLens.H:53
const amrex::ParticleReal *AMREX_RESTRICT d_ze_arr
Definition: HardEdgedPlasmaLens.H:79
const amrex::ParticleReal *AMREX_RESTRICT d_dBdx_arr
Definition: HardEdgedPlasmaLens.H:82
Definition: LatticeElementBase.H:17
const amrex::ParticleReal *AMREX_RESTRICT d_zs_arr
Definition: HardEdgedPlasmaLens.H:78