+26: def shear_periodic_y(particle_t[:] particles, grid_t grid, real_t S, real_t t):
27: """Shearing periodic boundaries along y.
28:
29: This function modifies x and vx and subsequently applies periodic
30: boundaries on x.
31:
32: The periodic boundaries on y are handled by ppic2 *after* we have
33: used the values of y to update x and vx.
34: """
+35: cdef int Np = particles.shape[0]
+36: cdef real_t ny = <real_t> grid.ny
+37: cdef real_t vx_boost = S*grid.Ly
+38: cdef real_t x_boost = vx_boost*t/grid.dx
39: cdef int ip
40:
+41: for ip in prange(Np, nogil=True, schedule='static'):
42: # Left
+43: if particles[ip].y < 0.0:
+44: particles[ip].x = particles[ip].x - x_boost
+45: particles[ip].vx = particles[ip].vx - vx_boost
46: # Right
+47: if particles[ip].y >= ny:
+48: particles[ip].x = particles[ip].x + x_boost
+49: particles[ip].vx = particles[ip].vx + vx_boost
We have a yellow line in 37 below.