ARTEMIS
QEDSchwingerProcess.H
Go to the documentation of this file.
1 /* Copyright 2020 Luca Fedeli, Neil Zaim
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 
8 #ifndef QED_SCHWINGER_PROCESS_H_
9 #define QED_SCHWINGER_PROCESS_H_
10 
12 
18 {
20  const amrex::Real m_dV;
21  const amrex::Real m_dt;
22 
34  template <typename FABs>
36  amrex::Real operator() (const FABs& src_FABs,
37  const int i, const int j, const int k,
38  amrex::RandomEngine const& engine) const noexcept
39  {
40  const auto& arrEx = src_FABs.Ex;
41  const auto& arrEy = src_FABs.Ey;
42  const auto& arrEz = src_FABs.Ez;
43  const auto& arrBx = src_FABs.Bx;
44  const auto& arrBy = src_FABs.By;
45  const auto& arrBz = src_FABs.Bz;
46 
48  arrEx(i,j,k),arrEy(i,j,k),arrEz(i,j,k),
49  arrBx(i,j,k),arrBy(i,j,k),arrBz(i,j,k),
51  }
52 };
53 
54 
60 {
61  const amrex::Real m_y_size;
62  const int m_weight_index;
63 
76  template <typename DstTile>
78  void operator() (DstTile& dst1, DstTile& dst2, const int i_dst1,
79  const int i_dst2, const int N,
80  const amrex::Real total_weight) const noexcept
81  {
82  for (int n = 0; n < N; ++n){
83 #if defined(WARPX_DIM_1D_Z)
84  amrex::ignore_unused(dst1, dst2, i_dst1, i_dst2, N, total_weight);
85  amrex::Abort("SchwingerTransformFunc not implemented in 1D");
86 #elif defined(WARPX_DIM_3D)
87  dst1.m_rdata[m_weight_index][i_dst1+n] = total_weight/N;
88  dst2.m_rdata[m_weight_index][i_dst2+n] = total_weight/N;
89 #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
90  dst1.m_rdata[m_weight_index][i_dst1+n] = total_weight/N/m_y_size;
91  dst2.m_rdata[m_weight_index][i_dst2+n] = total_weight/N/m_y_size;
92 #endif
93  }
94  }
95 };
96 
97 #endif // QED_SCHWINGER_PROCESS_H_
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getSchwingerProductionNumber(const amrex::Real dV, const amrex::Real dt, const amrex::ParticleReal Ex, const amrex::ParticleReal Ey, const amrex::ParticleReal Ez, const amrex::ParticleReal Bx, const amrex::ParticleReal By, const amrex::ParticleReal Bz, const amrex::ParticleReal PoissonToGaussianThreshold, amrex::RandomEngine const &engine)
Definition: SchwingerProcessWrapper.H:41
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
void Abort(const std::string &msg)
i
Definition: check_interp_points_and_weights.py:174
int n
Definition: run_libensemble_on_warpx.py:67
Definition: QEDSchwingerProcess.H:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(const FABs &src_FABs, const int i, const int j, const int k, amrex::RandomEngine const &engine) const noexcept
Definition: QEDSchwingerProcess.H:36
const amrex::Real m_dt
Definition: QEDSchwingerProcess.H:21
const amrex::Real m_dV
Definition: QEDSchwingerProcess.H:20
const int m_threshold_poisson_gaussian
Definition: QEDSchwingerProcess.H:19
Definition: QEDSchwingerProcess.H:60
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(DstTile &dst1, DstTile &dst2, const int i_dst1, const int i_dst2, const int N, const amrex::Real total_weight) const noexcept
Definition: QEDSchwingerProcess.H:78
const amrex::Real m_y_size
Definition: QEDSchwingerProcess.H:61
const int m_weight_index
Definition: QEDSchwingerProcess.H:62