Skip to content

Commit 3e551e0

Browse files
GivenChenax3l
andauthored
Fix neutral particle got pushed (#4643)
* Update PushSelector.H add the pointer of the array of ion_lev to the pusher function, and use this pointer to determine whether to change the charge instead of the value of ion_lev * Update PhysicalParticleContainer.cpp Change the variable in the targeted function * Alternative approach --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
1 parent 0284b57 commit 3e551e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Source/Particles/PhysicalParticleContainer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2880,7 +2880,7 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti,
28802880

28812881
doParticleMomentumPush<0>(ux[ip], uy[ip], uz[ip],
28822882
Exp, Eyp, Ezp, Bxp, Byp, Bzp,
2883-
ion_lev ? ion_lev[ip] : 0,
2883+
ion_lev ? ion_lev[ip] : 1,
28842884
m, q, pusher_algo, do_crr,
28852885
#ifdef WARPX_QED
28862886
t_chi_max,
@@ -2900,7 +2900,7 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti,
29002900

29012901
doParticleMomentumPush<1>(ux[ip], uy[ip], uz[ip],
29022902
Exp, Eyp, Ezp, Bxp, Byp, Bzp,
2903-
ion_lev ? ion_lev[ip] : 0,
2903+
ion_lev ? ion_lev[ip] : 1,
29042904
m, q, pusher_algo, do_crr,
29052905
t_chi_max,
29062906
dt);
@@ -3140,7 +3140,7 @@ PhysicalParticleContainer::ImplicitPushXP (WarpXParIter& pti,
31403140
{
31413141
doParticleMomentumPush<0>(ux[ip], uy[ip], uz[ip],
31423142
Exp, Eyp, Ezp, Bxp, Byp, Bzp,
3143-
ion_lev ? ion_lev[ip] : 0,
3143+
ion_lev ? ion_lev[ip] : 1,
31443144
m, q, pusher_algo, do_crr,
31453145
#ifdef WARPX_QED
31463146
t_chi_max,
@@ -3152,7 +3152,7 @@ PhysicalParticleContainer::ImplicitPushXP (WarpXParIter& pti,
31523152
if constexpr (qed_control == has_qed) {
31533153
doParticleMomentumPush<1>(ux[ip], uy[ip], uz[ip],
31543154
Exp, Eyp, Ezp, Bxp, Byp, Bzp,
3155-
ion_lev ? ion_lev[ip] : 0,
3155+
ion_lev ? ion_lev[ip] : 1,
31563156
m, q, pusher_algo, do_crr,
31573157
t_chi_max,
31583158
dt);

Source/Particles/Pusher/PushSelector.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void doParticleMomentumPush(amrex::ParticleReal& ux,
5757
const amrex::Real dt)
5858
{
5959
amrex::ParticleReal qp = a_q;
60-
if (ion_lev) { qp *= ion_lev; }
60+
qp *= ion_lev;
6161

6262
if (do_crr) {
6363
#ifdef WARPX_QED

0 commit comments

Comments
 (0)