aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/ElementaryProcess/QEDPairGeneration.H
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2020-03-30 16:41:57 +0200
committerGravatar GitHub <noreply@github.com> 2020-03-30 07:41:57 -0700
commita73d71c77d9fabb24d07caea35811d70a6bd9235 (patch)
tree9772a212916eeda1ba0bddf6d3d3529240c43188 /Source/Particles/ElementaryProcess/QEDPairGeneration.H
parentf8d2179f34816a36a8db3b5ba3bee937a7478a5f (diff)
downloadWarpX-a73d71c77d9fabb24d07caea35811d70a6bd9235.tar.gz
WarpX-a73d71c77d9fabb24d07caea35811d70a6bd9235.tar.zst
WarpX-a73d71c77d9fabb24d07caea35811d70a6bd9235.zip
[mini-PR] Fix bug in Breit-Wheeler engine (#852)
* fixed bug in BW engine * fixed bug * fixed bug * fixed bug * fixed bug * fixed bug * eliminate useless variable * updated test * updated inputfile * Updated tests * increase tolerance from .04 to .07 in QED 3D BW test * do plot pos_bw and ele_bw Co-authored-by: MaxThevenet <mthevenet@lbl.gov>
Diffstat (limited to 'Source/Particles/ElementaryProcess/QEDPairGeneration.H')
-rw-r--r--Source/Particles/ElementaryProcess/QEDPairGeneration.H12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Particles/ElementaryProcess/QEDPairGeneration.H b/Source/Particles/ElementaryProcess/QEDPairGeneration.H
index ee371d240..9bcf7488a 100644
--- a/Source/Particles/ElementaryProcess/QEDPairGeneration.H
+++ b/Source/Particles/ElementaryProcess/QEDPairGeneration.H
@@ -80,7 +80,8 @@ public:
{}
/**
- * \brief Functor call. It determines the properties of the generated pair.
+ * \brief Functor call. It determines the properties of the generated pair
+ * and it sets to -1 the id of the source photon
*
* @param[in,out] dst1 target species 1 (either electrons or positrons)
* @param[in,out] dst2 target species 2 (either electrons or positrons)
@@ -91,7 +92,7 @@ public:
*/
template <typename DstData, typename SrcData>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
- void operator() (DstData& dst1, DstData& dst2, const SrcData& src,
+ void operator() (DstData& dst1, DstData& dst2, SrcData& src,
int const i_src, int const i_dst1, int const i_dst2) const noexcept
{
using namespace amrex;
@@ -135,10 +136,6 @@ public:
&p_px, &p_py, &p_pz,
&e_w, &p_w);
- src.m_rdata[PIdx::ux][i_src] = px*one_over_me;
- src.m_rdata[PIdx::uy][i_src] = py*one_over_me;
- src.m_rdata[PIdx::uz][i_src] = pz*one_over_me;
-
dst1.m_rdata[PIdx::w][i_dst1] = e_w;
dst1.m_rdata[PIdx::ux][i_dst1] = e_px*one_over_me;
dst1.m_rdata[PIdx::uy][i_dst1] = e_py*one_over_me;
@@ -148,6 +145,9 @@ public:
dst2.m_rdata[PIdx::ux][i_dst2] = p_px*one_over_me;
dst2.m_rdata[PIdx::uy][i_dst2] = p_py*one_over_me;
dst2.m_rdata[PIdx::uz][i_dst2] = p_pz*one_over_me;
+
+ src.m_aos[i_src].id() = -1; //destroy photon after pair generation
+
}
private: