WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
Particles
ElementaryProcess
QEDInternals
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
39
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
40
amrex::Real
41
getSchwingerProductionNumber
(
const
amrex::Real
dV,
const
amrex::Real
dt,
42
const
amrex::ParticleReal
Ex,
const
amrex::ParticleReal
Ey,
const
amrex::ParticleReal
Ez,
43
const
amrex::ParticleReal
Bx,
const
amrex::ParticleReal
By,
const
amrex::ParticleReal
Bz,
44
const
amrex::ParticleReal
PoissonToGaussianThreshold,
45
amrex::RandomEngine
const
& engine)
46
{
47
using namespace
amrex
;
48
namespace
pxr_p = picsar::multi_physics::phys;
49
namespace
pxr_sh = picsar::multi_physics::phys::schwinger;
50
51
const
auto
expectedPairNumber =
52
pxr_sh::expected_pair_number<amrex::Real, pxr_p::unit_system::SI>(
53
Ex, Ey, Ez, Bx, By, Bz, dV, dt);
54
55
if
(expectedPairNumber <= PoissonToGaussianThreshold) {
56
return
amrex::RandomPoisson
(expectedPairNumber, engine);
57
}
else
{
58
const
auto
numpairs =
59
amrex::RandomNormal
(expectedPairNumber, std::sqrt(expectedPairNumber), engine);
60
return
numpairs > 0._rt ? numpairs : 0._rt;
61
}
62
}
63
64
#endif
// WARPX_schwinger_process_wrapper_h_
AMREX_FORCE_INLINE
#define AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST_DEVICE
AMReX_Random.H
QedWrapperCommons.H
getSchwingerProductionNumber
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::Real
amrex_real Real
amrex::ParticleReal
amrex_particle_real ParticleReal
amrex::RandomNormal
Real RandomNormal(Real mean, Real stddev)
amrex::RandomPoisson
unsigned int RandomPoisson(Real lambda)
amrex
amrex::RandomEngine
Generated by
1.17.0