bem_random_stream Module

逐次に引く PCG64 の乱数列(Fortran 組み込み random_number の置き換え)。

seed_random_stream で seed を決めると、各 OpenMP thread は (seed, thread 番号) から作った自分の PCG64 stream を 初回の draw で開く。同じ seed・同じ thread で引けば同じ列になる。バッチ粒子の生成と粒子追跡は bem_counter_rng の counter-based 乱数を使い、この列は単体の sampling API と test だけが使う。


Uses

  • module~~bem_random_stream~~UsesGraph module~bem_random_stream bem_random_stream iso_c_binding iso_c_binding module~bem_random_stream->iso_c_binding m_pcg64_bind m_pcg64_bind module~bem_random_stream->m_pcg64_bind module~bem_counter_rng bem_counter_rng module~bem_random_stream->module~bem_counter_rng module~bem_kinds bem_kinds module~bem_random_stream->module~bem_kinds module~bem_counter_rng->iso_c_binding module~bem_counter_rng->m_pcg64_bind module~bem_counter_rng->module~bem_kinds iso_fortran_env iso_fortran_env module~bem_kinds->iso_fortran_env

Used by

  • module~~bem_random_stream~~UsedByGraph module~bem_random_stream bem_random_stream module~bem_injection_random bem_injection_random module~bem_injection_random->module~bem_random_stream module~bem_app_config_particle_runtime_slots bem_app_config_particle_runtime_slots module~bem_app_config_particle_runtime_slots->module~bem_injection_random module~bem_injection bem_injection module~bem_app_config_particle_runtime_slots->module~bem_injection module~bem_app_config_particle_runtime bem_app_config_particle_runtime module~bem_app_config_particle_runtime_slots->module~bem_app_config_particle_runtime module~bem_injection->module~bem_injection_random module~bem_injection_flux bem_injection_flux module~bem_injection->module~bem_injection_flux module~bem_photoelectron_injection bem_photoelectron_injection module~bem_injection->module~bem_photoelectron_injection module~bem_injection_flux->module~bem_injection_random module~bem_photoelectron_injection->module~bem_injection_random module~bem_photoelectron_injection->module~bem_injection_flux module~bem_app_config_parser bem_app_config_parser module~bem_app_config_parser->module~bem_injection_flux module~bem_app_config_particle_runtime->module~bem_injection module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_photoelectron_injection module~bem_simulator bem_simulator module~bem_simulator_particles->module~bem_simulator module~bem_app_config bem_app_config module~bem_app_config->module~bem_app_config_parser module~bem_app_config_runtime bem_app_config_runtime module~bem_app_config->module~bem_app_config_runtime module~bem_app_config_parser_finalize bem_app_config_parser_finalize module~bem_app_config_parser_finalize->module~bem_app_config_parser module~bem_app_config_parser_preflight_particles bem_app_config_parser_preflight_particles module~bem_app_config_parser_preflight_particles->module~bem_app_config_parser module~bem_app_config_parser_preflight_sim bem_app_config_parser_preflight_sim module~bem_app_config_parser_preflight_sim->module~bem_app_config_parser module~bem_app_config_parser_preflight_surface bem_app_config_parser_preflight_surface module~bem_app_config_parser_preflight_surface->module~bem_app_config_parser module~bem_app_config_parser_read_mesh bem_app_config_parser_read_mesh module~bem_app_config_parser_read_mesh->module~bem_app_config_parser module~bem_app_config_parser_read_particles bem_app_config_parser_read_particles module~bem_app_config_parser_read_particles->module~bem_app_config_parser module~bem_app_config_parser_read_sim bem_app_config_parser_read_sim module~bem_app_config_parser_read_sim->module~bem_app_config_parser module~bem_app_config_parser_read_surface bem_app_config_parser_read_surface module~bem_app_config_parser_read_surface->module~bem_app_config_parser module~bem_app_config_parser_validate bem_app_config_parser_validate module~bem_app_config_parser_validate->module~bem_app_config_parser 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_runtime->module~bem_app_config_particle_runtime module~bem_simulator->module~bem_app_config module~bem_simulator->module~bem_app_config_runtime 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_zhao_outflow_refresh->module~bem_app_config program~main main program~main->module~bem_app_config program~main->module~bem_simulator module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator

Interfaces

public interface random_uniform

  • private subroutine random_uniform_scalar(x)

    [0, 1) の一様乱数を 1 つ引く。

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(out) :: x
  • private subroutine random_uniform_1d(x)

    配列を要素順に [0, 1) の一様乱数で埋める。

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(out) :: x(:)
  • private subroutine random_uniform_2d(x)

    配列を列優先の要素順に [0, 1) の一様乱数で埋める。

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(out) :: x(:,:)

Subroutines

public subroutine seed_random_stream(seed_values)

乱数列の seed を設定する。複数の値は順に混ぜて 1 つの seed にする。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(in) :: seed_values(:)