WarpX
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 
32  template <typename FABs>
33  AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
34  amrex::Real operator() (const FABs& src_FABs,
35  const int i, const int j, const int k,
36  amrex::RandomEngine const& engine) const noexcept
37  {
38  const auto& arrEx = src_FABs[0];
39  const auto& arrEy = src_FABs[1];
40  const auto& arrEz = src_FABs[2];
41  const auto& arrBx = src_FABs[3];
42  const auto& arrBy = src_FABs[4];
43  const auto& arrBz = src_FABs[5];
44 
45  return getSchwingerProductionNumber( m_dV, m_dt,
46  arrEx(i,j,k),arrEy(i,j,k),arrEz(i,j,k),
47  arrBx(i,j,k),arrBy(i,j,k),arrBz(i,j,k),
48  m_threshold_poisson_gaussian,engine);
49  }
50 };
51 
52 
58 {
59  const amrex::Real m_y_size;
60  const int m_weight_index;
61 
74  template <typename DstTile>
75  AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
76  void operator() (DstTile& dst1, DstTile& dst2, const int i_dst1,
77  const int i_dst2, const int N,
78  const amrex::Real total_weight) const noexcept
79  {
80  for (int n = 0; n < N; ++n){
81 #if (AMREX_SPACEDIM == 3)
82  dst1.m_rdata[m_weight_index][i_dst1+n] = total_weight/N;
83  dst2.m_rdata[m_weight_index][i_dst2+n] = total_weight/N;
84 #elif (AMREX_SPACEDIM == 2)
85  dst1.m_rdata[m_weight_index][i_dst1+n] = total_weight/N/m_y_size;
86  dst2.m_rdata[m_weight_index][i_dst2+n] = total_weight/N/m_y_size;
87 #endif
88  }
89  }
90 };
91 
92 #endif // QED_SCHWINGER_PROCESS_H_
const amrex::Real m_dV
Definition: QEDSchwingerProcess.H:20
const amrex::Real m_y_size
Definition: QEDSchwingerProcess.H:59
const int m_weight_index
Definition: QEDSchwingerProcess.H:60
Definition: QEDSchwingerProcess.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getSchwingerProductionNumber(const amrex::Real dV, const amrex::Real dt, const amrex::Real Ex, const amrex::Real Ey, const amrex::Real Ez, const amrex::Real Bx, const amrex::Real By, const amrex::Real Bz, const amrex::Real PoissonToGaussianThreshold, amrex::RandomEngine const &engine)
Definition: SchwingerProcessWrapper.H:38
int n
Definition: run_libensemble_on_warpx.py:68
i
Definition: check_interp_points_and_weights.py:171
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:34
const amrex::Real m_dt
Definition: QEDSchwingerProcess.H:21
Definition: QEDSchwingerProcess.H:17
const int m_threshold_poisson_gaussian
Definition: QEDSchwingerProcess.H:19