WarpX
SchwingerProcessWrapper.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 WARPX_schwinger_process_wrapper_h_
9 #define WARPX_schwinger_process_wrapper_h_
10 
11 #include "QedWrapperCommons.H"
12 
13 #include <AMReX_Random.H>
14 
15 #include <picsar_qed/physics/schwinger/schwinger_pair_engine_core.hpp>
16 
17 #include <cmath>
18 
38 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
39 amrex::Real
40 getSchwingerProductionNumber (const amrex::Real dV, const amrex::Real dt,
41  const amrex::ParticleReal Ex, const amrex::ParticleReal Ey, const amrex::ParticleReal Ez,
42  const amrex::ParticleReal Bx, const amrex::ParticleReal By, const amrex::ParticleReal Bz,
43  const amrex::ParticleReal PoissonToGaussianThreshold,
44  amrex::RandomEngine const& engine)
45 {
46  using namespace amrex;
47  namespace pxr_p = picsar::multi_physics::phys;
48  namespace pxr_sh = picsar::multi_physics::phys::schwinger;
49 
50  const auto expectedPairNumber =
51  pxr_sh::expected_pair_number<amrex::Real, pxr_p::unit_system::SI>(
52  Ex, Ey, Ez, Bx, By, Bz, dV, dt);
53 
54  if (expectedPairNumber <= PoissonToGaussianThreshold) {
55  return amrex::RandomPoisson(expectedPairNumber, engine);
56  } else {
57  const auto numpairs =
58  amrex::RandomNormal(expectedPairNumber, std::sqrt(expectedPairNumber), engine);
59  return numpairs > 0._rt ? numpairs : 0._rt;
60  }
61 }
62 
63 #endif // WARPX_schwinger_process_wrapper_h_
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:40
Definition: BreitWheelerEngineWrapper.H:35