指定粒子数ぶんの位置/速度/電荷/質量/重みを生成し particles_soa を初期化する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(out) | :: | pcls |
生成した粒子群を保持する |
||
| integer(kind=i32), | intent(in) | :: | n |
生成するマクロ粒子数。 |
||
| real(kind=dp), | intent(in) | :: | q_particle |
粒子1個あたりの電荷 [C]。 |
||
| real(kind=dp), | intent(in) | :: | m_particle |
粒子1個あたりの電荷 [C]。 粒子1個あたりの質量 [kg]。 |
||
| real(kind=dp), | intent(in) | :: | w_particle |
粒子1個あたりの電荷 [C]。 粒子1個あたりの質量 [kg]。 粒子1個あたりのマクロ粒子重み。 |
||
| real(kind=dp), | intent(in) | :: | pos_low(3) | |||
| real(kind=dp), | intent(in) | :: | pos_high(3) | |||
| real(kind=dp), | intent(in) | :: | drift_velocity(3) | |||
| real(kind=dp), | intent(in), | optional | :: | temperature_k |
熱運動の温度 [K]( |
|
| real(kind=dp), | intent(in), | optional | :: | thermal_speed |
熱運動の温度 [K]( |
subroutine init_random_beam_particles(pcls, n, q_particle, m_particle, w_particle, pos_low, pos_high, drift_velocity, & temperature_k, thermal_speed) type(particles_soa), intent(out) :: pcls integer(i32), intent(in) :: n real(dp), intent(in) :: q_particle, m_particle, w_particle real(dp), intent(in) :: pos_low(3), pos_high(3), drift_velocity(3) real(dp), intent(in), optional :: temperature_k, thermal_speed real(dp), allocatable :: x(:, :), v(:, :), q(:), m(:), w(:) if (n < 0) error stop "n must be non-negative" allocate (x(3, n), v(3, n), q(n), m(n), w(n)) call sample_uniform_positions(pos_low, pos_high, x) call sample_shifted_maxwell_velocities(drift_velocity, m_particle, v, temperature_k, thermal_speed) q = q_particle m = m_particle w = w_particle call init_particles(pcls, x, v, q, m, w) end subroutine init_random_beam_particles