diff options
author | 2020-01-29 12:54:42 -0800 | |
---|---|---|
committer | 2020-01-29 12:54:42 -0800 | |
commit | 1b3a5b73df4937559ee76fbbb189f88c661df54e (patch) | |
tree | 6a486ec1e753fb9126ed572e6750397bd7b12cff /Source/Particles/RigidInjectedParticleContainer.cpp | |
parent | 4f2cbd2f3525d9f97aeeb00d0a205ab271135235 (diff) | |
download | WarpX-1b3a5b73df4937559ee76fbbb189f88c661df54e.tar.gz WarpX-1b3a5b73df4937559ee76fbbb189f88c661df54e.tar.zst WarpX-1b3a5b73df4937559ee76fbbb189f88c661df54e.zip |
rename get/set particle position functors
Diffstat (limited to 'Source/Particles/RigidInjectedParticleContainer.cpp')
-rw-r--r-- | Source/Particles/RigidInjectedParticleContainer.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/Particles/RigidInjectedParticleContainer.cpp b/Source/Particles/RigidInjectedParticleContainer.cpp index 692b1f287..eb1677194 100644 --- a/Source/Particles/RigidInjectedParticleContainer.cpp +++ b/Source/Particles/RigidInjectedParticleContainer.cpp @@ -86,15 +86,15 @@ RigidInjectedParticleContainer::RemapParticles() auto& uyp = attribs[PIdx::uy]; auto& uzp = attribs[PIdx::uz]; - const auto get_position = GetPosition(pti); - auto set_position = SetPosition(pti); + const auto GetPosition = GetParticlePosition(pti); + auto SetPosition = SetParticlePosition(pti); // Loop over particles const long np = pti.numParticles(); for (int i=0 ; i < np ; i++) { ParticleReal xp, yp, zp; - get_position(i, xp, yp, zp); + GetPosition(i, xp, yp, zp); const Real gammapr = std::sqrt(1. + (uxp[i]*uxp[i] + uyp[i]*uyp[i] + uzp[i]*uzp[i])/csq); const Real vzpr = uzp[i]/gammapr; @@ -109,7 +109,7 @@ RigidInjectedParticleContainer::RemapParticles() // the motion from the average velocity zp += tpr*vzpr - tpr*vzbeam_ave_boosted; - set_position(i, xp, yp, zp); + SetPosition(i, xp, yp, zp); } } @@ -146,15 +146,15 @@ RigidInjectedParticleContainer::BoostandRemapParticles() auto& uyp = attribs[PIdx::uy]; auto& uzp = attribs[PIdx::uz]; - const auto get_position = GetPosition(pti); - auto set_position = SetPosition(pti); + const auto GetPosition = GetParticlePosition(pti); + auto SetPosition = SetParticlePosition(pti); // Loop over particles const long np = pti.numParticles(); for (int i=0 ; i < np ; i++) { ParticleReal xp, yp, zp; - get_position(i, xp, yp, zp); + GetPosition(i, xp, yp, zp); const Real gamma_lab = std::sqrt(1. + (uxp[i]*uxp[i] + uyp[i]*uyp[i] + uzp[i]*uzp[i])/(PhysConst::c*PhysConst::c)); @@ -199,7 +199,7 @@ RigidInjectedParticleContainer::BoostandRemapParticles() zp = zpr - vzpr*tpr; } - set_position(i, xp, yp, zp); + SetPosition(i, xp, yp, zp); } } } @@ -219,8 +219,8 @@ RigidInjectedParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_ Gpu::ManagedDeviceVector<ParticleReal> xp_save, yp_save, zp_save; RealVector uxp_save, uyp_save, uzp_save; - const auto get_position = GetPosition(pti); - auto set_position = SetPosition(pti); + const auto GetPosition = GetParticlePosition(pti); + auto SetPosition = SetParticlePosition(pti); ParticleReal* const AMREX_RESTRICT ux = uxp.dataPtr(); ParticleReal* const AMREX_RESTRICT uy = uyp.dataPtr(); @@ -256,7 +256,7 @@ RigidInjectedParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_ amrex::ParallelFor( np, [=] AMREX_GPU_DEVICE (long i) { ParticleReal xp, yp, zp; - get_position(i, xp, yp, zp); + GetPosition(i, xp, yp, zp); xp_save_ptr[i] = xp; yp_save_ptr[i] = yp; zp_save_ptr[i] = zp; @@ -275,7 +275,7 @@ RigidInjectedParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_ amrex::ParallelFor( pti.numParticles(), [=] AMREX_GPU_DEVICE (long i) { ParticleReal xp, yp, zp; - get_position(i, xp, yp, zp); + GetPosition(i, xp, yp, zp); const Real dtscale = dt - (z_plane_previous - zp)/(vz_ave_boosted + v_boost); if (0. < dtscale && dtscale < dt) { Exp[i] *= dtscale; @@ -309,7 +309,7 @@ RigidInjectedParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_ amrex::ParallelFor( pti.numParticles(), [=] AMREX_GPU_DEVICE (long i) { ParticleReal xp, yp, zp; - get_position(i, xp, yp, zp); + GetPosition(i, xp, yp, zp); if (zp <= z_plane_lev) { ux[i] = ux_save[i]; uy[i] = uy_save[i]; @@ -323,7 +323,7 @@ RigidInjectedParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_ const Real gi = 1./std::sqrt(1. + (ux[i]*ux[i] + uy[i]*uy[i] + uz[i]*uz[i])*inv_csq); zp = z_save[i] + dt*uz[i]*gi; } - set_position(i, xp, yp, zp); + SetPosition(i, xp, yp, zp); } }); } @@ -422,7 +422,7 @@ RigidInjectedParticleContainer::PushP (int lev, Real dt, // This wraps the momentum advance so that inheritors can modify the call. // Extract pointers to the different particle quantities - const auto get_position = GetPosition(pti); + const auto GetPosition = GetParticlePosition(pti); ParticleReal* const AMREX_RESTRICT uxpp = uxp.dataPtr(); ParticleReal* const AMREX_RESTRICT uypp = uyp.dataPtr(); ParticleReal* const AMREX_RESTRICT uzpp = uzp.dataPtr(); @@ -490,7 +490,7 @@ RigidInjectedParticleContainer::PushP (int lev, Real dt, amrex::ParallelFor( pti.numParticles(), [=] AMREX_GPU_DEVICE (long i) { ParticleReal xp, yp, zp; - get_position(i, xp, yp, zp); + GetPosition(i, xp, yp, zp); if (zp <= zz) { uxpp[i] = ux_save[i]; uypp[i] = uy_save[i]; |