アプリ設定の型定義と、設定由来の粒子数計算をまとめるモジュール。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | max_templates | = | 8 |
設定配列の初期確保サイズ(上限ではない)。 |
| integer, | public, | parameter | :: | max_particle_species | = | 8 |
1粒子種の注入設定を表す。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | enabled | = | .false. | ||
| integer(kind=i32), | public | :: | npcls_per_step | = | 0_i32 | ||
| logical, | public | :: | has_npcls_per_step | = | .false. | ||
| character(len=16), | public | :: | source_mode | = | 'volume_seed' | ||
| real(kind=dp), | public | :: | number_density_cm3 | = | 0.0d0 | ||
| real(kind=dp), | public | :: | number_density_m3 | = | 0.0d0 | ||
| logical, | public | :: | has_number_density_cm3 | = | .false. | ||
| logical, | public | :: | has_number_density_m3 | = | .false. | ||
| real(kind=dp), | public | :: | q_particle | = | -1.602176634d-19 | ||
| real(kind=dp), | public | :: | m_particle | = | 9.10938356d-31 | ||
| real(kind=dp), | public | :: | w_particle | = | 1.0d0 | ||
| logical, | public | :: | has_w_particle | = | .false. | ||
| integer(kind=i32), | public | :: | target_macro_particles_per_batch | = | 0_i32 | ||
| logical, | public | :: | has_target_macro_particles_per_batch | = | .false. | ||
| real(kind=dp), | public | :: | pos_low(3) | = | [-0.4d0, -0.4d0, 0.2d0] | ||
| real(kind=dp), | public | :: | pos_high(3) | = | [0.4d0, 0.4d0, 0.5d0] | ||
| real(kind=dp), | public | :: | drift_velocity(3) | = | [0.0d0, 0.0d0, -8.0d5] | ||
| real(kind=dp), | public | :: | temperature_k | = | 2.0d4 | ||
| real(kind=dp), | public | :: | temperature_ev | = | -1.0d0 | ||
| logical, | public | :: | has_temperature_k | = | .false. | ||
| logical, | public | :: | has_temperature_ev | = | .false. | ||
| real(kind=dp), | public | :: | emit_current_density_a_m2 | = | 0.0d0 | ||
| integer(kind=i32), | public | :: | rays_per_batch | = | 0_i32 | ||
| logical, | public | :: | deposit_opposite_charge_on_emit | = | .false. | ||
| logical, | public | :: | has_deposit_opposite_charge_on_emit | = | .false. | ||
| real(kind=dp), | public | :: | normal_drift_speed | = | 0.0d0 | ||
| real(kind=dp), | public | :: | ray_direction(3) | = | [0.0d0, 0.0d0, 0.0d0] | ||
| logical, | public | :: | has_ray_direction | = | .false. | ||
| character(len=16), | public | :: | inject_face | = | '' |
1つのテンプレート形状の有効化フラグと幾何パラメータを保持する。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | enabled | = | .false. | ||
| character(len=16), | public | :: | kind | = | 'plane' | ||
| real(kind=dp), | public | :: | center(3) | = | 0.0d0 | ||
| real(kind=dp), | public | :: | size_x | = | 1.0d0 | ||
| real(kind=dp), | public | :: | size_y | = | 1.0d0 | ||
| real(kind=dp), | public | :: | size(3) | = | [1.0d0, 1.0d0, 1.0d0] | ||
| integer(kind=i32), | public | :: | nx | = | 1 | ||
| integer(kind=i32), | public | :: | ny | = | 1 | ||
| integer(kind=i32), | public | :: | nz | = | 1 | ||
| real(kind=dp), | public | :: | radius | = | 0.5d0 | ||
| real(kind=dp), | public | :: | inner_radius | = | 0.25d0 | ||
| real(kind=dp), | public | :: | height | = | 1.0d0 | ||
| integer(kind=i32), | public | :: | n_theta | = | 24 | ||
| integer(kind=i32), | public | :: | n_r | = | 4 | ||
| integer(kind=i32), | public | :: | n_z | = | 1 | ||
| logical, | public | :: | cap | = | .true. | ||
| logical, | public | :: | cap_top | = | .true. | ||
| logical, | public | :: | cap_bottom | = | .true. | ||
| logical, | public | :: | has_cap_top | = | .false. | ||
| logical, | public | :: | has_cap_bottom | = | .false. | ||
| integer(kind=i32), | public | :: | n_lon | = | 24 | ||
| integer(kind=i32), | public | :: | n_lat | = | 12 |
実行条件・メッシュ入力・粒子注入・出力設定を一元管理する。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=16), | public | :: | mesh_mode | = | 'auto' | ||
| character(len=256), | public | :: | obj_path | = | 'examples/simple_plate.obj' | ||
| real(kind=dp), | public | :: | obj_scale | = | 1.0d0 | ||
| real(kind=dp), | public | :: | obj_rotation(3) | = | [0.0d0, 0.0d0, 0.0d0] | ||
| real(kind=dp), | public | :: | obj_offset(3) | = | [0.0d0, 0.0d0, 0.0d0] | ||
| integer(kind=i32), | public | :: | n_templates | = | 0_i32 | ||
| type(template_spec), | public, | allocatable | :: | templates(:) | |||
| integer(kind=i32), | public | :: | n_particles | = | 0_i32 | ||
| integer(kind=i32), | public | :: | n_particle_species | = | 0_i32 | ||
| type(particle_species_spec), | public, | allocatable | :: | particle_species(:) | |||
| logical, | public | :: | write_output | = | .true. | ||
| logical, | public | :: | write_mesh_potential | = | .false. | ||
| logical, | public | :: | write_potential_history | = | .false. | ||
| character(len=256), | public | :: | output_dir | = | 'outputs/latest' | ||
| integer(kind=i32), | public | :: | history_stride | = | 1 | ||
| logical, | public | :: | resume_output | = | .false. | ||
| type(sim_config), | public | :: | sim |
有効な粒子種の npcls_per_step を合計し、1バッチあたりの粒子数を返す。
1つ以上の粒子種が有効で、かつ合計が正でない場合は停止する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(in) | :: | cfg |
粒子種設定を含むアプリ設定。 |
バッチ数と1バッチ粒子数から総粒子数を返す。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(in) | :: | cfg |
バッチ数と粒子種設定を含むアプリ設定。 |
[[particles.species]] の既定値を返す。
現行仕様では、列挙された粒子種は既定で有効とみなす。
app_config を既定値で初期化し、TOML 上書き前の状態を作る。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(out) | :: | cfg |
既定値で初期化したアプリ設定。 |