指定粒子数ぶんの位置/速度/電荷/質量/重みを生成し 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 call allocate_particles(pcls, n) call sample_uniform_positions(pos_low, pos_high, pcls%x) call sample_shifted_maxwell_velocities(drift_velocity, m_particle, pcls%v, temperature_k, thermal_speed) pcls%q = q_particle pcls%m = m_particle pcls%w = w_particle end subroutine init_random_beam_particles