bem_app_config_particle_runtime Module

app_config から粒子源計画と粒子バッチを構築する実行時変換。


Uses

  • module~~bem_app_config_particle_runtime~~UsesGraph module~bem_app_config_particle_runtime bem_app_config_particle_runtime ieee_arithmetic ieee_arithmetic module~bem_app_config_particle_runtime->ieee_arithmetic iso_fortran_env iso_fortran_env module~bem_app_config_particle_runtime->iso_fortran_env module~bem_app_config_potential_runtime bem_app_config_potential_runtime module~bem_app_config_particle_runtime->module~bem_app_config_potential_runtime module~bem_app_config_types bem_app_config_types module~bem_app_config_particle_runtime->module~bem_app_config_types module~bem_config_helpers bem_config_helpers module~bem_app_config_particle_runtime->module~bem_config_helpers module~bem_constants bem_constants module~bem_app_config_particle_runtime->module~bem_constants module~bem_electrostatic_snapshot bem_electrostatic_snapshot module~bem_app_config_particle_runtime->module~bem_electrostatic_snapshot module~bem_external_boundary_contract bem_external_boundary_contract module~bem_app_config_particle_runtime->module~bem_external_boundary_contract module~bem_injection bem_injection module~bem_app_config_particle_runtime->module~bem_injection module~bem_kinds bem_kinds module~bem_app_config_particle_runtime->module~bem_kinds module~bem_mpi bem_mpi module~bem_app_config_particle_runtime->module~bem_mpi module~bem_status_codes bem_status_codes module~bem_app_config_particle_runtime->module~bem_status_codes module~bem_string_utils bem_string_utils module~bem_app_config_particle_runtime->module~bem_string_utils module~bem_types bem_types module~bem_app_config_particle_runtime->module~bem_types module~bem_app_config_potential_runtime->ieee_arithmetic module~bem_app_config_potential_runtime->iso_fortran_env module~bem_app_config_potential_runtime->module~bem_app_config_types module~bem_app_config_potential_runtime->module~bem_config_helpers module~bem_app_config_potential_runtime->module~bem_constants module~bem_app_config_potential_runtime->module~bem_electrostatic_snapshot module~bem_app_config_potential_runtime->module~bem_kinds module~bem_app_config_potential_runtime->module~bem_string_utils module~bem_app_config_potential_runtime->module~bem_types module~bem_irradiation_cell_contract bem_irradiation_cell_contract module~bem_app_config_potential_runtime->module~bem_irradiation_cell_contract module~bem_app_config_types->module~bem_external_boundary_contract module~bem_app_config_types->module~bem_kinds module~bem_app_config_types->module~bem_types module~bem_filesystem bem_filesystem module~bem_app_config_types->module~bem_filesystem module~bem_physics_config_types bem_physics_config_types module~bem_app_config_types->module~bem_physics_config_types module~bem_config_helpers->module~bem_app_config_types module~bem_config_helpers->module~bem_kinds module~bem_config_helpers->module~bem_string_utils module~bem_config_helpers->module~bem_types module~bem_constants->module~bem_kinds module~bem_electrostatic_snapshot->ieee_arithmetic module~bem_electrostatic_snapshot->module~bem_constants module~bem_electrostatic_snapshot->module~bem_kinds module~bem_electrostatic_snapshot->module~bem_mpi module~bem_electrostatic_snapshot->module~bem_string_utils module~bem_electrostatic_snapshot->module~bem_types module~bem_coulomb_fmm_periodic_nonzero_reference bem_coulomb_fmm_periodic_nonzero_reference module~bem_electrostatic_snapshot->module~bem_coulomb_fmm_periodic_nonzero_reference module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum bem_coulomb_fmm_periodic_nonzero_upper_vacuum module~bem_electrostatic_snapshot->module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum module~bem_field_solver bem_field_solver module~bem_electrostatic_snapshot->module~bem_field_solver module~bem_panel_geometry bem_panel_geometry module~bem_electrostatic_snapshot->module~bem_panel_geometry module~bem_panel_kernel bem_panel_kernel module~bem_electrostatic_snapshot->module~bem_panel_kernel module~bem_periodic_zero_mode_eval bem_periodic_zero_mode_eval module~bem_electrostatic_snapshot->module~bem_periodic_zero_mode_eval module~bem_periodic_zero_mode_plan bem_periodic_zero_mode_plan module~bem_electrostatic_snapshot->module~bem_periodic_zero_mode_plan module~bem_electrostatic_snapshot->module~bem_physics_config_types module~bem_runtime_modes bem_runtime_modes module~bem_electrostatic_snapshot->module~bem_runtime_modes module~bem_external_boundary_contract->module~bem_kinds module~bem_external_boundary_contract->module~bem_string_utils module~bem_injection_flux bem_injection_flux module~bem_injection->module~bem_injection_flux module~bem_injection_geometry bem_injection_geometry module~bem_injection->module~bem_injection_geometry module~bem_injection_random bem_injection_random module~bem_injection->module~bem_injection_random module~bem_photoelectron_injection bem_photoelectron_injection module~bem_injection->module~bem_photoelectron_injection module~bem_kinds->iso_fortran_env module~bem_mpi->module~bem_kinds module~bem_status_codes->module~bem_kinds module~bem_types->module~bem_kinds module~bem_outflow_spectrum bem_outflow_spectrum module~bem_types->module~bem_outflow_spectrum module~bem_coulomb_fmm_periodic_nonzero_reference->ieee_arithmetic module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_constants module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_kinds module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_types module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_panel_geometry module~bem_triangle_quadrature bem_triangle_quadrature module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_triangle_quadrature module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->ieee_arithmetic module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_constants module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_kinds module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_types module~bem_field_solver->ieee_arithmetic module~bem_field_solver->module~bem_constants module~bem_field_solver->module~bem_kinds module~bem_field_solver->module~bem_mpi module~bem_field_solver->module~bem_string_utils module~bem_field_solver->module~bem_types module~bem_field_solver->module~bem_physics_config_types module~bem_field_solver->module~bem_runtime_modes module~bem_coulomb_fmm_core bem_coulomb_fmm_core module~bem_field_solver->module~bem_coulomb_fmm_core iso_c_binding iso_c_binding module~bem_filesystem->iso_c_binding module~bem_injection_flux->ieee_arithmetic module~bem_injection_flux->module~bem_constants module~bem_injection_flux->module~bem_kinds module~bem_injection_flux->module~bem_injection_geometry module~bem_injection_flux->module~bem_injection_random module~bem_counter_rng bem_counter_rng module~bem_injection_flux->module~bem_counter_rng module~bem_injection_geometry->module~bem_kinds module~bem_injection_geometry->module~bem_string_utils module~bem_injection_random->module~bem_constants module~bem_injection_random->module~bem_kinds module~bem_injection_random->module~bem_counter_rng module~bem_random_stream bem_random_stream module~bem_injection_random->module~bem_random_stream module~bem_irradiation_cell_contract->module~bem_app_config_types module~bem_irradiation_cell_contract->module~bem_kinds module~bem_irradiation_cell_contract->module~bem_string_utils module~bem_irradiation_cell_contract->module~bem_types module~bem_outflow_spectrum->module~bem_kinds sheath_model sheath_model module~bem_outflow_spectrum->sheath_model module~bem_panel_geometry->ieee_arithmetic module~bem_panel_geometry->module~bem_kinds module~bem_panel_kernel->module~bem_constants module~bem_panel_kernel->module~bem_kinds module~bem_panel_kernel->module~bem_panel_geometry module~bem_panel_self_terms bem_panel_self_terms module~bem_panel_kernel->module~bem_panel_self_terms module~bem_periodic_zero_mode_eval->module~bem_constants module~bem_periodic_zero_mode_eval->module~bem_kinds module~bem_periodic_zero_mode_eval->module~bem_periodic_zero_mode_plan module~bem_periodic_zero_mode_plan->ieee_arithmetic module~bem_periodic_zero_mode_plan->module~bem_constants module~bem_periodic_zero_mode_plan->module~bem_kinds module~bem_periodic_zero_mode_plan->module~bem_types module~bem_sorting bem_sorting module~bem_periodic_zero_mode_plan->module~bem_sorting module~bem_photoelectron_injection->module~bem_constants module~bem_photoelectron_injection->module~bem_kinds module~bem_photoelectron_injection->module~bem_status_codes module~bem_photoelectron_injection->module~bem_string_utils module~bem_photoelectron_injection->module~bem_types module~bem_photoelectron_injection->module~bem_injection_flux module~bem_photoelectron_injection->module~bem_injection_geometry module~bem_photoelectron_injection->module~bem_injection_random module~bem_boundary bem_boundary module~bem_photoelectron_injection->module~bem_boundary module~bem_collision bem_collision module~bem_photoelectron_injection->module~bem_collision module~bem_photoelectron_injection->module~bem_counter_rng module~bem_physics_config_types->ieee_arithmetic module~bem_physics_config_types->module~bem_kinds module~bem_physics_config_types->module~bem_string_utils module~bem_physics_config_types->module~bem_types module~bem_runtime_modes->module~bem_kinds module~bem_runtime_modes->module~bem_string_utils module~bem_boundary->ieee_arithmetic module~bem_boundary->module~bem_kinds module~bem_boundary->module~bem_status_codes module~bem_boundary->module~bem_types module~bem_collision->ieee_arithmetic module~bem_collision->iso_fortran_env module~bem_collision->module~bem_kinds module~bem_collision->module~bem_status_codes module~bem_collision->module~bem_string_utils module~bem_collision->module~bem_types module~bem_coulomb_fmm_core->module~bem_kinds module~bem_coulomb_fmm_core->module~bem_mpi module~bem_coulomb_fmm_types bem_coulomb_fmm_types module~bem_coulomb_fmm_core->module~bem_coulomb_fmm_types module~bem_counter_rng->module~bem_kinds module~bem_counter_rng->iso_c_binding m_pcg64_bind m_pcg64_bind module~bem_counter_rng->m_pcg64_bind module~bem_panel_self_terms->module~bem_kinds module~bem_panel_self_terms->module~bem_panel_geometry module~bem_random_stream->module~bem_kinds module~bem_random_stream->iso_c_binding module~bem_random_stream->module~bem_counter_rng module~bem_random_stream->m_pcg64_bind module~bem_sorting->module~bem_kinds module~bem_triangle_quadrature->module~bem_constants module~bem_triangle_quadrature->module~bem_kinds module~bem_triangle_quadrature->module~bem_panel_geometry module~bem_coulomb_fmm_types->module~bem_kinds module~bem_coulomb_fmm_types->module~bem_mpi module~bem_coulomb_fmm_types->module~bem_panel_geometry module~bem_coulomb_fmm_types->module~bem_periodic_zero_mode_plan module~bem_periodic_shell_mean bem_periodic_shell_mean module~bem_coulomb_fmm_types->module~bem_periodic_shell_mean module~bem_periodic_shell_mean->module~bem_kinds

Used by

  • module~~bem_app_config_particle_runtime~~UsedByGraph module~bem_app_config_particle_runtime bem_app_config_particle_runtime module~bem_app_config_particle_runtime_batch bem_app_config_particle_runtime_batch module~bem_app_config_particle_runtime_batch->module~bem_app_config_particle_runtime module~bem_app_config_particle_runtime_sampling bem_app_config_particle_runtime_sampling module~bem_app_config_particle_runtime_sampling->module~bem_app_config_particle_runtime module~bem_app_config_particle_runtime_slots bem_app_config_particle_runtime_slots module~bem_app_config_particle_runtime_slots->module~bem_app_config_particle_runtime module~bem_app_config_runtime bem_app_config_runtime module~bem_app_config_runtime->module~bem_app_config_particle_runtime module~bem_app_config bem_app_config module~bem_app_config->module~bem_app_config_runtime module~bem_simulator bem_simulator module~bem_simulator->module~bem_app_config_runtime module~bem_simulator->module~bem_app_config module~bem_simulator_io bem_simulator_io module~bem_simulator_io->module~bem_app_config_runtime module~bem_simulator_io->module~bem_simulator module~bem_simulator_loop bem_simulator_loop module~bem_simulator_loop->module~bem_app_config_runtime module~bem_simulator_loop->module~bem_simulator module~bem_zhao_outflow_refresh bem_zhao_outflow_refresh module~bem_simulator_loop->module~bem_zhao_outflow_refresh module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_simulator module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator module~bem_zhao_outflow_refresh->module~bem_app_config program~main main program~main->module~bem_app_config program~main->module~bem_simulator

Variables

Type Visibility Attributes Name Initial
integer(kind=i32), public, parameter :: slot_kind_none = 0_i32

slot の種別。

integer(kind=i32), public, parameter :: slot_kind_volume = 1_i32
integer(kind=i32), public, parameter :: slot_kind_photo_ray = 2_i32
integer(kind=i32), public, parameter :: slot_kind_reservoir_face = 3_i32

Interfaces

interface

  • public module subroutine build_batch_injection_layout(cfg, batch_idx, layout, state, mesh, mpi_rank, mpi_size, mpi, snapshot, source_plan)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: cfg
    integer(kind=i32), intent(in) :: batch_idx
    type(batch_injection_layout_type), intent(out) :: layout
    type(injection_state), intent(inout), optional :: state
    type(mesh_type), intent(in), optional :: mesh
    integer(kind=i32), intent(in), optional :: mpi_rank
    integer(kind=i32), intent(in), optional :: mpi_size
    type(mpi_context), intent(in), optional :: mpi
    type(electrostatic_snapshot_type), intent(inout), optional :: snapshot
    type(particle_source_plan_type), intent(in) :: source_plan

interface

  • public module subroutine generate_batch_slot(cfg, layout, slot, mesh, x, v, w, q, m, species_idx, source_element, emitted, collision_status, bounce_count)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: cfg
    type(batch_injection_layout_type), intent(in) :: layout
    integer(kind=i32), intent(in) :: slot
    type(mesh_type), intent(in), optional :: mesh
    real(kind=dp), intent(out) :: x(3)
    real(kind=dp), intent(out) :: v(3)
    real(kind=dp), intent(out) :: w
    real(kind=dp), intent(out) :: q
    real(kind=dp), intent(out) :: m
    integer(kind=i32), intent(out) :: species_idx
    integer(kind=i32), intent(out) :: source_element
    logical, intent(out) :: emitted
    integer(kind=i32), intent(out) :: collision_status
    integer(kind=i32), intent(out) :: bounce_count

interface

  • public module subroutine init_particle_batch_from_config(cfg, batch_idx, pcls, state, mesh, photo_emission_dq, mpi_rank, mpi_size, mpi, photo_failure, snapshot, source_plan, photo_emission_dq_by_species, slot_ids)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: cfg
    integer(kind=i32), intent(in) :: batch_idx
    type(particles_soa), intent(out) :: pcls
    type(injection_state), intent(inout), optional :: state
    type(mesh_type), intent(in), optional :: mesh
    real(kind=dp), intent(out), optional :: photo_emission_dq(:)
    integer(kind=i32), intent(in), optional :: mpi_rank
    integer(kind=i32), intent(in), optional :: mpi_size
    type(mpi_context), intent(in), optional :: mpi
    type(photo_ray_failure_type), intent(out), optional :: photo_failure

    不完全な photo collision query(省略時は停止)。

    type(electrostatic_snapshot_type), intent(inout), optional :: snapshot
    type(particle_source_plan_type), intent(in) :: source_plan
    real(kind=dp), intent(out), optional :: photo_emission_dq_by_species(:,:)
    integer(kind=i32), intent(out), optional, allocatable :: slot_ids(:)

    各粒子の global slot 番号(粒子追跡の境界・二次電子乱数の鍵に使う)。

interface

  • public module subroutine reservoir_face_velocity_correction(cfg, spec, vmin_normal, barrier_normal, mesh, snapshot, warn_face_variation, face_potential, face_potential_ready)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: cfg
    type(particle_species_spec), intent(in) :: spec
    real(kind=dp), intent(out) :: vmin_normal
    real(kind=dp), intent(out) :: barrier_normal
    type(mesh_type), intent(in), optional :: mesh
    type(electrostatic_snapshot_type), intent(inout), optional :: snapshot
    logical, intent(in), optional :: warn_face_variation
    real(kind=dp), intent(inout), optional :: face_potential(4)

    面の電位統計 (平均, 標準偏差, 最小, 最大) [V] の cache。face_potential_ready が真なら評価せずに使い、 偽なら評価して書き込む。box 面全体の統計なので、同じ snapshot の 1 layout 内では種によらず共有できる。

    logical, intent(inout), optional :: face_potential_ready

interface

  • public module subroutine external_kinetic_face_velocity_correction(cfg, spec, reservoir_potential_v, access_potential_v, vmin_normal, barrier_normal, mesh, snapshot, warn_face_variation, face_potential, face_potential_ready)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: cfg
    type(particle_species_spec), intent(in) :: spec
    real(kind=dp), intent(in) :: reservoir_potential_v
    real(kind=dp), intent(in) :: access_potential_v
    real(kind=dp), intent(out) :: vmin_normal
    real(kind=dp), intent(out) :: barrier_normal
    type(mesh_type), intent(in), optional :: mesh
    type(electrostatic_snapshot_type), intent(inout), optional :: snapshot
    logical, intent(in), optional :: warn_face_variation
    real(kind=dp), intent(inout), optional :: face_potential(4)

    面の電位統計 (平均, 標準偏差, 最小, 最大) [V] の cache。face_potential_ready が真なら評価せずに使い、 偽なら評価して書き込む。box 面全体の統計なので、同じ snapshot の 1 layout 内では種によらず共有できる。

    logical, intent(inout), optional :: face_potential_ready

Derived Types

type, public ::  particle_source_plan_type

type, public ::  batch_injection_layout_type

1 バッチの注入 layout。全 rank で同じ global 粒子数と面ごとの速度補正を持ち、 static の rank 分割と shared の slot pool の両方がこれを基に粒子を作る。 segment は species 順に source(volume_seed または photo ray)、次に面 1..6 の reservoir が並ぶ。

Components

Type Visibility Attributes Name Initial
logical, public :: ready = .false.
integer(kind=i32), public :: batch_idx = 0_i32
integer(kind=i32), public :: nspecies = 0_i32
integer(kind=i32), public, allocatable :: source_kind(:)
integer(kind=i32), public, allocatable :: source_global_count(:)
integer(kind=i32), public, allocatable :: boundary_global_count(:,:)
real(kind=dp), public, allocatable :: boundary_vmin(:,:)
real(kind=dp), public, allocatable :: boundary_barrier(:,:)
real(kind=dp), public, allocatable :: weight(:)
real(kind=dp), public, allocatable :: temperature_k(:)
real(kind=dp), public, allocatable :: drift_velocity(:,:)
real(kind=dp), public, allocatable :: photo_emit_current_density(:)
real(kind=dp), public, allocatable :: photo_normal_drift_speed(:)
real(kind=dp), public, allocatable :: photo_ray_weight(:)

1 本の ray が当たったときのマクロ粒子重み(全 rank 合計の ray 数で分担)。

integer(kind=i32), public :: nsegments = 0_i32
integer(kind=i32), public :: total_slots = 0_i32
integer(kind=i32), public, allocatable :: segment_species(:)
integer(kind=i32), public, allocatable :: segment_kind(:)
integer(kind=i32), public, allocatable :: segment_face(:)
integer(kind=i32), public, allocatable :: segment_begin(:)
integer(kind=i32), public, allocatable :: segment_end(:)
integer(kind=i32), public :: nbands = 0_i32

slot は segment を round-robin に回って並ぶ(segment 内 index k の周回で、長さが k 以上の segment を順に取る)。 取り合う順に種が混ざり、static の round-robin 組み立てと同じ処理順になる。slot ごとの表は持たず、 segment 長の相異なる値ごとの帯で locate_slot が (segment, segment 内 index) を求める。 帯 b は segment 内 index が band_length(b-1)+1 .. band_length(b) の周回で、band_length(0)=0。

integer(kind=i32), public, allocatable :: band_length(:)
integer(kind=i32), public, allocatable :: band_last_slot(:)

帯 b の最後の global slot(band_last_slot(0)=0)。

Type-Bound Procedures

procedure, public :: locate_slot => locate_batch_slot

Functions

public pure function particle_source_plan_matches_mpi(plan, local_rank, n_ranks, mpi_argument_present) result(matches)

source plan がこの rank/size と mpi 引数の有無で構築されたかを返す。 rank、size、mpi 引数の有無はそれぞれ独立に一致する必要がある。

Arguments

Type IntentOptional Attributes Name
type(particle_source_plan_type), intent(in) :: plan

build_particle_source_plan で構築した source plan。

integer(kind=i32), intent(in) :: local_rank

今回解決した rank 番号。

integer(kind=i32), intent(in) :: n_ranks

今回解決した rank 番号。 今回解決した rank 数。

logical, intent(in) :: mpi_argument_present

今回 mpi_context を渡したか。

Return Value logical

public pure function has_boundary_inflow(spec) result(has_inflow)

speciesに外部 reservoir 流入を指定したbox面があるかを返す。

Arguments

Type IntentOptional Attributes Name
type(particle_species_spec), intent(in) :: spec

Return Value logical


Subroutines

public pure subroutine locate_batch_slot(self, slot, segment, local_index)

global slot から (segment, segment 内 index) を求める。O(nsegments) で、slot ごとの表を持たない。

Arguments

Type IntentOptional Attributes Name
class(batch_injection_layout_type), intent(in) :: self
integer(kind=i32), intent(in) :: slot

1..total_slots の global slot。

integer(kind=i32), intent(out) :: segment

slot が属する segment。

integer(kind=i32), intent(out) :: local_index

slot が属する segment。 segment 内の 1 始まり index。

public subroutine seed_particles_from_config(cfg, mpi_rank, mpi_size, mpi)

バッチ生成前に乱数シードだけを初期化する。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(in) :: cfg

乱数シード値 sim.rng_seed を含むアプリ設定。

integer(kind=i32), intent(in), optional :: mpi_rank
integer(kind=i32), intent(in), optional :: mpi_size
type(mpi_context), intent(in), optional :: mpi

public subroutine build_particle_source_plan(cfg, plan, mpi_rank, mpi_size, mpi, kinetic_inflow_active, kinetic_reservoir_potential_v, kinetic_access_potential_v, kinetic_inflow_face, number_flux_override_active, number_flux_override_m2_s, kinetic_reservoir_density_m3)

設定とMPI配置だけに依存する粒子 source の導出値を構築する。 乱数、残差、mesh/snapshot依存の障壁は扱わず、run中に不変な値だけを保持する。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(in) :: cfg
type(particle_source_plan_type), intent(out) :: plan
integer(kind=i32), intent(in), optional :: mpi_rank
integer(kind=i32), intent(in), optional :: mpi_size
type(mpi_context), intent(in), optional :: mpi
logical, intent(in), optional :: kinetic_inflow_active(:)
real(kind=dp), intent(in), optional :: kinetic_reservoir_potential_v(:)
real(kind=dp), intent(in), optional :: kinetic_access_potential_v(:)
integer(kind=i32), intent(in), optional :: kinetic_inflow_face(:)
logical, intent(in), optional :: number_flux_override_active(:)
real(kind=dp), intent(in), optional :: number_flux_override_m2_s(:)
real(kind=dp), intent(in), optional :: kinetic_reservoir_density_m3(:)

流入写像の面だけで使う貯留部密度。0以下の要素は species 設定の密度を使う。

public subroutine apply_kinetic_map_arguments(plan, nspecies, kinetic_inflow_active, kinetic_reservoir_potential_v, kinetic_access_potential_v, kinetic_inflow_face, kinetic_reservoir_density_m3)

外部 closure の kinetic 写像(有効フラグ・貯留部/access 電位・面・貯留部密度)を検査して plan へ写す。

Arguments

Type IntentOptional Attributes Name
type(particle_source_plan_type), intent(inout) :: plan
integer(kind=i32), intent(in) :: nspecies
logical, intent(in), optional :: kinetic_inflow_active(:)
real(kind=dp), intent(in), optional :: kinetic_reservoir_potential_v(:)
real(kind=dp), intent(in), optional :: kinetic_access_potential_v(:)
integer(kind=i32), intent(in), optional :: kinetic_inflow_face(:)
real(kind=dp), intent(in), optional :: kinetic_reservoir_density_m3(:)

public subroutine apply_number_flux_override_arguments(plan, nspecies, number_flux_override_active, number_flux_override_m2_s)

外部 closure の number-flux override の有効フラグを検査して plan へ写す(flux 値は種の解決時に使う)。

Arguments

Type IntentOptional Attributes Name
type(particle_source_plan_type), intent(inout) :: plan
integer(kind=i32), intent(in) :: nspecies
logical, intent(in), optional :: number_flux_override_active(:)
real(kind=dp), intent(in), optional :: number_flux_override_m2_s(:)

public pure subroutine make_boundary_inflow_spec(sim, source_spec, face, inflow_spec)

box 全面の境界流入をサンプリングする面座標を構築する。

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim
type(particle_species_spec), intent(in) :: source_spec
integer(kind=i32), intent(in) :: face
type(particle_species_spec), intent(out) :: inflow_spec

public subroutine compute_macro_particles_for_species(sim, spec, residual, count, vmin_normal, number_density_override, w_particle_override, temperature_k_override, drift_velocity_override, particle_flux_override, use_particle_flux_override)

境界流入用に、物理流量と残差から今バッチのマクロ粒子数を決める。

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim

ボックス境界・バッチ時間などのシミュレーション設定。

type(particle_species_spec), intent(in) :: spec

境界流入面の粒子種設定。

real(kind=dp), intent(inout) :: residual

前バッチから繰り越した端数。

integer(kind=i32), intent(out) :: count

今バッチで生成するマクロ粒子数。

real(kind=dp), intent(in), optional :: vmin_normal

法線速度の下限 [m/s](省略時は 0)。

real(kind=dp), intent(in), optional :: number_density_override

数密度の上書き値 [1/m^3]。

real(kind=dp), intent(in), optional :: w_particle_override

マクロ粒子重みの上書き値。

real(kind=dp), intent(in), optional :: temperature_k_override

温度の上書き値 [K]。

real(kind=dp), intent(in), optional :: drift_velocity_override(3)
real(kind=dp), intent(in), optional :: particle_flux_override

粒子数 flux の上書き値 [1/m^2/s]。

logical, intent(in), optional :: use_particle_flux_override

public subroutine resolve_parallel_rank_size(local_rank, n_ranks, mpi_rank, mpi_size, mpi, caller_name)

併存対応のため mpi_context と rank/size の両方を受け、最終的なrank/sizeを解決する。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(out) :: local_rank
integer(kind=i32), intent(out) :: n_ranks
integer(kind=i32), intent(in), optional :: mpi_rank
integer(kind=i32), intent(in), optional :: mpi_size
type(mpi_context), intent(in), optional :: mpi
character(len=*), intent(in) :: caller_name