bem_runtime_modes.f90 Source File


This file depends on

sourcefile~~bem_runtime_modes.f90~~EfferentGraph sourcefile~bem_runtime_modes.f90 bem_runtime_modes.f90 sourcefile~bem_kinds.f90 bem_kinds.f90 sourcefile~bem_runtime_modes.f90->sourcefile~bem_kinds.f90 sourcefile~bem_string_utils.f90 bem_string_utils.f90 sourcefile~bem_runtime_modes.f90->sourcefile~bem_string_utils.f90

Files dependent on this one

sourcefile~~bem_runtime_modes.f90~~AfferentGraph sourcefile~bem_runtime_modes.f90 bem_runtime_modes.f90 sourcefile~bem_electrostatic_snapshot.f90 bem_electrostatic_snapshot.f90 sourcefile~bem_electrostatic_snapshot.f90->sourcefile~bem_runtime_modes.f90 sourcefile~bem_field_solver.f90 bem_field_solver.f90 sourcefile~bem_electrostatic_snapshot.f90->sourcefile~bem_field_solver.f90 sourcefile~bem_field_solver.f90->sourcefile~bem_runtime_modes.f90 sourcefile~bem_simulator_charge.f90 bem_simulator_charge.f90 sourcefile~bem_simulator_charge.f90->sourcefile~bem_runtime_modes.f90 sourcefile~bem_surface_closure_contract.f90 bem_surface_closure_contract.f90 sourcefile~bem_simulator_charge.f90->sourcefile~bem_surface_closure_contract.f90 sourcefile~bem_simulator.f90 bem_simulator.f90 sourcefile~bem_simulator_charge.f90->sourcefile~bem_simulator.f90 sourcefile~bem_surface_closure_contract.f90->sourcefile~bem_runtime_modes.f90 sourcefile~bem_zhao_outflow_refresh.f90 bem_zhao_outflow_refresh.f90 sourcefile~bem_zhao_outflow_refresh.f90->sourcefile~bem_runtime_modes.f90 sourcefile~bem_zhao_outflow_refresh.f90->sourcefile~bem_surface_closure_contract.f90 sourcefile~bem_surface_current_model.f90 bem_surface_current_model.f90 sourcefile~bem_zhao_outflow_refresh.f90->sourcefile~bem_surface_current_model.f90 sourcefile~bem_app_config.f90 bem_app_config.f90 sourcefile~bem_zhao_outflow_refresh.f90->sourcefile~bem_app_config.f90 sourcefile~bem_app_config_particle_runtime.f90 bem_app_config_particle_runtime.f90 sourcefile~bem_app_config_particle_runtime.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_app_config_potential_runtime.f90 bem_app_config_potential_runtime.f90 sourcefile~bem_app_config_particle_runtime.f90->sourcefile~bem_app_config_potential_runtime.f90 sourcefile~bem_app_config_potential_runtime.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_electrostatic_snapshot_eval.f90 bem_electrostatic_snapshot_eval.f90 sourcefile~bem_electrostatic_snapshot_eval.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_electrostatic_snapshot_upper_fourier.f90 bem_electrostatic_snapshot_upper_fourier.f90 sourcefile~bem_electrostatic_snapshot_upper_fourier.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_field_solver_config.f90 bem_field_solver_config.f90 sourcefile~bem_field_solver_config.f90->sourcefile~bem_field_solver.f90 sourcefile~bem_field_solver_eval.f90 bem_field_solver_eval.f90 sourcefile~bem_field_solver_eval.f90->sourcefile~bem_field_solver.f90 sourcefile~bem_field_solver_fmm.f90 bem_field_solver_fmm.f90 sourcefile~bem_field_solver_fmm.f90->sourcefile~bem_field_solver.f90 sourcefile~bem_field_solver_tree.f90 bem_field_solver_tree.f90 sourcefile~bem_field_solver_tree.f90->sourcefile~bem_field_solver.f90 sourcefile~bem_output_writer.f90 bem_output_writer.f90 sourcefile~bem_output_writer.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_output_writer.f90->sourcefile~bem_surface_current_model.f90 sourcefile~bem_output_writer_summary.f90 bem_output_writer_summary.f90 sourcefile~bem_output_writer_summary.f90->sourcefile~bem_field_solver.f90 sourcefile~bem_output_writer_summary.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_output_writer_summary.f90->sourcefile~bem_surface_current_model.f90 sourcefile~bem_particle_stepper.f90 bem_particle_stepper.f90 sourcefile~bem_particle_stepper.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_simulator.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~bem_simulator.f90->sourcefile~bem_surface_closure_contract.f90 sourcefile~bem_simulator.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_simulator.f90->sourcefile~bem_particle_stepper.f90 sourcefile~bem_simulator.f90->sourcefile~bem_surface_current_model.f90 sourcefile~bem_surface_models.f90 bem_surface_models.f90 sourcefile~bem_simulator.f90->sourcefile~bem_surface_models.f90 sourcefile~bem_app_config_runtime.f90 bem_app_config_runtime.f90 sourcefile~bem_simulator.f90->sourcefile~bem_app_config_runtime.f90 sourcefile~bem_run_outputs.f90 bem_run_outputs.f90 sourcefile~bem_simulator.f90->sourcefile~bem_run_outputs.f90 sourcefile~bem_simulator.f90->sourcefile~bem_app_config.f90 sourcefile~bem_simulator_loop.f90 bem_simulator_loop.f90 sourcefile~bem_simulator_loop.f90->sourcefile~bem_zhao_outflow_refresh.f90 sourcefile~bem_simulator_loop.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_simulator_loop.f90->sourcefile~bem_simulator.f90 sourcefile~bem_simulator_loop.f90->sourcefile~bem_app_config_runtime.f90 sourcefile~bem_periodic_checkpoint.f90 bem_periodic_checkpoint.f90 sourcefile~bem_simulator_loop.f90->sourcefile~bem_periodic_checkpoint.f90 sourcefile~bem_simulator_loop.f90->sourcefile~bem_run_outputs.f90 sourcefile~bem_surface_current_model.f90->sourcefile~bem_surface_closure_contract.f90 sourcefile~bem_surface_models.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~main.f90 main.f90 sourcefile~main.f90->sourcefile~bem_electrostatic_snapshot.f90 sourcefile~main.f90->sourcefile~bem_output_writer.f90 sourcefile~main.f90->sourcefile~bem_simulator.f90 sourcefile~main.f90->sourcefile~bem_periodic_checkpoint.f90 sourcefile~main.f90->sourcefile~bem_run_outputs.f90 sourcefile~main.f90->sourcefile~bem_app_config.f90 sourcefile~bem_app_config_particle_runtime_batch.f90 bem_app_config_particle_runtime_batch.f90 sourcefile~bem_app_config_particle_runtime_batch.f90->sourcefile~bem_app_config_particle_runtime.f90 sourcefile~bem_app_config_particle_runtime_sampling.f90 bem_app_config_particle_runtime_sampling.f90 sourcefile~bem_app_config_particle_runtime_sampling.f90->sourcefile~bem_app_config_particle_runtime.f90 sourcefile~bem_app_config_particle_runtime_slots.f90 bem_app_config_particle_runtime_slots.f90 sourcefile~bem_app_config_particle_runtime_slots.f90->sourcefile~bem_app_config_particle_runtime.f90 sourcefile~bem_app_config_runtime.f90->sourcefile~bem_app_config_particle_runtime.f90 sourcefile~bem_app_config_runtime.f90->sourcefile~bem_app_config_potential_runtime.f90 sourcefile~bem_output_writer_files.f90 bem_output_writer_files.f90 sourcefile~bem_output_writer_files.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_output_writer_history.f90 bem_output_writer_history.f90 sourcefile~bem_output_writer_history.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_periodic_checkpoint.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_run_outputs.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_run_outputs.f90->sourcefile~bem_periodic_checkpoint.f90 sourcefile~bem_simulator_io.f90 bem_simulator_io.f90 sourcefile~bem_simulator_io.f90->sourcefile~bem_output_writer.f90 sourcefile~bem_simulator_io.f90->sourcefile~bem_simulator.f90 sourcefile~bem_simulator_io.f90->sourcefile~bem_app_config_runtime.f90 sourcefile~bem_simulator_particles.f90 bem_simulator_particles.f90 sourcefile~bem_simulator_particles.f90->sourcefile~bem_particle_stepper.f90 sourcefile~bem_simulator_particles.f90->sourcefile~bem_simulator.f90 sourcefile~bem_simulator_stats.f90 bem_simulator_stats.f90 sourcefile~bem_simulator_stats.f90->sourcefile~bem_simulator.f90 sourcefile~bem_surface_models_conductor.f90 bem_surface_models_conductor.f90 sourcefile~bem_surface_models_conductor.f90->sourcefile~bem_surface_models.f90 sourcefile~bem_app_config.f90->sourcefile~bem_app_config_runtime.f90

Source Code

!> 設定の文字列モードを実行時に一度だけ解決した整数 enum。
!! 設定キー・summary・エラーメッセージの文字列はそのままにし、粒子・評価ループは解決済みの値だけを比べる。
!! 文字列は parser/preflight が小文字化・検証済みなので、ここでは大文字小文字を区別しない比較で写すだけにする。
module bem_runtime_modes
  use bem_kinds, only: i32
  use bem_string_utils, only: lower_ascii
  implicit none
  private

  !> 場ソルバの評価方式(fields.solver.method を要素数で解決した後の値)。
  integer(i32), parameter, public :: field_solver_mode_direct = 0_i32
  integer(i32), parameter, public :: field_solver_mode_treecode = 1_i32
  integer(i32), parameter, public :: field_solver_mode_fmm = 2_i32

  !> particles.species.charging.closure。
  integer(i32), parameter, public :: surface_charge_closure_explicit = 0_i32
  integer(i32), parameter, public :: surface_charge_closure_fixed_current = 1_i32
  integer(i32), parameter, public :: surface_charge_closure_neutral_return = 2_i32
  integer(i32), parameter, public :: surface_charge_closure_unknown = -1_i32

  !> fields.periodic.lower_boundary_model(zero mode の下端条件)。
  integer(i32), parameter, public :: lower_boundary_e_bottom_zero = 0_i32
  integer(i32), parameter, public :: lower_boundary_symmetric_vacuum = 1_i32
  integer(i32), parameter, public :: lower_boundary_e_top_from_sheath = 2_i32
  integer(i32), parameter, public :: lower_boundary_unknown = -1_i32

  ! 種ごとの固定電流 closure の方式。contract の目標・partner・反射電子・追跡源の指定から
  ! bem_surface_closure_contract::species_closure_mode が一意に決める。
  !> 固定電流 closure を当てない。
  integer(i32), parameter, public :: closure_mode_none = 0_i32
  !> 設定または外部根の目標電流へ、追跡した raw channel をそのまま合わせる(外部根の電子・イオン、
  !! PE だけの PE、Type C で全て脱出する PE、反射電子だけを数えるときの電子)。
  integer(i32), parameter, public :: closure_mode_target = 1_i32
  !> 外部根の脱出束が他の追跡種と合算の値で、そのバッチに追跡した partner(SEE)や反射電子の脱出を
  !! この種の脱出・帰還目標から差し引く(PE+SEE の Type A/B の PE、反射電子を数える PE)。
  integer(i32), parameter, public :: closure_mode_escape_partner = 2_i32
  !> 放出目標が根の予測ではなく根に与えた外側源で、帰還・脱出・放出を根へ固定する(PE なしの SEE、
  !! PE+SEE の Type C の SEE)。空の帰還は放出へ畳み、放出がなければ未閉として記録する。
  integer(i32), parameter, public :: closure_mode_tracked_source = 3_i32

  public :: field_solver_mode_id
  public :: surface_charge_closure_id
  public :: lower_boundary_model_id

contains

  !> 'direct' / 'treecode' / 'fmm' を enum へ写す。それ以外は direct(場ソルバの既定と同じ)。
  pure integer(i32) function field_solver_mode_id(mode) result(id)
    character(len=*), intent(in) :: mode

    select case (trim(lower_ascii(mode)))
    case ('fmm')
      id = field_solver_mode_fmm
    case ('treecode')
      id = field_solver_mode_treecode
    case default
      id = field_solver_mode_direct
    end select
  end function field_solver_mode_id

  !> 'explicit' / 'fixed_current' / 'neutral_return' を enum へ写す。未知の値は unknown。
  pure integer(i32) function surface_charge_closure_id(closure) result(id)
    character(len=*), intent(in) :: closure

    select case (trim(lower_ascii(closure)))
    case ('explicit')
      id = surface_charge_closure_explicit
    case ('fixed_current')
      id = surface_charge_closure_fixed_current
    case ('neutral_return')
      id = surface_charge_closure_neutral_return
    case default
      id = surface_charge_closure_unknown
    end select
  end function surface_charge_closure_id

  !> 'e_bottom_zero' / 'symmetric_vacuum' / 'e_top_from_sheath' を enum へ写す。未知の値は unknown。
  pure integer(i32) function lower_boundary_model_id(model) result(id)
    character(len=*), intent(in) :: model

    select case (trim(lower_ascii(model)))
    case ('e_bottom_zero')
      id = lower_boundary_e_bottom_zero
    case ('symmetric_vacuum')
      id = lower_boundary_symmetric_vacuum
    case ('e_top_from_sheath')
      id = lower_boundary_e_top_from_sheath
    case default
      id = lower_boundary_unknown
    end select
  end function lower_boundary_model_id

end module bem_runtime_modes