粒子SoAデータ構造の初期化を提供するモジュール。
確保済みの粒子枠数。未確保なら 0。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(in) | :: | pcls |
粒子数に一致するSoA領域を確保する。位置・速度・電荷・質量は呼出し元で埋める。
SoA の配列長は容量で、有効な粒子は常に先頭 pcls%n 個(extend_particles 後は配列長の方が長くなり得る)。
重みは1、粒子種IDは0、放出元は-1、aliveはtrueで初期化する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(out) | :: | pcls | |||
| integer(kind=i32), | intent(in) | :: | n |
位置・速度・電荷・質量(と任意重み)配列から particles_soa を検証付きで構築する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(out) | :: | 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), | optional | :: | w(:) | ||
| integer(kind=i32), | intent(in), | optional | :: | species_id(:) | ||
| integer(kind=i32), | intent(in), | optional | :: | source_element(:) |
既存 SoA の末尾へ粒子群を追加し、既存の alive 状態を保持する。
容量が足りなければ extend_particles が 1.5 倍以上に広げるので、配列長は pcls%n より長くなり得る。
| Type | Intent | Optional | 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(:) |
末尾に added 個の枠を足して pcls%n を進める。新しい枠は重み 1、粒子種 0、放出元 -1、alive で、
位置・速度・電荷・質量は呼出し元が埋める。容量が足りなければ必要数と現容量の 1.5 倍の大きい方へ広げ、
二次電子の世代ごとの追加で毎回全粒子を写し直さない。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(inout) | :: | pcls | |||
| integer(kind=i32), | intent(in) | :: | added |
容量を capacity 以上にする。先頭 pcls%n 個だけを写し、それより後ろの値は未定義のまま残す。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(inout) | :: | pcls | |||
| integer(kind=i32), | intent(in) | :: | capacity |
先頭 n 個だけを残して配列を詰め直す。容量を先に確保して埋めた SoA を実数に合わせるときに使う。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(particles_soa), | intent(inout) | :: | pcls | |||
| integer(kind=i32), | intent(in) | :: | n |