From 679156e73e537284b97e642ef13f9d784b44f264 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Mon, 3 Jun 2019 10:45:35 +0200 Subject: Added dedicated pusher to photons --- Source/Particles/PhotonParticleContainer.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'Source/Particles/PhotonParticleContainer.cpp') diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index b4070a773..0e1adc13b 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -22,7 +22,7 @@ PhotonParticleContainer::PhotonParticleContainer (AmrCore* amr_core, int ispecie // where is the name of your species ParmParse pp(species_name); - // read .size_in_inches in the input file, and + // read .size_in_inches in the input file, and // store it into member data. pp.query("size_in_inches", size_in_inches); @@ -56,13 +56,20 @@ PhotonParticleContainer::PushPX(WarpXParIter& pti, auto& Byp = attribs[PIdx::By]; auto& Bzp = attribs[PIdx::Bz]; const long np = pti.numParticles(); - - // Probably want to push photons in some way here. - // PhysicalParticleContainer::PushPX is probably - // a good start. Let's start by writing CPU code. - for (WarpXParIter pti(*this, 0); pti.isValid(); ++pti) - { - } + + // Using new pusher for positions + const amrex_real zero_mass = 0.0; + const amrex_real zero_charge = 0.0; + warpx_particle_pusher_positions(&np, + xp.dataPtr(), + yp.dataPtr(), + zp.dataPtr(), + uxp.dataPtr(), uyp.dataPtr(), uzp.dataPtr(), + giv.dataPtr(), + Exp.dataPtr(), Eyp.dataPtr(), Ezp.dataPtr(), + Bxp.dataPtr(), Byp.dataPtr(), Bzp.dataPtr(), + &zero_charge, &zero_mass, &dt, + &WarpX::particle_pusher_algo); } void @@ -77,7 +84,7 @@ PhotonParticleContainer::Evolve (int lev, Real t, Real dt) { // This does gather, push and depose. - // Push and depose have been re-written for photon, + // Push and depose have been re-written for photon, // so they do not do anything. // Currently, I guess photons do gather fields from the mesh. PhysicalParticleContainer::Evolve (lev, -- cgit v1.2.3