From 0b69e1c2eb2f9788e5c92970dcdd112c1b0d0f29 Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Mon, 18 Dec 2023 10:38:36 -0800 Subject: [PATCH] fix condition for particles in rminrmax, and paranthesis for theta min max condition --- Source/Particles/MultiParticleContainer.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index fed9af4562f..9cef1e4e005 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -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 @@ -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;