electrostatic_snapshot_type Derived Type

type, public :: electrostatic_snapshot_type


Inherits

type~~electrostatic_snapshot_type~~InheritsGraph type~electrostatic_snapshot_type electrostatic_snapshot_type type~electrostatic_diagnostics_type electrostatic_diagnostics_type type~electrostatic_snapshot_type->type~electrostatic_diagnostics_type diagnostics type~field_solver_type field_solver_type type~electrostatic_snapshot_type->type~field_solver_type nonzero_solver type~periodic2_physics_config periodic2_physics_config type~electrostatic_snapshot_type->type~periodic2_physics_config periodic_options type~periodic_nonzero_upper_vacuum_plan_type periodic_nonzero_upper_vacuum_plan_type type~electrostatic_snapshot_type->type~periodic_nonzero_upper_vacuum_plan_type upper_fourier_plan type~periodic_zero_mode_plan_type periodic_zero_mode_plan_type type~electrostatic_snapshot_type->type~periodic_zero_mode_plan_type zero_plan type~periodic_zero_mode_state_type periodic_zero_mode_state_type type~electrostatic_snapshot_type->type~periodic_zero_mode_state_type zero_state type~fmm_options_type fmm_options_type type~field_solver_type->type~fmm_options_type fmm_core_options type~fmm_plan_type fmm_plan_type type~field_solver_type->type~fmm_plan_type fmm_core_plan type~fmm_state_type fmm_state_type type~field_solver_type->type~fmm_state_type fmm_core_state type~panel_height_projection_type panel_height_projection_type type~periodic_zero_mode_plan_type->type~panel_height_projection_type panel type~mpi_context mpi_context type~fmm_options_type->type~mpi_context mpi type~fmm_plan_type->type~periodic_zero_mode_plan_type periodic_k0_plan type~fmm_plan_type->type~fmm_options_type options type~panel_geometry_type panel_geometry_type type~fmm_plan_type->type~panel_geometry_type panel_geometry type~periodic2_ewald_data_type periodic2_ewald_data_type type~fmm_plan_type->type~periodic2_ewald_data_type periodic_ewald type~periodic_shell_mean_plan_type periodic_shell_mean_plan_type type~fmm_plan_type->type~periodic_shell_mean_plan_type periodic_shell_mean type~fmm_state_type->type~periodic_zero_mode_state_type periodic_k0_state type~periodic_shell_mean_state_type periodic_shell_mean_state_type type~fmm_state_type->type~periodic_shell_mean_state_type periodic_shell_mean_state

Components

Type Visibility Attributes Name Initial
type(field_solver_type), public :: nonzero_solver
real(kind=dp), public :: prescribed_e(3) = [0.0_dp, 0.0_dp, 0.0_dp]
real(kind=dp), public :: prescribed_phi_origin(3) = [0.0_dp, 0.0_dp, 0.0_dp]
logical, public :: use_zero_mode = .false.
logical, public :: use_panel_spectral_reference = .false.
logical, public :: use_cached_kneq0 = .false.
logical, public :: use_upper_panel_fourier_retry = .false.
real(kind=dp), public :: periodic_length(2) = [0.0_dp, 0.0_dp]
real(kind=dp), public :: periodic_origin(2) = [0.0_dp, 0.0_dp]
integer(kind=i32), public :: reference_mode_layers = 0_i32
integer(kind=i32), public :: panel_quadrature_order = 0_i32
type(periodic_zero_mode_plan_type), public :: zero_plan
type(periodic_zero_mode_state_type), public :: zero_state
type(periodic_nonzero_upper_vacuum_plan_type), public :: upper_fourier_plan
type(periodic2_physics_config), public :: periodic_options
integer(kind=i32), public :: lower_boundary_id = lower_boundary_unknown

periodic_options%lower_boundary_model を init で解決した値。zero mode の更新ごとに文字列を比べない。

type(electrostatic_diagnostics_type), public :: diagnostics
real(kind=dp), public :: gauss_residual = 0.0_dp
logical, public :: matching_plane_gauge_active = .false.
real(kind=dp), public :: matching_plane_z = 0.0_dp
real(kind=dp), public :: matching_plane_phi = 0.0_dp
real(kind=dp), public :: matching_plane_top_field = 0.0_dp

Type-Bound Procedures

procedure, public :: init => init_electrostatic_snapshot

  • private subroutine init_electrostatic_snapshot(self, mesh, sim, field_config, periodic_config, panel_config, mpi)

    mpi は cached_kneq0 の root operator を rank で分担して作るときの文脈。全 rank が同じ引数で呼ぶ。

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    type(sim_config), intent(in) :: sim
    type(field_physics_config), intent(in), optional :: field_config
    type(periodic2_physics_config), intent(in), optional :: periodic_config
    type(panel_kernel_config), intent(in), optional :: panel_config
    type(mpi_context), intent(in), optional :: mpi

procedure, public :: refresh => refresh_electrostatic_snapshot

  • private subroutine refresh_electrostatic_snapshot(self, mesh, mpi)

    電荷から場の状態を更新する。mpi を与えると FMM の M2L を rank で分担する(結果は同じ)。

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    type(mpi_context), intent(in), optional :: mpi

procedure, public :: refresh_zero_mode => refresh_snapshot_zero_mode

  • private subroutine refresh_snapshot_zero_mode(self, mesh)

    Refresh only the physical mean field after a charge commit; no FMM update is needed for receipts.

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh

procedure, public :: eval_local_e => eval_snapshot_local_e

  • interface

    private module subroutine eval_snapshot_local_e(self, mesh, position, electric_field)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: position(3)
    real(kind=dp), intent(out) :: electric_field(3)

procedure, public :: eval_upper_panel_fourier_e => eval_snapshot_upper_panel_fourier_e

  • interface

    private module subroutine eval_snapshot_upper_panel_fourier_e(self, mesh, position, electric_field, available)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: position(3)
    real(kind=dp), intent(out) :: electric_field(3)
    logical, intent(out) :: available

procedure, public :: eval_upper_panel_fourier_phi => eval_snapshot_upper_panel_fourier_phi

  • interface

    private module subroutine eval_snapshot_upper_panel_fourier_phi(self, mesh, position, potential, available)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: position(3)
    real(kind=dp), intent(out) :: potential
    logical, intent(out) :: available

procedure, public :: eval_local_phi => eval_snapshot_local_phi

  • interface

    private module subroutine eval_snapshot_local_phi(self, mesh, sim, position, potential)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    class(particle_domain_config), intent(in) :: sim
    real(kind=dp), intent(in) :: position(3)
    real(kind=dp), intent(out) :: potential

procedure, public :: eval_local_phi_without_primary_self => eval_snapshot_local_phi_without_primary_self

  • interface

    private module subroutine eval_snapshot_local_phi_without_primary_self(self, mesh, sim, element, potential)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    type(sim_config), intent(in) :: sim
    integer(kind=i32), intent(in) :: element
    real(kind=dp), intent(out) :: potential

procedure, public :: compute_mesh_potential => compute_snapshot_mesh_potential

  • interface

    private module subroutine compute_snapshot_mesh_potential(self, mesh, sim, potential)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    type(sim_config), intent(in) :: sim
    real(kind=dp), intent(out) :: potential(:)

procedure, public :: measure_kneq0_potential_step => measure_snapshot_kneq0_potential_step

  • interface

    private module subroutine measure_snapshot_kneq0_potential_step(self, mesh, candidate_charge, max_abs_delta_phi_v, delta_phi_v)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: candidate_charge(:)
    real(kind=dp), intent(out) :: max_abs_delta_phi_v
    real(kind=dp), intent(out), optional :: delta_phi_v(:)

procedure, public :: get_diagnostics => get_snapshot_diagnostics

procedure, public :: set_matching_plane_gauge => set_snapshot_matching_plane_gauge

  • private subroutine set_snapshot_matching_plane_gauge(self, mesh, z_high, phi_high)

    周期k=0成分の電位ゲージをmatching planeへ移す。 非ゼロモードのsolver/cacheは変更しない。次回refreshでもこのゲージを保持する。

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: z_high
    real(kind=dp), intent(in) :: phi_high

procedure, public :: set_matching_plane_top_field => set_snapshot_matching_plane_top_field

  • private subroutine set_snapshot_matching_plane_top_field(self, mesh, field_v_m)

    Set E_z(H+) from the outer root. The selected zero-mode boundary model consumes it on refresh.

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: field_v_m

procedure, public :: measure_switch_mismatch => measure_snapshot_switch_mismatch

  • interface

    private module subroutine measure_snapshot_switch_mismatch(self, mesh, sim, phi_rms, ez_rms)

    Arguments

    Type IntentOptional Attributes Name
    class(electrostatic_snapshot_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    type(sim_config), intent(in) :: sim
    real(kind=dp), intent(out) :: phi_rms
    real(kind=dp), intent(out) :: ez_rms

Source Code

  type, public :: electrostatic_snapshot_type
    type(field_solver_type) :: nonzero_solver
    real(dp) :: prescribed_e(3) = [0.0_dp, 0.0_dp, 0.0_dp]
    real(dp) :: prescribed_phi_origin(3) = [0.0_dp, 0.0_dp, 0.0_dp]
    logical :: use_zero_mode = .false.
    logical :: use_panel_spectral_reference = .false.
    logical :: use_cached_kneq0 = .false.
    logical :: use_upper_panel_fourier_retry = .false.
    real(dp) :: periodic_length(2) = [0.0_dp, 0.0_dp]
    real(dp) :: periodic_origin(2) = [0.0_dp, 0.0_dp]
    integer(i32) :: reference_mode_layers = 0_i32
    integer(i32) :: panel_quadrature_order = 0_i32
    type(periodic_zero_mode_plan_type) :: zero_plan
    type(periodic_zero_mode_state_type) :: zero_state
    type(periodic_nonzero_upper_vacuum_plan_type) :: upper_fourier_plan
    type(periodic2_physics_config) :: periodic_options
    !> periodic_options%lower_boundary_model を init で解決した値。zero mode の更新ごとに文字列を比べない。
    integer(i32) :: lower_boundary_id = lower_boundary_unknown
    type(electrostatic_diagnostics_type) :: diagnostics
    real(dp) :: gauss_residual = 0.0_dp
    logical :: matching_plane_gauge_active = .false.
    real(dp) :: matching_plane_z = 0.0_dp
    real(dp) :: matching_plane_phi = 0.0_dp
    real(dp) :: matching_plane_top_field = 0.0_dp
  contains
    procedure :: init => init_electrostatic_snapshot
    procedure :: refresh => refresh_electrostatic_snapshot
    procedure :: refresh_zero_mode => refresh_snapshot_zero_mode
    procedure :: eval_local_e => eval_snapshot_local_e
    procedure :: eval_upper_panel_fourier_e => eval_snapshot_upper_panel_fourier_e
    procedure :: eval_upper_panel_fourier_phi => eval_snapshot_upper_panel_fourier_phi
    procedure :: eval_local_phi => eval_snapshot_local_phi
    procedure :: eval_local_phi_without_primary_self => eval_snapshot_local_phi_without_primary_self
    procedure :: compute_mesh_potential => compute_snapshot_mesh_potential
    procedure :: measure_kneq0_potential_step => measure_snapshot_kneq0_potential_step
    procedure :: get_diagnostics => get_snapshot_diagnostics
    procedure :: set_matching_plane_gauge => set_snapshot_matching_plane_gauge
    procedure :: set_matching_plane_top_field => set_snapshot_matching_plane_top_field
    procedure :: measure_switch_mismatch => measure_snapshot_switch_mismatch
  end type electrostatic_snapshot_type