diff options
Diffstat (limited to 'Source/Particles')
-rw-r--r-- | Source/Particles/MultiParticleContainer.H | 9 | ||||
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 8 | ||||
-rw-r--r-- | Source/Particles/WarpXParticleContainer.H | 9 | ||||
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 31 | ||||
-rw-r--r-- | Source/Particles/push_particles_ES.F90 | 110 |
5 files changed, 1 insertions, 166 deletions
diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 8dd26ff60..65c13e39b 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -92,13 +92,6 @@ public: amrex::Real t, amrex::Real dt); /// - /// This pushes the particle positions by one half time step for all the species in the - /// MultiParticleContainer. It is used to desynchronize the particles after initializaton - /// or when restarting from a checkpoint. This is the electrostatic version. - /// - void PushXES (amrex::Real dt); - - /// /// This deposits the particle charge onto rho, accumulating the value for all the species /// in the MultiParticleContainer. rho is assumed to contain node-centered multifabs. /// This version is hard-coded for CIC deposition. @@ -139,7 +132,7 @@ public: /// /// This pushes the particle positions by one half time step for all the species in the /// MultiParticleContainer. It is used to desynchronize the particles after initializaton - /// or when restarting from a checkpoint. This is the electromagnetic version. + /// or when restarting from a checkpoint. /// void PushX (amrex::Real dt); diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index bbfdace7f..f9a0d230b 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -312,14 +312,6 @@ MultiParticleContainer::EvolveES (const Vector<std::array<std::unique_ptr<MultiF } void -MultiParticleContainer::PushXES (Real dt) -{ - for (auto& pc : allcontainers) { - pc->PushXES(dt); - } -} - -void MultiParticleContainer:: DepositCharge (Vector<std::unique_ptr<MultiFab> >& rho, bool local) { diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index 53ce8d320..19086d1d8 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -201,15 +201,6 @@ public: /// This pushes the particle positions by one half time step. /// It is used to desynchronize the particles after initializaton /// or when restarting from a checkpoint. - /// This is the electrostatic version of the particle push. - /// - void PushXES (amrex::Real dt); - - /// - /// This pushes the particle positions by one half time step. - /// It is used to desynchronize the particles after initializaton - /// or when restarting from a checkpoint. - /// This is the electromagnetic version of the particle push. /// void PushX ( amrex::Real dt); void PushX (int lev, amrex::Real dt); diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 9fc69bc73..7628cfd85 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -743,37 +743,6 @@ Real WarpXParticleContainer::maxParticleVelocity(bool local) { } void -WarpXParticleContainer::PushXES (Real dt) -{ - BL_PROFILE("WPC::PushXES()"); - - const int num_levels = finestLevel() + 1; - - for (int lev = 0; lev < num_levels; ++lev) { - const auto& gm = m_gdb->Geom(lev); - const RealBox& prob_domain = gm.ProbDomain(); - for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { - auto& particles = pti.GetArrayOfStructs(); - int nstride = particles.dataShape().first; - const long np = pti.numParticles(); - - auto& attribs = pti.GetAttribs(); - auto& uxp = attribs[PIdx::ux]; - auto& uyp = attribs[PIdx::uy]; - auto& uzp = attribs[PIdx::uz]; - - WRPX_PUSH_LEAPFROG_POSITIONS(particles.dataPtr(), nstride, np, - uxp.dataPtr(), uyp.dataPtr(), -#if AMREX_SPACEDIM == 3 - uzp.dataPtr(), -#endif - &dt, - prob_domain.lo(), prob_domain.hi()); - } - } -} - -void WarpXParticleContainer::PushX (amrex::Real dt) { const int nLevels = finestLevel(); diff --git a/Source/Particles/push_particles_ES.F90 b/Source/Particles/push_particles_ES.F90 index 60833d456..a22ee5a62 100644 --- a/Source/Particles/push_particles_ES.F90 +++ b/Source/Particles/push_particles_ES.F90 @@ -151,114 +151,4 @@ contains end subroutine warpx_push_leapfrog_2d - -! -! This routine advances the particle positions using the current -! velocity. This is needed to desynchronize the particle positions -! from the velocities after particle initialization. -! -! Arguments: -! particles : a pointer to the particle array-of-structs -! ns : the stride length of particle struct (the size of the struct in number of reals) -! np : the number of particles -! xx_p : the electric field in the x-direction at the particle positions -! vy_p : the electric field in the y-direction at the particle positions -! vz_p : the electric field in the z-direction at the particle positions -! dt : the time step -! prob_lo : the left-hand corner of the problem domain -! prob_hi : the right-hand corner of the problem domain -! - subroutine warpx_push_leapfrog_positions_3d(particles, ns, np, & - vx_p, vy_p, vz_p, dt, & - prob_lo, prob_hi) & - bind(c,name='warpx_push_leapfrog_positions_3d') - integer, value, intent(in) :: ns, np - real(amrex_particle_real), intent(inout) :: particles(ns,np) - real(amrex_particle_real), intent(inout) :: vx_p(np), vy_p(np), vz_p(np) - real(amrex_real), intent(in) :: dt - real(amrex_real), intent(in) :: prob_lo(3), prob_hi(3) - - integer n - - do n = 1, np - - particles(1, n) = particles(1, n) + dt * vx_p(n) - particles(2, n) = particles(2, n) + dt * vy_p(n) - particles(3, n) = particles(3, n) + dt * vz_p(n) - -! bounce off the walls in the x... - do while (particles(1, n) .lt. prob_lo(1) .or. particles(1, n) .gt. prob_hi(1)) - if (particles(1, n) .lt. prob_lo(1)) then - particles(1, n) = 2.d0*prob_lo(1) - particles(1, n) - else - particles(1, n) = 2.d0*prob_hi(1) - particles(1, n) - end if - vx_p(n) = -vx_p(n) - end do - -! ... y... - do while (particles(2, n) .lt. prob_lo(2) .or. particles(2, n) .gt. prob_hi(2)) - if (particles(2, n) .lt. prob_lo(2)) then - particles(2, n) = 2.d0*prob_lo(2) - particles(2, n) - else - particles(2, n) = 2.d0*prob_hi(2) - particles(2, n) - end if - vy_p(n) = -vy_p(n) - end do - -! ... and z directions - do while (particles(3, n) .lt. prob_lo(3) .or. particles(3, n) .gt. prob_hi(3)) - if (particles(3, n) .lt. prob_lo(3)) then - particles(3, n) = 2.d0*prob_lo(3) - particles(3, n) - else - particles(3, n) = 2.d0*prob_hi(3) - particles(3, n) - end if - vz_p(n) = -vz_p(n) - end do - - end do - - end subroutine warpx_push_leapfrog_positions_3d - - subroutine warpx_push_leapfrog_positions_2d(particles, ns, np, & - vx_p, vy_p, dt, & - prob_lo, prob_hi) & - bind(c,name='warpx_push_leapfrog_positions_2d') - integer, value, intent(in) :: ns, np - real(amrex_particle_real), intent(inout) :: particles(ns,np) - real(amrex_particle_real), intent(inout) :: vx_p(np), vy_p(np) - real(amrex_real), intent(in) :: dt - real(amrex_real), intent(in) :: prob_lo(2), prob_hi(2) - - integer n - - do n = 1, np - - particles(1, n) = particles(1, n) + dt * vx_p(n) - particles(2, n) = particles(2, n) + dt * vy_p(n) - -! bounce off the walls in the x... - do while (particles(1, n) .lt. prob_lo(1) .or. particles(1, n) .gt. prob_hi(1)) - if (particles(1, n) .lt. prob_lo(1)) then - particles(1, n) = 2.d0*prob_lo(1) - particles(1, n) - else - particles(1, n) = 2.d0*prob_hi(1) - particles(1, n) - end if - vx_p(n) = -vx_p(n) - end do - -! ... y... - do while (particles(2, n) .lt. prob_lo(2) .or. particles(2, n) .gt. prob_hi(2)) - if (particles(2, n) .lt. prob_lo(2)) then - particles(2, n) = 2.d0*prob_lo(2) - particles(2, n) - else - particles(2, n) = 2.d0*prob_hi(2) - particles(2, n) - end if - vy_p(n) = -vy_p(n) - end do - - end do - - end subroutine warpx_push_leapfrog_positions_2d - end module warpx_ES_push_particles |