From 1f1cd934e82e4cffa9c68ab35c802e6298ac6501 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 11 Jun 2021 16:27:24 -0700 Subject: Fix Offset: PushPX -> evolve_opt (#2011) * Fix Offset: PushPX -> evolve_opt Comparing to the `doParticlePush()` above, the `ux`/`uy`/`uz` SoA attributes seem to lack the particle offset in `PushPX`. Also simplifies the offset calculation to reside off-kernel, which saves 8 bytes cmem and some index indirection logic for the compiler. * RigidInjected Particle: Fix Offset Looks like this is missing here, too? --- Source/Particles/PhotonParticleContainer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Particles/PhotonParticleContainer.cpp') diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index bda0f984e..648e45319 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -96,9 +96,9 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti, auto& attribs = pti.GetAttribs(); // Extract pointers to the different particle quantities - ParticleReal* const AMREX_RESTRICT ux = attribs[PIdx::ux].dataPtr(); - ParticleReal* const AMREX_RESTRICT uy = attribs[PIdx::uy].dataPtr(); - ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr(); + ParticleReal* const AMREX_RESTRICT ux = attribs[PIdx::ux].dataPtr() + offset; + ParticleReal* const AMREX_RESTRICT uy = attribs[PIdx::uy].dataPtr() + offset; + ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr() + offset; #ifdef WARPX_QED BreitWheelerEvolveOpticalDepth evolve_opt; @@ -106,7 +106,7 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti, const bool local_has_breit_wheeler = has_breit_wheeler(); if (local_has_breit_wheeler) { evolve_opt = m_shr_p_bw_engine->build_evolve_functor(); - p_optical_depth_BW = pti.GetAttribs(particle_comps["optical_depth_BW"]).dataPtr(); + p_optical_depth_BW = pti.GetAttribs(particle_comps["optical_depth_BW"]).dataPtr() + offset; } #endif -- cgit v1.2.3