8 #ifndef QED_PHOTON_EMISSION_H_
9 #define QED_PHOTON_EMISSION_H_
63 template <
typename PData>
67 using namespace amrex;
69 const amrex::ParticleReal opt_depth =
71 return (opt_depth < 0.0_rt);
112 int const opt_depth_runtime_comp,
133 template <
typename DstData,
typename SrcData>
135 void operator() (DstData& dst, SrcData& src,
int i_src,
int i_dst,
138 using namespace amrex;
141 amrex::ParticleReal xp, yp, zp;
142 m_get_position(i_src, xp, yp, zp);
144 amrex::ParticleReal ex = 0._rt, ey = 0._rt, ez = 0._rt;
145 amrex::ParticleReal bx = 0._rt, by = 0._rt, bz = 0._rt;
146 m_get_externalEB(i_src, ex, ey, ez, bx, by, bz);
149 m_ex_arr, m_ey_arr, m_ez_arr, m_bx_arr, m_by_arr, m_bz_arr,
150 m_ex_type, m_ey_type, m_ez_type, m_bx_type, m_by_type, m_bz_type,
151 m_dx_arr, m_xyzmin_arr, m_lo, m_n_rz_azimuthal_modes,
152 m_nox, m_galerkin_interpolation);
154 auto& ux = src.m_rdata[
PIdx::ux][i_src];
155 auto& uy = src.m_rdata[
PIdx::uy][i_src];
156 auto& uz = src.m_rdata[
PIdx::uz][i_src];
157 auto& g_ux = dst.m_rdata[
PIdx::ux][i_dst];
158 auto& g_uy = dst.m_rdata[
PIdx::uy][i_dst];
159 auto& g_uz = dst.m_rdata[
PIdx::uz][i_dst];
169 m_opt_depth_functor(engine);
221 template <
typename PTile>
224 const int old_size,
const int num_added,
225 const amrex::ParticleReal energy_threshold)
227 auto pp = ptile.GetArrayOfStructs()().
data() + old_size;
229 const auto& soa = ptile.GetStructOfArrays();
230 const auto p_ux = soa.GetRealData(
PIdx::ux).data() + old_size;
231 const auto p_uy = soa.GetRealData(
PIdx::uy).data() + old_size;
232 const auto p_uz = soa.GetRealData(
PIdx::uz).data() + old_size;
235 const auto energy_threshold2 = std::max(
236 energy_threshold*energy_threshold,
237 std::numeric_limits<amrex::ParticleReal>::min());
243 const auto ux = p_ux[ip];
244 const auto uy = p_uy[ip];
245 const auto uz = p_uz[ip];
250 const auto phot_energy2 = (ux*ux + uy*uy + uz*uz)*me_c*me_c;
252 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:222
Filter functor for the QED photon emission process.
Definition: QEDPhotonEmission.H:43
int m_opt_depth_runtime_comp
Definition: QEDPhotonEmission.H:75
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:65
PhotonEmissionFilterFunc(int const opt_depth_runtime_comp)
Constructor of the PhotonEmissionFilterFunc functor.
Definition: QEDPhotonEmission.H:51
Definition: QuantumSyncEngineWrapper.H:76
Definition: QuantumSyncEngineWrapper.H:178
Definition: WarpXParticleContainer.H:52
list data
open text file and read data #####
Definition: Excitation_Flag_Generator.py:24
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
std::enable_if_t< std::is_integral_v< T > > ParallelFor(TypeList< CTOs... > 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
Functor that can be used to extract the positions of the macroparticles inside a ParallelFor kernel.
Definition: GetAndSetPosition.H:53
@ uz
Definition: NamedComponentParticleContainer.H:25
@ uy
Definition: NamedComponentParticleContainer.H:25
@ ux
Definition: NamedComponentParticleContainer.H:25