aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.H')
-rw-r--r--Source/Particles/WarpXParticleContainer.H46
1 files changed, 35 insertions, 11 deletions
diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H
index 924980f81..050060b47 100644
--- a/Source/Particles/WarpXParticleContainer.H
+++ b/Source/Particles/WarpXParticleContainer.H
@@ -30,6 +30,30 @@ struct DiagIdx
};
};
+namespace ParticleStringNames
+{
+ const std::map<std::string, int> to_index = {
+ {"w", PIdx::w },
+ {"ux", PIdx::ux },
+ {"uy", PIdx::uy },
+ {"uz", PIdx::uz },
+ {"Ex", PIdx::Ex },
+ {"Ey", PIdx::Ey },
+ {"Ez", PIdx::Ez },
+ {"Bx", PIdx::Bx },
+ {"By", PIdx::By },
+ {"Bz", PIdx::Bz },
+#ifdef WARPX_STORE_OLD_PARTICLE_ATTRIBS
+ {"xold", PIdx::xold },
+ {"yold", PIdx::yold },
+ {"zold", PIdx::zold },
+ {"uxold", PIdx::uxold},
+ {"uyold", PIdx::uyold},
+ {"uzold", PIdx::uzold},
+#endif
+ };
+}
+
class WarpXParIter
: public amrex::ParIter<0,0,PIdx::nattribs>
{
@@ -39,12 +63,12 @@ public:
WarpXParIter (ContainerType& pc, int level);
#if (AMREX_SPACEDIM == 2)
- void GetPosition (amrex::Cuda::DeviceVector<amrex::Real>& x,
- amrex::Cuda::DeviceVector<amrex::Real>& y,
- amrex::Cuda::DeviceVector<amrex::Real>& z) const;
- void SetPosition (const amrex::Cuda::DeviceVector<amrex::Real>& x,
- const amrex::Cuda::DeviceVector<amrex::Real>& y,
- const amrex::Cuda::DeviceVector<amrex::Real>& z);
+ void GetPosition (amrex::Cuda::ManagedDeviceVector<amrex::Real>& x,
+ amrex::Cuda::ManagedDeviceVector<amrex::Real>& y,
+ amrex::Cuda::ManagedDeviceVector<amrex::Real>& z) const;
+ void SetPosition (const amrex::Cuda::ManagedDeviceVector<amrex::Real>& x,
+ const amrex::Cuda::ManagedDeviceVector<amrex::Real>& y,
+ const amrex::Cuda::ManagedDeviceVector<amrex::Real>& z);
#endif
const std::array<RealVector, PIdx::nattribs>& GetAttribs () const {
@@ -218,12 +242,12 @@ protected:
static int do_not_push;
- amrex::Vector<std::unique_ptr<amrex::FArrayBox> > local_rho;
- amrex::Vector<std::unique_ptr<amrex::FArrayBox> > local_jx;
- amrex::Vector<std::unique_ptr<amrex::FArrayBox> > local_jy;
- amrex::Vector<std::unique_ptr<amrex::FArrayBox> > local_jz;
+ amrex::Vector<amrex::FArrayBox> local_rho;
+ amrex::Vector<amrex::FArrayBox> local_jx;
+ amrex::Vector<amrex::FArrayBox> local_jy;
+ amrex::Vector<amrex::FArrayBox> local_jz;
- amrex::Vector<amrex::Cuda::DeviceVector<amrex::Real> > m_xp, m_yp, m_zp, m_giv;
+ amrex::Vector<amrex::Cuda::ManagedDeviceVector<amrex::Real> > m_xp, m_yp, m_zp, m_giv;
private:
virtual void particlePostLocate(ParticleType& p, const amrex::ParticleLocData& pld,