8 #ifndef WARPX_QED_PHOTON_EMISSION_H_
9 #define WARPX_QED_PHOTON_EMISSION_H_
64 template <
typename PData>
68 using namespace amrex;
70 const amrex::ParticleReal opt_depth =
72 return (opt_depth < 0.0_rt);
113 int opt_depth_runtime_comp,
136 template <
typename DstData,
typename SrcData>
138 void operator() (DstData& dst, SrcData& src,
int i_src,
int i_dst,
141 using namespace amrex;
144 amrex::ParticleReal xp, yp, zp;
145 m_get_position(i_src, xp, yp, zp);
147 amrex::ParticleReal ex = m_Ex_external_particle;
148 amrex::ParticleReal ey = m_Ey_external_particle;
149 amrex::ParticleReal ez = m_Ez_external_particle;
150 amrex::ParticleReal bx = m_Bx_external_particle;
151 amrex::ParticleReal by = m_By_external_particle;
152 amrex::ParticleReal bz = m_Bz_external_particle;
154 m_get_externalEB(i_src, ex, ey, ez, bx, by, bz);
157 m_ex_arr, m_ey_arr, m_ez_arr, m_bx_arr, m_by_arr, m_bz_arr,
158 m_ex_type, m_ey_type, m_ez_type, m_bx_type, m_by_type, m_bz_type,
159 m_dx_arr, m_xyzmin_arr, m_lo, m_n_rz_azimuthal_modes,
160 m_nox, m_galerkin_interpolation);
162 auto& ux = src.m_rdata[
PIdx::ux][i_src];
163 auto& uy = src.m_rdata[
PIdx::uy][i_src];
164 auto& uz = src.m_rdata[
PIdx::uz][i_src];
165 auto& g_ux = dst.m_rdata[
PIdx::ux][i_dst];
166 auto& g_uy = dst.m_rdata[
PIdx::uy][i_dst];
167 auto& g_uz = dst.m_rdata[
PIdx::uz][i_dst];
177 m_opt_depth_functor(engine);
235 template <
typename PTile>
238 const int old_size,
const int num_added,
239 const amrex::ParticleReal energy_threshold)
241 auto& soa = ptile.GetStructOfArrays();
242 auto p_idcpu = soa.GetIdCPUData().data() + old_size;
243 const auto p_ux = soa.GetRealData(
PIdx::ux).data() + old_size;
244 const auto p_uy = soa.GetRealData(
PIdx::uy).data() + old_size;
245 const auto p_uz = soa.GetRealData(
PIdx::uz).data() + old_size;
248 const auto energy_threshold2 = std::max(
249 energy_threshold*energy_threshold,
250 std::numeric_limits<amrex::ParticleReal>::min());
254 const auto ux = p_ux[ip];
255 const auto uy = p_uy[ip];
256 const auto uz = p_uz[ip];
261 const auto phot_energy2 = (ux*ux + uy*uy + uz*uz)*me_c*me_c;
263 if (phot_energy2 < energy_threshold2) {
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void doGatherShapeN(const amrex::ParticleReal xp, const amrex::ParticleReal yp, const amrex::ParticleReal zp, amrex::ParticleReal &Exp, amrex::ParticleReal &Eyp, amrex::ParticleReal &Ezp, amrex::ParticleReal &Bxp, amrex::ParticleReal &Byp, amrex::ParticleReal &Bzp, amrex::Array4< amrex::Real const > const &ex_arr, amrex::Array4< amrex::Real const > const &ey_arr, amrex::Array4< amrex::Real const > const &ez_arr, amrex::Array4< amrex::Real const > const &bx_arr, amrex::Array4< amrex::Real const > const &by_arr, amrex::Array4< amrex::Real const > const &bz_arr, const amrex::IndexType ex_type, const amrex::IndexType ey_type, const amrex::IndexType ez_type, const amrex::IndexType bx_type, const amrex::IndexType by_type, const amrex::IndexType bz_type, const amrex::GpuArray< amrex::Real, 3 > &dx, const amrex::GpuArray< amrex::Real, 3 > &xyzmin, const amrex::Dim3 &lo, const int n_rz_azimuthal_modes)
Field gather for a single particle.
Definition: FieldGather.H:38
void cleanLowEnergyPhotons(PTile &ptile, const int old_size, const int num_added, const amrex::ParticleReal energy_threshold)
Free function to call to remove immediately low energy photons by setting their ID to -1....
Definition: QEDPhotonEmission.H:236
Filter functor for the QED photon emission process.
Definition: QEDPhotonEmission.H:44
int m_opt_depth_runtime_comp
Definition: QEDPhotonEmission.H:76
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator()(const PData &ptd, int const i, amrex::RandomEngine const &) const noexcept
Functor call. This method determines if a given (electron or positron) particle should undergo QED ph...
Definition: QEDPhotonEmission.H:66
PhotonEmissionFilterFunc(int const opt_depth_runtime_comp)
Constructor of the PhotonEmissionFilterFunc functor.
Definition: QEDPhotonEmission.H:52
Definition: QuantumSyncEngineWrapper.H:76
Definition: QuantumSyncEngineWrapper.H:179
Definition: WarpXParticleContainer.H:53
static constexpr auto c
vacuum speed of light [m/s]
Definition: constant.H:44
static constexpr auto m_e
electron mass [kg]
Definition: constant.H:52
constexpr std::uint64_t Invalid
std::enable_if_t< std::is_integral_v< T > > ParallelFor(TypeList< CTOs... >, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
i
Definition: check_interp_points_and_weights.py:174
Functor class that assigns external field values (E and B) to particles.
Definition: GetExternalFields.H:25
@ uz
Definition: NamedComponentParticleContainer.H:34
@ uy
Definition: NamedComponentParticleContainer.H:34
@ ux
Definition: NamedComponentParticleContainer.H:34