bem_particle_stepper Module

同一時刻の粒子状態から、空間電場を中点評価した1ステップ候補を構築する。


Uses

  • module~~bem_particle_stepper~~UsesGraph module~bem_particle_stepper bem_particle_stepper ieee_arithmetic ieee_arithmetic module~bem_particle_stepper->ieee_arithmetic module~bem_boundary bem_boundary module~bem_particle_stepper->module~bem_boundary module~bem_collision bem_collision module~bem_particle_stepper->module~bem_collision module~bem_counter_rng bem_counter_rng module~bem_particle_stepper->module~bem_counter_rng module~bem_electrostatic_snapshot bem_electrostatic_snapshot module~bem_particle_stepper->module~bem_electrostatic_snapshot module~bem_external_boundary_contract bem_external_boundary_contract module~bem_particle_stepper->module~bem_external_boundary_contract module~bem_irradiation_cell_contract bem_irradiation_cell_contract module~bem_particle_stepper->module~bem_irradiation_cell_contract module~bem_kinds bem_kinds module~bem_particle_stepper->module~bem_kinds module~bem_pusher bem_pusher module~bem_particle_stepper->module~bem_pusher module~bem_status_codes bem_status_codes module~bem_particle_stepper->module~bem_status_codes module~bem_types bem_types module~bem_particle_stepper->module~bem_types 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->module~bem_kinds module~bem_collision->module~bem_status_codes module~bem_collision->module~bem_types iso_fortran_env iso_fortran_env module~bem_collision->iso_fortran_env module~bem_string_utils bem_string_utils module~bem_collision->module~bem_string_utils module~bem_counter_rng->module~bem_kinds iso_c_binding iso_c_binding module~bem_counter_rng->iso_c_binding m_pcg64_bind m_pcg64_bind module~bem_counter_rng->m_pcg64_bind module~bem_electrostatic_snapshot->ieee_arithmetic module~bem_electrostatic_snapshot->module~bem_kinds module~bem_electrostatic_snapshot->module~bem_types module~bem_constants bem_constants module~bem_electrostatic_snapshot->module~bem_constants 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_mpi bem_mpi module~bem_electrostatic_snapshot->module~bem_mpi 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_physics_config_types bem_physics_config_types 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_electrostatic_snapshot->module~bem_string_utils module~bem_external_boundary_contract->module~bem_kinds module~bem_external_boundary_contract->module~bem_string_utils module~bem_irradiation_cell_contract->module~bem_kinds module~bem_irradiation_cell_contract->module~bem_types module~bem_app_config_types bem_app_config_types module~bem_irradiation_cell_contract->module~bem_app_config_types module~bem_irradiation_cell_contract->module~bem_string_utils module~bem_kinds->iso_fortran_env module~bem_pusher->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_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_app_config_types->module~bem_physics_config_types module~bem_filesystem bem_filesystem module~bem_app_config_types->module~bem_filesystem module~bem_constants->module~bem_kinds module~bem_coulomb_fmm_periodic_nonzero_reference->ieee_arithmetic 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_constants 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_kinds module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_types module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_constants module~bem_field_solver->ieee_arithmetic module~bem_field_solver->module~bem_kinds module~bem_field_solver->module~bem_types module~bem_field_solver->module~bem_constants module~bem_field_solver->module~bem_mpi module~bem_field_solver->module~bem_physics_config_types module~bem_field_solver->module~bem_runtime_modes module~bem_field_solver->module~bem_string_utils module~bem_coulomb_fmm_core bem_coulomb_fmm_core module~bem_field_solver->module~bem_coulomb_fmm_core module~bem_mpi->module~bem_kinds 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_kinds module~bem_panel_kernel->module~bem_constants 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_kinds module~bem_periodic_zero_mode_eval->module~bem_constants 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_kinds module~bem_periodic_zero_mode_plan->module~bem_types module~bem_periodic_zero_mode_plan->module~bem_constants module~bem_sorting bem_sorting module~bem_periodic_zero_mode_plan->module~bem_sorting module~bem_physics_config_types->ieee_arithmetic module~bem_physics_config_types->module~bem_kinds module~bem_physics_config_types->module~bem_types module~bem_physics_config_types->module~bem_string_utils module~bem_runtime_modes->module~bem_kinds module~bem_runtime_modes->module~bem_string_utils 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_filesystem->iso_c_binding module~bem_panel_self_terms->module~bem_kinds module~bem_panel_self_terms->module~bem_panel_geometry module~bem_sorting->module~bem_kinds module~bem_triangle_quadrature->module~bem_kinds module~bem_triangle_quadrature->module~bem_constants 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_particle_stepper~~UsedByGraph module~bem_particle_stepper bem_particle_stepper module~bem_simulator bem_simulator module~bem_simulator->module~bem_particle_stepper module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_particle_stepper module~bem_simulator_particles->module~bem_simulator module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_io bem_simulator_io module~bem_simulator_io->module~bem_simulator module~bem_simulator_loop bem_simulator_loop module~bem_simulator_loop->module~bem_simulator module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator program~main main program~main->module~bem_simulator

Variables

Type Visibility Attributes Name Initial
real(kind=dp), public, parameter :: particle_substep_energy_floor_j = 1.0e-4_dp*1.602176634e-19_dp

適応サブステップが step を半分にする最小の仕事 [J]。電場変化が相対的に大きくても、 step の仕事に換算してこれより小さければ粒子のエネルギーには効かないので分けない。


Derived Types

type, public ::  particle_step_result

Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: x(3) = 0.0_dp
real(kind=dp), public :: v(3) = 0.0_dp
logical, public :: absorbed = .false.
logical, public :: escaped_boundary = .false.
integer(kind=i32), public :: elem_idx = -1_i32
integer(kind=i32), public :: status = particle_step_ok
integer(kind=i32), public :: wall_outward_event_count = 0_i32
integer(kind=i32), public :: outer_barrier_return_count = 0_i32
integer(kind=i32), public :: outer_barrier_escape_count = 0_i32
real(kind=dp), public :: wall_outward_normal_kinetic_energy_j_sum = 0.0_dp

Functions

public pure function particle_substep_needs_halving(e_mid, e_ref, q, x0, x1, change_max, energy_floor) result(needs)

step 候補の中点電場 e_mid が参照電場 e_ref から change_max の割合より大きく変わり、 その差が変位 x1-x0 にわたる仕事に換算して床値を超えるとき真。

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: e_mid(3)
real(kind=dp), intent(in) :: e_ref(3)
real(kind=dp), intent(in) :: q
real(kind=dp), intent(in) :: x0(3)
real(kind=dp), intent(in) :: x1(3)
real(kind=dp), intent(in) :: change_max
real(kind=dp), intent(in), optional :: energy_floor

仕事の床値 [J](省略時は particle_substep_energy_floor_j)。

Return Value logical


Subroutines

public subroutine build_particle_step_candidate(mesh, sim, snapshot, bfield, x0, v0, q, m, dt, x1, v1, sampled_electric_field, use_upper_panel_fourier, field_available)

予測中点の電場と一様磁場を使い、次時刻の位置・速度候補を返す。

Arguments

Type IntentOptional Attributes Name
type(mesh_type), intent(in) :: mesh
class(particle_domain_config), intent(in) :: sim
type(electrostatic_snapshot_type), intent(inout) :: snapshot
real(kind=dp), intent(in) :: bfield(3)
real(kind=dp), intent(in) :: x0(3)
real(kind=dp), intent(in) :: v0(3)
real(kind=dp), intent(in) :: q
real(kind=dp), intent(in) :: m
real(kind=dp), intent(in) :: dt
real(kind=dp), intent(out) :: x1(3)
real(kind=dp), intent(out) :: v1(3)
real(kind=dp), intent(out), optional :: sampled_electric_field(3)
logical, intent(in), optional :: use_upper_panel_fourier
logical, intent(out), optional :: field_available

public subroutine advance_particle_step(mesh, sim, snapshot, bfield, x0, v0, q, m, dt, result, boundary_contract, boundary_rng_counter, cell)

一つの粒子stepについてmesh/boxの最早eventを順序付ける。

Arguments

Type IntentOptional Attributes Name
type(mesh_type), intent(in) :: mesh
class(particle_domain_config), intent(in) :: sim
type(electrostatic_snapshot_type), intent(inout) :: snapshot
real(kind=dp), intent(in) :: bfield(3)
real(kind=dp), intent(in) :: x0(3)
real(kind=dp), intent(in) :: v0(3)
real(kind=dp), intent(in) :: q
real(kind=dp), intent(in) :: m
real(kind=dp), intent(in) :: dt
type(particle_step_result), intent(out) :: result
type(external_boundary_contract_type), intent(in), optional :: boundary_contract
integer(kind=i64), intent(in), optional :: boundary_rng_counter(4)
type(irradiation_cell_contract_type), intent(in) :: cell

public subroutine advance_particle_step_upper_panel_fourier(mesh, sim, snapshot, bfield, x0, v0, q, m, dt, result, field_available, boundary_contract, boundary_rng_counter, cell)

上部真空域のfactorized P0-panel Fourier場だけで、失敗した1 stepを最初から再試行する。

Arguments

Type IntentOptional Attributes Name
type(mesh_type), intent(in) :: mesh
class(particle_domain_config), intent(in) :: sim
type(electrostatic_snapshot_type), intent(inout) :: snapshot
real(kind=dp), intent(in) :: bfield(3)
real(kind=dp), intent(in) :: x0(3)
real(kind=dp), intent(in) :: v0(3)
real(kind=dp), intent(in) :: q
real(kind=dp), intent(in) :: m
real(kind=dp), intent(in) :: dt
type(particle_step_result), intent(out) :: result
logical, intent(out) :: field_available
type(external_boundary_contract_type), intent(in), optional :: boundary_contract
integer(kind=i64), intent(in), optional :: boundary_rng_counter(4)
type(irradiation_cell_contract_type), intent(in) :: cell

public subroutine resolve_particle_boundary_candidate(mesh, sim, snapshot, bfield, x0, v0, q, m, dt, x_candidate, v_candidate, hit, result, boundary_contract, boundary_rng_counter, sampled_electric_field, cell)

構築済みcandidateとその場評価値からbox eventを解決する。

Arguments

Type IntentOptional Attributes Name
type(mesh_type), intent(in) :: mesh
class(particle_domain_config), intent(in) :: sim
type(electrostatic_snapshot_type), intent(inout) :: snapshot
real(kind=dp), intent(in) :: bfield(3)
real(kind=dp), intent(in) :: x0(3)
real(kind=dp), intent(in) :: v0(3)
real(kind=dp), intent(in) :: q
real(kind=dp), intent(in) :: m
real(kind=dp), intent(in) :: dt
real(kind=dp), intent(in) :: x_candidate(3)
real(kind=dp), intent(in) :: v_candidate(3)
type(hit_info), intent(in), optional :: hit
type(particle_step_result), intent(out) :: result
type(external_boundary_contract_type), intent(in), optional :: boundary_contract
integer(kind=i64), intent(in), optional :: boundary_rng_counter(4)
real(kind=dp), intent(in), optional :: sampled_electric_field(3)
type(irradiation_cell_contract_type), intent(in) :: cell