diff options
author | 2020-01-27 13:42:39 -0800 | |
---|---|---|
committer | 2020-01-27 13:42:39 -0800 | |
commit | 4b4f13857bd4fd623096a367b784e30fe15a8810 (patch) | |
tree | 7889b9ca59ed8e6eb43ec50261d6b76f3bcb0080 /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 1080fc43778ac92174a2ed94750a3b14673b14a3 (diff) | |
download | WarpX-4b4f13857bd4fd623096a367b784e30fe15a8810.tar.gz WarpX-4b4f13857bd4fd623096a367b784e30fe15a8810.tar.zst WarpX-4b4f13857bd4fd623096a367b784e30fe15a8810.zip |
remove the copies between soa and aos for the particle positions
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 191 |
1 files changed, 73 insertions, 118 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 7ac887b85..36e823d5f 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -969,10 +969,7 @@ PhysicalParticleContainer::EvolveES (const Vector<std::array<std::unique_ptr<Mul void PhysicalParticleContainer::AssignExternalFieldOnParticles(WarpXParIter& pti, RealVector& Exp, RealVector& Eyp, RealVector& Ezp, - RealVector& Bxp, RealVector& Byp, RealVector& Bzp, - const Gpu::ManagedDeviceVector<ParticleReal>& xp, - const Gpu::ManagedDeviceVector<ParticleReal>& yp, - const Gpu::ManagedDeviceVector<ParticleReal>& zp, int lev) + RealVector& Bxp, RealVector& Byp, RealVector& Bzp, int lev) { const long np = pti.numParticles(); /// get WarpX class object @@ -992,9 +989,8 @@ PhysicalParticleContainer::AssignExternalFieldOnParticles(WarpXParIter& pti, Bzp.assign(np,mypc.m_B_external_particle[2]); } if (mypc.m_E_ext_particle_s=="parse_e_ext_particle_function") { - const Real* const AMREX_RESTRICT xp_data = xp.dataPtr(); - const Real* const AMREX_RESTRICT yp_data = yp.dataPtr(); - const Real* const AMREX_RESTRICT zp_data = zp.dataPtr(); + const auto& aos = pti.GetArrayOfStructs(); + const ParticleType* const AMREX_RESTRICT pstruct = aos().dataPtr(); Real* const AMREX_RESTRICT Exp_data = Exp.dataPtr(); Real* const AMREX_RESTRICT Eyp_data = Eyp.dataPtr(); Real* const AMREX_RESTRICT Ezp_data = Ezp.dataPtr(); @@ -1004,9 +1000,9 @@ PhysicalParticleContainer::AssignExternalFieldOnParticles(WarpXParIter& pti, Real time = warpx.gett_new(lev); amrex::ParallelFor(pti.numParticles(), [=] AMREX_GPU_DEVICE (long i) { - Exp_data[i] = xfield_partparser->getField(xp_data[i],yp_data[i],zp_data[i],time); - Eyp_data[i] = yfield_partparser->getField(xp_data[i],yp_data[i],zp_data[i],time); - Ezp_data[i] = zfield_partparser->getField(xp_data[i],yp_data[i],zp_data[i],time); + Exp_data[i] = xfield_partparser->getField(pstruct[i],time); + Eyp_data[i] = yfield_partparser->getField(pstruct[i],time); + Ezp_data[i] = zfield_partparser->getField(pstruct[i],time); }, /* To allocate shared memory for the GPU threads. */ /* But, for now only 4 doubles (x,y,z,t) are allocated. */ @@ -1014,9 +1010,8 @@ PhysicalParticleContainer::AssignExternalFieldOnParticles(WarpXParIter& pti, ); } if (mypc.m_B_ext_particle_s=="parse_b_ext_particle_function") { - const Real* const AMREX_RESTRICT xp_data = xp.dataPtr(); - const Real* const AMREX_RESTRICT yp_data = yp.dataPtr(); - const Real* const AMREX_RESTRICT zp_data = zp.dataPtr(); + const auto& aos = pti.GetArrayOfStructs(); + const ParticleType* const AMREX_RESTRICT pstruct = aos().dataPtr(); Real* const AMREX_RESTRICT Bxp_data = Bxp.dataPtr(); Real* const AMREX_RESTRICT Byp_data = Byp.dataPtr(); Real* const AMREX_RESTRICT Bzp_data = Bzp.dataPtr(); @@ -1026,9 +1021,9 @@ PhysicalParticleContainer::AssignExternalFieldOnParticles(WarpXParIter& pti, Real time = warpx.gett_new(lev); amrex::ParallelFor(pti.numParticles(), [=] AMREX_GPU_DEVICE (long i) { - Bxp_data[i] = xfield_partparser->getField(xp_data[i],yp_data[i],zp_data[i],time); - Byp_data[i] = yfield_partparser->getField(xp_data[i],yp_data[i],zp_data[i],time); - Bzp_data[i] = zfield_partparser->getField(xp_data[i],yp_data[i],zp_data[i],time); + Bxp_data[i] = xfield_partparser->getField(pstruct[i],time); + Byp_data[i] = yfield_partparser->getField(pstruct[i],time); + Bzp_data[i] = zfield_partparser->getField(pstruct[i],time); }, /* To allocate shared memory for the GPU threads. */ /* But, for now only 4 doubles (x,y,z,t) are allocated. */ @@ -1089,11 +1084,6 @@ PhysicalParticleContainer::FieldGather (int lev, const FArrayBox& bzfab = Bz[pti]; // - // copy data from particle container to temp arrays - // - pti.GetPosition(m_xp[thread_num], m_yp[thread_num], m_zp[thread_num]); - - // // Field Gather // int e_is_nodal = Ex.is_nodal() and Ey.is_nodal() and Ez.is_nodal(); @@ -1237,13 +1227,6 @@ PhysicalParticleContainer::Evolve (int lev, const long np_current = (cjx) ? nfine_current : np; - // - // copy data from particle container to temp arrays - // - BL_PROFILE_VAR_START(blp_copy); - pti.GetPosition(m_xp[thread_num], m_yp[thread_num], m_zp[thread_num]); - BL_PROFILE_VAR_STOP(blp_copy); - if (rho) { // Deposit charge before particle push, in component 0 of MultiFab rho. int* AMREX_RESTRICT ion_lev; @@ -1327,7 +1310,7 @@ PhysicalParticleContainer::Evolve (int lev, // Particle Push // BL_PROFILE_VAR_START(blp_ppc_pp); - PushPX(pti, m_xp[thread_num], m_yp[thread_num], m_zp[thread_num], dt, a_dt_type); + PushPX(pti, dt, a_dt_type); BL_PROFILE_VAR_STOP(blp_ppc_pp); // @@ -1351,14 +1334,6 @@ PhysicalParticleContainer::Evolve (int lev, np_current, np-np_current, thread_num, lev, lev-1, dt); } - - - // - // copy particle data back - // - BL_PROFILE_VAR_START(blp_copy); - pti.SetPosition(m_xp[thread_num], m_yp[thread_num], m_zp[thread_num]); - BL_PROFILE_VAR_STOP(blp_copy); } if (rho) { @@ -1477,7 +1452,6 @@ PhysicalParticleContainer::SplitParticles(int lev) { auto& mypc = WarpX::GetInstance().GetPartContainer(); auto& pctmp_split = mypc.GetPCtmp(); - Gpu::ManagedDeviceVector<ParticleReal> xp, yp, zp; RealVector psplit_x, psplit_y, psplit_z, psplit_w; RealVector psplit_ux, psplit_uy, psplit_uz; long np_split_to_add = 0; @@ -1492,8 +1466,9 @@ PhysicalParticleContainer::SplitParticles(int lev) // Loop over particle interator for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { - pti.GetPosition(xp, yp, zp); - + const auto& aos = pti.GetArrayOfStructs(); + const ParticleType* AMREX_RESTRICT pstruct = aos().dataPtr(); + const amrex::Vector<int> ppc_nd = plasma_injector->num_particles_per_cell_each_dim; const std::array<Real,3>& dx = WarpX::CellSize(lev); amrex::Vector<Real> split_offset = {dx[0]/2._rt, @@ -1529,9 +1504,9 @@ PhysicalParticleContainer::SplitParticles(int lev) for (int ishift = -1; ishift < 2; ishift +=2 ){ for (int kshift = -1; kshift < 2; kshift +=2 ){ // Add one particle with offset in x and z - psplit_x.push_back( xp[i] + ishift*split_offset[0] ); - psplit_y.push_back( yp[i] ); - psplit_z.push_back( zp[i] + kshift*split_offset[2] ); + psplit_x.push_back( pstruct[i].pos(0) + ishift*split_offset[0] ); + psplit_y.push_back( pstruct[i].pos(1) ); + psplit_z.push_back( pstruct[i].pos(2) + kshift*split_offset[2] ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); @@ -1543,17 +1518,17 @@ PhysicalParticleContainer::SplitParticles(int lev) // 4 particles in 2d for (int ishift = -1; ishift < 2; ishift +=2 ){ // Add one particle with offset in x - psplit_x.push_back( xp[i] + ishift*split_offset[0] ); - psplit_y.push_back( yp[i] ); - psplit_z.push_back( zp[i] ); + psplit_x.push_back( pstruct[i].pos(0) + ishift*split_offset[0] ); + psplit_y.push_back( pstruct[i].pos(1) ); + psplit_z.push_back( pstruct[i].pos(2) ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); psplit_w.push_back( wp[i]/np_split ); // Add one particle with offset in z - psplit_x.push_back( xp[i] ); - psplit_y.push_back( yp[i] ); - psplit_z.push_back( zp[i] + ishift*split_offset[2] ); + psplit_x.push_back( pstruct[i].pos(0) ); + psplit_y.push_back( pstruct[i].pos(1) ); + psplit_z.push_back( pstruct[i].pos(2) + ishift*split_offset[2] ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); @@ -1568,9 +1543,9 @@ PhysicalParticleContainer::SplitParticles(int lev) for (int jshift = -1; jshift < 2; jshift +=2 ){ for (int kshift = -1; kshift < 2; kshift +=2 ){ // Add one particle with offset in x, y and z - psplit_x.push_back( xp[i] + ishift*split_offset[0] ); - psplit_y.push_back( yp[i] + jshift*split_offset[1] ); - psplit_z.push_back( zp[i] + kshift*split_offset[2] ); + psplit_x.push_back( pstruct[i].pos(0) + ishift*split_offset[0] ); + psplit_y.push_back( pstruct[i].pos(1) + jshift*split_offset[1] ); + psplit_z.push_back( pstruct[i].pos(2) + kshift*split_offset[2] ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); @@ -1583,25 +1558,25 @@ PhysicalParticleContainer::SplitParticles(int lev) // 6 particles in 3d for (int ishift = -1; ishift < 2; ishift +=2 ){ // Add one particle with offset in x - psplit_x.push_back( xp[i] + ishift*split_offset[0] ); - psplit_y.push_back( yp[i] ); - psplit_z.push_back( zp[i] ); + psplit_x.push_back( pstruct[i].pos(0) + ishift*split_offset[0] ); + psplit_y.push_back( pstruct[i].pos(1) ); + psplit_z.push_back( pstruct[i].pos(2) ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); psplit_w.push_back( wp[i]/np_split ); // Add one particle with offset in y - psplit_x.push_back( xp[i] ); - psplit_y.push_back( yp[i] + ishift*split_offset[1] ); - psplit_z.push_back( zp[i] ); + psplit_x.push_back( pstruct[i].pos(0) ); + psplit_y.push_back( pstruct[i].pos(1) + ishift*split_offset[1] ); + psplit_z.push_back( pstruct[i].pos(2) ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); psplit_w.push_back( wp[i]/np_split ); // Add one particle with offset in z - psplit_x.push_back( xp[i] ); - psplit_y.push_back( yp[i] ); - psplit_z.push_back( zp[i] + ishift*split_offset[2] ); + psplit_x.push_back( pstruct[i].pos(0) ); + psplit_y.push_back( pstruct[i].pos(1) ); + psplit_z.push_back( pstruct[i].pos(2) + ishift*split_offset[2] ); psplit_ux.push_back( uxp[i] ); psplit_uy.push_back( uyp[i] ); psplit_uz.push_back( uzp[i] ); @@ -1638,19 +1613,16 @@ PhysicalParticleContainer::SplitParticles(int lev) } void -PhysicalParticleContainer::PushPX(WarpXParIter& pti, - Gpu::ManagedDeviceVector<ParticleReal>& xp, - Gpu::ManagedDeviceVector<ParticleReal>& yp, - Gpu::ManagedDeviceVector<ParticleReal>& zp, - Real dt, DtType a_dt_type) +PhysicalParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_type) { // 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 - ParticleReal* const AMREX_RESTRICT x = xp.dataPtr(); - ParticleReal* const AMREX_RESTRICT y = yp.dataPtr(); - ParticleReal* const AMREX_RESTRICT z = zp.dataPtr(); + + auto& aos = pti.GetArrayOfStructs(); + ParticleType* AMREX_RESTRICT const pstruct = aos().dataPtr(); + ParticleReal* const AMREX_RESTRICT ux = attribs[PIdx::ux].dataPtr(); ParticleReal* const AMREX_RESTRICT uy = attribs[PIdx::uy].dataPtr(); ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr(); @@ -1663,7 +1635,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics && (a_dt_type!=DtType::SecondHalf)) { - copy_attribs(pti, x, y, z); + copy_attribs(pti, pstruct); } int* AMREX_RESTRICT ion_lev = nullptr; @@ -1696,8 +1668,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, Ex[i], Ey[i], Ez[i], Bx[i], By[i], Bz[i], q, m, dt); } - UpdatePosition( x[i], y[i], z[i], - ux[i], uy[i], uz[i], dt ); + UpdatePosition( pstruct[i], ux[i], uy[i], uz[i], dt ); } ); }else{ @@ -1707,8 +1678,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, UpdateMomentumBorisWithRadiationReaction( ux[i], uy[i], uz[i], Ex[i], Ey[i], Ez[i], Bx[i], By[i], Bz[i], q, m, dt); - UpdatePosition( x[i], y[i], z[i], - ux[i], uy[i], uz[i], dt ); + UpdatePosition( pstruct[i], ux[i], uy[i], uz[i], dt ); } ); } @@ -1722,7 +1692,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, UpdateMomentumBorisWithRadiationReaction( ux[i], uy[i], uz[i], Ex[i], Ey[i], Ez[i], Bx[i], By[i], Bz[i], qp, m, dt); - UpdatePosition( x[i], y[i], z[i], + UpdatePosition( pstruct[i], ux[i], uy[i], uz[i], dt ); } ); @@ -1736,7 +1706,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, UpdateMomentumBoris( ux[i], uy[i], uz[i], Ex[i], Ey[i], Ez[i], Bx[i], By[i], Bz[i], qp, m, dt); - UpdatePosition( x[i], y[i], z[i], + UpdatePosition( pstruct[i], ux[i], uy[i], uz[i], dt ); } ); @@ -1749,7 +1719,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, UpdateMomentumVay( ux[i], uy[i], uz[i], Ex[i], Ey[i], Ez[i], Bx[i], By[i], Bz[i], qp, m, dt); - UpdatePosition( x[i], y[i], z[i], + UpdatePosition( pstruct[i], ux[i], uy[i], uz[i], dt ); } ); @@ -1762,7 +1732,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, UpdateMomentumHigueraCary( ux[i], uy[i], uz[i], Ex[i], Ey[i], Ez[i], Bx[i], By[i], Bz[i], qp, m, dt); - UpdatePosition( x[i], y[i], z[i], + UpdatePosition( pstruct[i], ux[i], uy[i], uz[i], dt ); } ); @@ -1857,11 +1827,6 @@ PhysicalParticleContainer::PushP (int lev, Real dt, const FArrayBox& byfab = By[pti]; const FArrayBox& bzfab = Bz[pti]; - // - // copy data from particle container to temp arrays - // - pti.GetPosition(m_xp[thread_num], m_yp[thread_num], m_zp[thread_num]); - int e_is_nodal = Ex.is_nodal() and Ey.is_nodal() and Ez.is_nodal(); FieldGather(pti, Exp, Eyp, Ezp, Bxp, Byp, Bzp, &exfab, &eyfab, &ezfab, &bxfab, &byfab, &bzfab, @@ -1943,8 +1908,7 @@ PhysicalParticleContainer::PushP (int lev, Real dt, } } -void PhysicalParticleContainer::copy_attribs(WarpXParIter& pti,const ParticleReal* xp, - const ParticleReal* yp, const ParticleReal* zp) +void PhysicalParticleContainer::copy_attribs (WarpXParIter& pti, const ParticleType* pstruct) { auto& attribs = pti.GetAttribs(); ParticleReal* AMREX_RESTRICT uxp = attribs[PIdx::ux].dataPtr(); @@ -1963,9 +1927,9 @@ void PhysicalParticleContainer::copy_attribs(WarpXParIter& pti,const ParticleRea ParallelFor( np, [=] AMREX_GPU_DEVICE (long i) { - xpold[i]=xp[i]; - ypold[i]=yp[i]; - zpold[i]=zp[i]; + xpold[i]=pstruct[i].pos(0); + ypold[i]=pstruct[i].pos(1); + zpold[i]=pstruct[i].pos(2); uxpold[i]=uxp[i]; uypold[i]=uyp[i]; @@ -2036,10 +2000,8 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real if ( !slice_box.intersects(tile_real_box) ) continue; - pti.GetPosition(m_xp[thread_num],m_yp[thread_num],m_zp[thread_num]); - Real *const AMREX_RESTRICT xpnew = m_xp[thread_num].dataPtr(); - Real *const AMREX_RESTRICT ypnew = m_yp[thread_num].dataPtr(); - Real *const AMREX_RESTRICT zpnew = m_zp[thread_num].dataPtr(); + const auto& aos = pti.GetArrayOfStructs(); + const ParticleType* AMREX_RESTRICT pstruct = aos().dataPtr(); auto& attribs = pti.GetAttribs(); Real* const AMREX_RESTRICT wpnew = attribs[PIdx::w].dataPtr(); @@ -2078,8 +2040,8 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real [=] AMREX_GPU_DEVICE(int i) { Flag[i] = 0; - if ( (((zpnew[i] >= z_new) && (zpold[i] <= z_old)) || - ((zpnew[i] <= z_new) && (zpold[i] >= z_old))) ) + if ( (((pstruct[i].pos(2) >= z_new) && (zpold[i] <= z_old)) || + ((pstruct[i].pos(2) <= z_new) && (zpold[i] >= z_old))) ) { Flag[i] = 1; } @@ -2126,12 +2088,10 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real (uxpnew[i]*uxpnew[i] + uypnew[i]*uypnew[i] + uzpnew[i]*uzpnew[i])); - const Real t_new_p = gammaboost*t_boost - - uzfrm*zpnew[i]*inv_c2; - const Real z_new_p = gammaboost*(zpnew[i] - + betaboost*Phys_c*t_boost); - const Real uz_new_p = gammaboost*uzpnew[i] - - gamma_new_p*uzfrm; + const Real t_new_p = gammaboost*t_boost - uzfrm*pstruct[i].pos(2)*inv_c2; + const Real z_new_p = gammaboost*(pstruct[i].pos(2) + betaboost*Phys_c*t_boost); + const Real uz_new_p = gammaboost*uzpnew[i] - gamma_new_p*uzfrm; + const Real gamma_old_p = std::sqrt(1.0 + inv_c2* (uxpold[i]*uxpold[i] + uypold[i]*uypold[i] @@ -2149,12 +2109,10 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real const Real weight_new = (t_lab - t_old_p) / (t_new_p - t_old_p); - const Real xp = xpold[i]*weight_old - + xpnew[i]*weight_new; - const Real yp = ypold[i]*weight_old - + ypnew[i]*weight_new; - const Real zp = z_old_p*weight_old - + z_new_p*weight_new; + const Real xp = xpold[i]*weight_old + pstruct[i].pos(0)*weight_new; + const Real yp = ypold[i]*weight_old + pstruct[i].pos(1)*weight_new; + const Real zp = z_old_p*weight_old + z_new_p*weight_new; + const Real uxp = uxpold[i]*weight_old + uxpnew[i]*weight_new; const Real uyp = uypold[i]*weight_old @@ -2230,9 +2188,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, // initializing the field value to the externally applied field before // gathering fields from the grid to the particles. - AssignExternalFieldOnParticles(pti, Exp, Eyp, Ezp, Bxp, Byp, Bzp, - m_xp[thread_num], m_yp[thread_num], - m_zp[thread_num], lev); + AssignExternalFieldOnParticles(pti, Exp, Eyp, Ezp, Bxp, Byp, Bzp, lev); // Get cell size on gather_lev @@ -2251,9 +2207,8 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, // Add guard cells to the box. box.grow(ngE); - const ParticleReal * const AMREX_RESTRICT xp = m_xp[thread_num].dataPtr() + offset; - const ParticleReal * const AMREX_RESTRICT zp = m_zp[thread_num].dataPtr() + offset; - const ParticleReal * const AMREX_RESTRICT yp = m_yp[thread_num].dataPtr() + offset; + const auto& aos = pti.GetArrayOfStructs(); + const ParticleType* AMREX_RESTRICT pstruct = aos().dataPtr() + offset; // Lower corner of tile box physical domain const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(box, gather_lev); @@ -2264,7 +2219,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, // different versions of template function doGatherShapeN if (WarpX::l_lower_order_in_v){ if (WarpX::nox == 1){ - doGatherShapeN<1,1>(xp, yp, zp, + doGatherShapeN<1,1>(pstruct, Exp.dataPtr() + offset, Eyp.dataPtr() + offset, Ezp.dataPtr() + offset, Bxp.dataPtr() + offset, Byp.dataPtr() + offset, Bzp.dataPtr() + offset, @@ -2272,7 +2227,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, np_to_gather, dx, xyzmin, lo, WarpX::n_rz_azimuthal_modes); } else if (WarpX::nox == 2){ - doGatherShapeN<2,1>(xp, yp, zp, + doGatherShapeN<2,1>(pstruct, Exp.dataPtr() + offset, Eyp.dataPtr() + offset, Ezp.dataPtr() + offset, Bxp.dataPtr() + offset, Byp.dataPtr() + offset, Bzp.dataPtr() + offset, @@ -2280,7 +2235,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, np_to_gather, dx, xyzmin, lo, WarpX::n_rz_azimuthal_modes); } else if (WarpX::nox == 3){ - doGatherShapeN<3,1>(xp, yp, zp, + doGatherShapeN<3,1>(pstruct, Exp.dataPtr() + offset, Eyp.dataPtr() + offset, Ezp.dataPtr() + offset, Bxp.dataPtr() + offset, Byp.dataPtr() + offset, Bzp.dataPtr() + offset, @@ -2290,7 +2245,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, } } else { if (WarpX::nox == 1){ - doGatherShapeN<1,0>(xp, yp, zp, + doGatherShapeN<1,0>(pstruct, Exp.dataPtr() + offset, Eyp.dataPtr() + offset, Ezp.dataPtr() + offset, Bxp.dataPtr() + offset, Byp.dataPtr() + offset, Bzp.dataPtr() + offset, @@ -2298,7 +2253,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, np_to_gather, dx, xyzmin, lo, WarpX::n_rz_azimuthal_modes); } else if (WarpX::nox == 2){ - doGatherShapeN<2,0>(xp, yp, zp, + doGatherShapeN<2,0>(pstruct, Exp.dataPtr() + offset, Eyp.dataPtr() + offset, Ezp.dataPtr() + offset, Bxp.dataPtr() + offset, Byp.dataPtr() + offset, Bzp.dataPtr() + offset, @@ -2306,7 +2261,7 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, np_to_gather, dx, xyzmin, lo, WarpX::n_rz_azimuthal_modes); } else if (WarpX::nox == 3){ - doGatherShapeN<3,0>(xp, yp, zp, + doGatherShapeN<3,0>(pstruct, Exp.dataPtr() + offset, Eyp.dataPtr() + offset, Ezp.dataPtr() + offset, Bxp.dataPtr() + offset, Byp.dataPtr() + offset, Bzp.dataPtr() + offset, |