WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
Particles
ElementaryProcess
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 WARPX_QED_SCHWINGER_PROCESS_H_
9
#define WARPX_QED_SCHWINGER_PROCESS_H_
10
11
#include "
Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H
"
12
#include "
Utils/TextMsg.H
"
13
18
struct
SchwingerFilterFunc
19
{
20
int
m_threshold_poisson_gaussian
;
21
amrex::Real
m_dV
;
22
amrex::Real
m_dt
;
23
35
template
<
typename
FABs>
36
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
37
amrex::Real
operator()
(
const
FABs& src_FABs,
38
const
int
i,
const
int
j,
const
int
k,
39
amrex::RandomEngine
const
& engine)
const
noexcept
40
{
41
const
auto
& arrEx = src_FABs.Ex;
42
const
auto
& arrEy = src_FABs.Ey;
43
const
auto
& arrEz = src_FABs.Ez;
44
const
auto
& arrBx = src_FABs.Bx;
45
const
auto
& arrBy = src_FABs.By;
46
const
auto
& arrBz = src_FABs.Bz;
47
48
return
getSchwingerProductionNumber
(
m_dV
,
m_dt
,
49
arrEx(i,j,k),arrEy(i,j,k),arrEz(i,j,k),
50
arrBx(i,j,k),arrBy(i,j,k),arrBz(i,j,k),
51
m_threshold_poisson_gaussian
,engine);
52
}
53
};
54
55
60
struct
SchwingerTransformFunc
61
{
62
amrex::Real
m_y_size
;
63
int
m_weight_index
;
64
77
template
<
typename
DstTile>
78
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
79
void
operator()
(DstTile& dst1, DstTile& dst2,
const
int
i_dst1,
80
const
int
i_dst2,
const
int
N,
81
const
amrex::Real
total_weight)
const
noexcept
82
{
83
for
(
int
n = 0; n < N; ++n){
84
#if AMREX_SPACEDIM == 1
85
amrex::ignore_unused
(dst1, dst2, i_dst1, i_dst2, N, total_weight);
86
amrex::Abort
(
"SchwingerTransformFunc not implemented in 1D"
);
87
#elif defined(WARPX_DIM_3D)
88
dst1.m_rdata[
m_weight_index
][i_dst1+n] = total_weight/N;
89
dst2.m_rdata[
m_weight_index
][i_dst2+n] = total_weight/N;
90
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
91
dst1.m_rdata[
m_weight_index
][i_dst1+n] = total_weight/N/
m_y_size
;
92
dst2.m_rdata[
m_weight_index
][i_dst2+n] = total_weight/N/
m_y_size
;
93
#endif
94
}
95
}
96
};
97
98
#endif
// WARPX_QED_SCHWINGER_PROCESS_H_
AMREX_FORCE_INLINE
#define AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST_DEVICE
SchwingerProcessWrapper.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
TextMsg.H
amrex::Real
amrex_real Real
amrex::ignore_unused
__host__ __device__ void ignore_unused(const Ts &...)
amrex::Abort
void Abort(const std::string &msg)
SchwingerFilterFunc
Definition
QEDSchwingerProcess.H:19
SchwingerFilterFunc::operator()
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:37
SchwingerFilterFunc::m_dV
amrex::Real m_dV
Definition
QEDSchwingerProcess.H:21
SchwingerFilterFunc::m_dt
amrex::Real m_dt
Definition
QEDSchwingerProcess.H:22
SchwingerFilterFunc::m_threshold_poisson_gaussian
int m_threshold_poisson_gaussian
Definition
QEDSchwingerProcess.H:20
SchwingerTransformFunc
Definition
QEDSchwingerProcess.H:61
SchwingerTransformFunc::operator()
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:79
SchwingerTransformFunc::m_y_size
amrex::Real m_y_size
Definition
QEDSchwingerProcess.H:62
SchwingerTransformFunc::m_weight_index
int m_weight_index
Definition
QEDSchwingerProcess.H:63
amrex::RandomEngine
Generated by
1.17.0