diff options
author | 2021-06-11 16:27:24 -0700 | |
---|---|---|
committer | 2021-06-11 16:27:24 -0700 | |
commit | 1f1cd934e82e4cffa9c68ab35c802e6298ac6501 (patch) | |
tree | e9f9ed14176094845e3ecfd50a19ffb041448cf4 /Source/Particles/PhotonParticleContainer.cpp | |
parent | 4974f07209ebc5e0578fc383057b4be383cdf318 (diff) | |
download | WarpX-1f1cd934e82e4cffa9c68ab35c802e6298ac6501.tar.gz WarpX-1f1cd934e82e4cffa9c68ab35c802e6298ac6501.tar.zst WarpX-1f1cd934e82e4cffa9c68ab35c802e6298ac6501.zip |
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?
Diffstat (limited to 'Source/Particles/PhotonParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhotonParticleContainer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 |