bem_particles Module

粒子SoAデータ構造の初期化を提供するモジュール。


Uses

  • module~~bem_particles~~UsesGraph module~bem_particles bem_particles module~bem_kinds bem_kinds module~bem_particles->module~bem_kinds module~bem_types bem_types module~bem_particles->module~bem_types iso_fortran_env iso_fortran_env module~bem_kinds->iso_fortran_env module~bem_types->module~bem_kinds module~bem_outflow_spectrum bem_outflow_spectrum module~bem_types->module~bem_outflow_spectrum module~bem_outflow_spectrum->module~bem_kinds sheath_model sheath_model module~bem_outflow_spectrum->sheath_model

Used by

  • module~~bem_particles~~UsedByGraph module~bem_particles bem_particles module~bem_app_config_particle_runtime_batch bem_app_config_particle_runtime_batch module~bem_app_config_particle_runtime_batch->module~bem_particles module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_particles

Functions

public pure function particle_capacity(pcls) result(capacity)

確保済みの粒子枠数。未確保なら 0。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(in) :: pcls

Return Value integer(kind=i32)


Subroutines

public subroutine allocate_particles(pcls, n)

粒子数に一致するSoA領域を確保する。位置・速度・電荷・質量は呼出し元で埋める。 SoA の配列長は容量で、有効な粒子は常に先頭 pcls%n 個(extend_particles 後は配列長の方が長くなり得る)。 重みは1、粒子種IDは0、放出元は-1、aliveはtrueで初期化する。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(out) :: pcls
integer(kind=i32), intent(in) :: n

public subroutine init_particles(pcls, x, v, q, m, w, species_id, source_element)

位置・速度・電荷・質量(と任意重み)配列から particles_soa を検証付きで構築する。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(out) :: pcls

検証済み配列を内部に保持した particles_soa 構造体。

real(kind=dp), intent(in) :: x(:,:)
real(kind=dp), intent(in) :: v(:,:)
real(kind=dp), intent(in) :: q(:)
real(kind=dp), intent(in) :: m(:)
real(kind=dp), intent(in), optional :: w(:)
integer(kind=i32), intent(in), optional :: species_id(:)
integer(kind=i32), intent(in), optional :: source_element(:)

public subroutine append_particles(pcls, x, v, q, m, w, species_id, source_element)

既存 SoA の末尾へ粒子群を追加し、既存の alive 状態を保持する。 容量が足りなければ extend_particles が 1.5 倍以上に広げるので、配列長は pcls%n より長くなり得る。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(inout) :: pcls
real(kind=dp), intent(in) :: x(:,:)
real(kind=dp), intent(in) :: v(:,:)
real(kind=dp), intent(in) :: q(:)
real(kind=dp), intent(in) :: m(:)
real(kind=dp), intent(in) :: w(:)
integer(kind=i32), intent(in) :: species_id(:)
integer(kind=i32), intent(in), optional :: source_element(:)

public subroutine extend_particles(pcls, added)

末尾に added 個の枠を足して pcls%n を進める。新しい枠は重み 1、粒子種 0、放出元 -1、alive で、 位置・速度・電荷・質量は呼出し元が埋める。容量が足りなければ必要数と現容量の 1.5 倍の大きい方へ広げ、 二次電子の世代ごとの追加で毎回全粒子を写し直さない。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(inout) :: pcls
integer(kind=i32), intent(in) :: added

public subroutine reserve_particles(pcls, capacity)

容量を capacity 以上にする。先頭 pcls%n 個だけを写し、それより後ろの値は未定義のまま残す。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(inout) :: pcls
integer(kind=i32), intent(in) :: capacity

public subroutine trim_particles(pcls, n)

先頭 n 個だけを残して配列を詰め直す。容量を先に確保して埋めた SoA を実数に合わせるときに使う。

Arguments

Type IntentOptional Attributes Name
type(particles_soa), intent(inout) :: pcls
integer(kind=i32), intent(in) :: n