diff options
author | 2019-04-29 10:41:06 -0700 | |
---|---|---|
committer | 2019-04-29 10:41:06 -0700 | |
commit | 7e58007c9eba2b51003ff813a8bfe65ae25e8392 (patch) | |
tree | 0f940d7affa755d33b5ed522c1dc16ab2eecc32e /Source/Particles/RigidInjectedParticleContainer.cpp | |
parent | 0f9a768a10529ea0b3e9d9dde12834f31bc733cd (diff) | |
download | WarpX-7e58007c9eba2b51003ff813a8bfe65ae25e8392.tar.gz WarpX-7e58007c9eba2b51003ff813a8bfe65ae25e8392.tar.zst WarpX-7e58007c9eba2b51003ff813a8bfe65ae25e8392.zip |
replace the compile time checks used for the old particle attributes with runtime ones
Diffstat (limited to '')
-rw-r--r-- | Source/Particles/RigidInjectedParticleContainer.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/Particles/RigidInjectedParticleContainer.cpp b/Source/Particles/RigidInjectedParticleContainer.cpp index 3ee4d87e5..a5acca281 100644 --- a/Source/Particles/RigidInjectedParticleContainer.cpp +++ b/Source/Particles/RigidInjectedParticleContainer.cpp @@ -225,20 +225,20 @@ RigidInjectedParticleContainer::PushPX(WarpXParIter& pti, auto& Bzp = attribs[PIdx::Bz]; const long np = pti.numParticles(); -#ifdef WARPX_STORE_OLD_PARTICLE_ATTRIBS - auto& xpold = attribs[PIdx::xold]; - auto& ypold = attribs[PIdx::yold]; - auto& zpold = attribs[PIdx::zold]; - auto& uxpold = attribs[PIdx::uxold]; - auto& uypold = attribs[PIdx::uyold]; - auto& uzpold = attribs[PIdx::uzold]; - - warpx_copy_attribs(&np, xp.dataPtr(), yp.dataPtr(), zp.dataPtr(), - uxp.dataPtr(), uyp.dataPtr(), uzp.dataPtr(), - xpold.dataPtr(), ypold.dataPtr(), zpold.dataPtr(), - uxpold.dataPtr(), uypold.dataPtr(), uzpold.dataPtr()); - -#endif + if (WarpX::do_boosted_frame_diagnostic && WarpX::do_boosted_frame_particles) + { + auto& xpold = pti.GetAttribs(particle_comps["xold"]); + auto& ypold = pti.GetAttribs(particle_comps["yold"]); + auto& zpold = pti.GetAttribs(particle_comps["zold"]); + auto& uxpold = pti.GetAttribs(particle_comps["uxold"]); + auto& uypold = pti.GetAttribs(particle_comps["uyold"]); + auto& uzpold = pti.GetAttribs(particle_comps["uzold"]); + + warpx_copy_attribs(&np, xp.dataPtr(), yp.dataPtr(), zp.dataPtr(), + uxp.dataPtr(), uyp.dataPtr(), uzp.dataPtr(), + xpold.dataPtr(), ypold.dataPtr(), zpold.dataPtr(), + uxpold.dataPtr(), uypold.dataPtr(), uzpold.dataPtr()); + } // Save the position and momenta, making copies Cuda::ManagedDeviceVector<Real> xp_save, yp_save, zp_save; |