aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/ElementaryProcess/QEDInternals/QedChiFunctions.H
blob: 2b52acd7efaeb44bdc2abc5d06a5d365aef63652 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* Copyright 2019 Luca Fedeli
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */
#ifndef WARPX_amrex_qed_chi_functions_h_
#define WARPX_amrex_qed_chi_functions_h_

/**
 * This header contains wrappers around functions provided by
 * the PICSAR QED library to calculate the 'chi' parameter
 * for photons or electrons and positrons.
 */

#include "QedWrapperCommons.H"

#include <picsar_qed/physics/chi_functions.hpp>

namespace QedUtils{
    /**
    * Function to calculate the 'chi' parameter for photons.
    * Suitable for GPU kernels.
    * @param[in] px,py,pz components of momentum (SI units)
    * @param[in] ex,ey,ez components of electric field (SI units)
    * @param[in] bx,by,bz components of magnetic field (SI units)
    * @return chi parameter
    */
    AMREX_GPU_DEVICE
    AMREX_FORCE_INLINE
    amrex::Real chi_photon(
        const amrex::ParticleReal px, const amrex::ParticleReal py,
        const amrex::ParticleReal pz, const amrex::ParticleReal ex,
        const amrex::ParticleReal ey, const amrex::ParticleReal ez,
        const amrex::ParticleReal bx, const amrex::ParticleReal by,
        const amrex::ParticleReal bz)
    {
        namespace pxr_p = picsar::multi_physics::phys;
        return pxr_p::chi_photon<amrex::ParticleReal, pxr_p::unit_system::SI>(
            px, py, pz, ex, ey, ez, bx, by, bz);
    }

    /**
    * Function to calculate the 'chi' parameter for electrons or positrons.
    * Suitable for GPU kernels.
    * @param[in] px,py,pz components of momentum (SI units)
    * @param[in] ex,ey,ez components of electric field (SI units)
    * @param[in] bx,by,bz components of magnetic field (SI units)
    * @return chi parameter
    */
    AMREX_GPU_DEVICE
    AMREX_FORCE_INLINE
    amrex::Real chi_ele_pos(
        const amrex::ParticleReal px, const amrex::ParticleReal py,
        const amrex::ParticleReal pz, const amrex::ParticleReal ex,
        const amrex::ParticleReal ey, const amrex::ParticleReal ez,
        const amrex::ParticleReal bx, const amrex::ParticleReal by,
        const amrex::ParticleReal bz)
    {
            namespace pxr_p = picsar::multi_physics::phys;
            return pxr_p::chi_ele_pos<amrex::ParticleReal, pxr_p::unit_system::SI>(
                px, py, pz, ex, ey, ez, bx, by, bz);
    }
    //_________
}

#endif //WARPX_amrex_qed_chi_functions_h_