Skip to content

Commit

Permalink
fix condition for particles in rminrmax, and paranthesis for theta mi…
Browse files Browse the repository at this point in the history
…n max condition
  • Loading branch information
RevathiJambunathan committed Dec 18, 2023
1 parent ecae03e commit 0b69e1c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Source/Particles/MultiParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2135,8 +2135,8 @@ MultiParticleContainer::PulsarPairInjection ()
+ (pos.y-yc)*(pos.y-yc)
+ (pos.z-zc)*(pos.z-zc));
if (rad > 0) theta_p = std::acos(amrex::Math::abs(pos.z-zc)/rad);
if (amrex::Math::abs(theta_p) > pulsar_removeparticle_theta_min*MathConst::pi/180. and
amrex::Math::abs(theta_p) < pulsar_removeparticle_theta_max*MathConst::pi/180.) {
if ( (amrex::Math::abs(theta_p) > (pulsar_removeparticle_theta_min*MathConst::pi/180.) ) &&
(amrex::Math::abs(theta_p) < (pulsar_removeparticle_theta_max*MathConst::pi/180.) )) {
ZeroInitializeAndSetNegativeID(p_sp1, pa_sp1, ip
#ifdef WARPX_QED
,loc_has_quantum_sync_sp1, p_optical_depth_QSR_sp1
Expand All @@ -2149,6 +2149,23 @@ MultiParticleContainer::PulsarPairInjection ()
,loc_has_breit_wheeler_sp2, p_optical_depth_BW_sp2
#endif
);
continue;
}
if ( ! ( ( rad > pulsar_particle_injection_rmin) &&
( rad < pulsar_particle_injection_rmax) )) {
ZeroInitializeAndSetNegativeID(p_sp1, pa_sp1, ip
#ifdef WARPX_QED
,loc_has_quantum_sync_sp1, p_optical_depth_QSR_sp1
,loc_has_breit_wheeler_sp1, p_optical_depth_BW_sp1
#endif
);
ZeroInitializeAndSetNegativeID(p_sp2, pa_sp2, ip
#ifdef WARPX_QED
,loc_has_quantum_sync_sp2, p_optical_depth_QSR_sp2
,loc_has_breit_wheeler_sp2, p_optical_depth_BW_sp2
#endif
);
continue;
}
// Initialize particle velocity along the Bfield line
XDim3 u;
Expand Down

0 comments on commit 0b69e1c

Please sign in to comment.