diff options
author | 2019-05-02 11:21:13 -0700 | |
---|---|---|
committer | 2019-05-02 11:21:13 -0700 | |
commit | 4f3003521c4f2fe8c8a64b33cc4d56ebb1c5db7c (patch) | |
tree | 723c529f1b7a24f86c606fa30479cd43708aedac /Source/Particles/RigidInjectedParticleContainer.cpp | |
parent | 5c8e911b1569d5015b2153fba05fbd2d798cc392 (diff) | |
parent | 341cd1b2af8ae96f261f7979c1dcf126f424cf60 (diff) | |
download | WarpX-4f3003521c4f2fe8c8a64b33cc4d56ebb1c5db7c.tar.gz WarpX-4f3003521c4f2fe8c8a64b33cc4d56ebb1c5db7c.tar.zst WarpX-4f3003521c4f2fe8c8a64b33cc4d56ebb1c5db7c.zip |
fix conflicts
Diffstat (limited to 'Source/Particles/RigidInjectedParticleContainer.cpp')
-rw-r--r-- | Source/Particles/RigidInjectedParticleContainer.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/Source/Particles/RigidInjectedParticleContainer.cpp b/Source/Particles/RigidInjectedParticleContainer.cpp index db3623705..a5acca281 100644 --- a/Source/Particles/RigidInjectedParticleContainer.cpp +++ b/Source/Particles/RigidInjectedParticleContainer.cpp @@ -73,7 +73,7 @@ RigidInjectedParticleContainer::RemapParticles() // Note that the particles are already in the boosted frame. // This value is saved to advance the particles not injected yet - Cuda::DeviceVector<Real> xp, yp, zp; + Cuda::ManagedDeviceVector<Real> xp, yp, zp; for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { @@ -134,7 +134,7 @@ RigidInjectedParticleContainer::BoostandRemapParticles() #pragma omp parallel #endif { - Cuda::DeviceVector<Real> xp, yp, zp; + Cuda::ManagedDeviceVector<Real> xp, yp, zp; for (WarpXParIter pti(*this, 0); pti.isValid(); ++pti) { @@ -205,10 +205,10 @@ RigidInjectedParticleContainer::BoostandRemapParticles() void RigidInjectedParticleContainer::PushPX(WarpXParIter& pti, - Cuda::DeviceVector<Real>& xp, - Cuda::DeviceVector<Real>& yp, - Cuda::DeviceVector<Real>& zp, - Cuda::DeviceVector<Real>& giv, + Cuda::ManagedDeviceVector<Real>& xp, + Cuda::ManagedDeviceVector<Real>& yp, + Cuda::ManagedDeviceVector<Real>& zp, + Cuda::ManagedDeviceVector<Real>& giv, Real dt) { @@ -225,23 +225,23 @@ 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::DeviceVector<Real> xp_save, yp_save, zp_save; + Cuda::ManagedDeviceVector<Real> xp_save, yp_save, zp_save; RealVector uxp_save, uyp_save, uzp_save; if (!done_injecting_lev) { @@ -362,7 +362,7 @@ RigidInjectedParticleContainer::PushP (int lev, Real dt, #pragma omp parallel #endif { - Cuda::DeviceVector<Real> xp, yp, zp, giv; + Cuda::ManagedDeviceVector<Real> xp, yp, zp, giv; for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { |