aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/RigidInjectedParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/RigidInjectedParticleContainer.cpp')
-rw-r--r--Source/Particles/RigidInjectedParticleContainer.cpp44
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)
{