boris_push Subroutine

public subroutine boris_push(x, v, q, m, dt, e, b, x_new, v_new)

電場半ステップ加速と磁場回転を組み合わせ、1タイムステップ後の位置・速度を計算する。

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x(3)
real(kind=dp), intent(in) :: v(3)
real(kind=dp), intent(in) :: q

粒子1個あたりの電荷 [C]。

real(kind=dp), intent(in) :: m

粒子1個あたりの電荷 [C]。 粒子1個あたりの質量 [kg]。

real(kind=dp), intent(in) :: dt

粒子1個あたりの電荷 [C]。 粒子1個あたりの質量 [kg]。 時間刻み幅 [s]。

real(kind=dp), intent(in) :: e(3)

粒子1個あたりの電荷 [C]。 粒子1個あたりの質量 [kg]。 時間刻み幅 [s]。

real(kind=dp), intent(in) :: b(3)

粒子1個あたりの電荷 [C]。 粒子1個あたりの質量 [kg]。 時間刻み幅 [s]。

real(kind=dp), intent(out) :: x_new(3)
real(kind=dp), intent(out) :: v_new(3)

Calls

proc~~boris_push~~CallsGraph proc~boris_push boris_push proc~cross~3 cross proc~boris_push->proc~cross~3

Source Code

  subroutine boris_push(x, v, q, m, dt, e, b, x_new, v_new)
    real(dp), intent(in) :: x(3), v(3), q, m, dt, e(3), b(3)
    real(dp), intent(out) :: x_new(3), v_new(3)
    real(dp) :: qm, v_minus(3), t(3), s(3), v_prime(3), v_plus(3), t2

    qm = q/m
    v_minus = v + qm*e*(0.5d0*dt)
    t = qm*b*(0.5d0*dt)
    t2 = sum(t*t)
    s = 2.0d0*t/(1.0d0 + t2)
    v_prime = v_minus + cross(v_minus, t)
    v_plus = v_minus + cross(v_prime, s)
    v_new = v_plus + qm*e*(0.5d0*dt)
    x_new = x + v_new*dt
  end subroutine boris_push