diff options
Diffstat (limited to 'Source/Particles/PhotonParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhotonParticleContainer.cpp | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index 31a62b739..95423e365 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -11,6 +11,9 @@ #include <WarpX.H> #include <WarpXConst.H> +// Import low-level single-particle kernels +#include <UpdatePositionPhoton.H> + using namespace amrex; PhotonParticleContainer::PhotonParticleContainer (AmrCore* amr_core, int ispecies, @@ -26,10 +29,6 @@ PhotonParticleContainer::PhotonParticleContainer (AmrCore* amr_core, int ispecie // store it into member data. pp.query("size_in_inches", size_in_inches); -#ifdef WARPX_QED - AddRealComp("tau"); - plot_flags.resize(PIdx::nattribs + 1, 1); -#endif } @@ -50,6 +49,40 @@ PhotonParticleContainer::PushPX(WarpXParIter& pti, Cuda::ManagedDeviceVector<Real>& giv, Real dt) { + + // This wraps the momentum and position advance so that inheritors can modify the call. + auto& attribs = pti.GetAttribs(); + // Extract pointers to the different particle quantities + Real* const AMREX_RESTRICT x = xp.dataPtr(); + Real* const AMREX_RESTRICT y = yp.dataPtr(); + Real* const AMREX_RESTRICT z = zp.dataPtr(); + Real* const AMREX_RESTRICT gi = giv.dataPtr(); + Real* const AMREX_RESTRICT ux = attribs[PIdx::ux].dataPtr(); + Real* const AMREX_RESTRICT uy = attribs[PIdx::uy].dataPtr(); + Real* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr(); + const Real* const AMREX_RESTRICT Ex = attribs[PIdx::Ex].dataPtr(); + const Real* const AMREX_RESTRICT Ey = attribs[PIdx::Ey].dataPtr(); + const Real* const AMREX_RESTRICT Ez = attribs[PIdx::Ez].dataPtr(); + const Real* const AMREX_RESTRICT Bx = attribs[PIdx::Bx].dataPtr(); + const Real* const AMREX_RESTRICT By = attribs[PIdx::By].dataPtr(); + const Real* const AMREX_RESTRICT Bz = attribs[PIdx::Bz].dataPtr(); + + if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags) + { + copy_attribs(pti, x, y, z); + } + + //No need to update momentum for photons (for now) + + amrex::ParallelFor( + pti.numParticles(), + [=] AMREX_GPU_DEVICE (long i) { + + UpdatePositionPhoton( x[i], y[i], z[i], + ux[i], uy[i], uz[i], dt ); + } + ); + } void @@ -76,17 +109,5 @@ PhotonParticleContainer::Evolve (int lev, cEx, cEy, cEz, cBx, cBy, cBz, t, dt); - } - -#ifdef WARPX_QED -void PhotonParticleContainer::InitOpticalDepth( - WarpXParIter& pti, - warpx_breit_wheeler_engine& engine) -{ - auto& taus = pti.GetAttribs(particle_comps["tau"]); - for(auto& tau: taus) - tau = engine.get_optical_depth(); -} -#endif |