field_solver_type Derived Type

type, public :: field_solver_type


Inherits

type~~field_solver_type~~InheritsGraph type~field_solver_type field_solver_type 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~fmm_plan_type->type~fmm_options_type options type~periodic2_ewald_data_type periodic2_ewald_data_type type~fmm_plan_type->type~periodic2_ewald_data_type periodic_ewald

Components

Type Visibility Attributes Name Initial
character(len=16), public :: mode = 'direct'
character(len=16), public :: field_bc_mode = 'free'
real(kind=dp), public :: softening = 1.0d-6
real(kind=dp), public :: theta = 0.5d0
integer(kind=i32), public :: leaf_max = 16_i32
integer(kind=i32), public :: min_nelem = 256_i32
logical, public :: use_periodic2 = .false.
integer(kind=i32), public :: periodic_axes(2) = 0_i32
real(kind=dp), public :: periodic_len(2) = 0.0d0
integer(kind=i32), public :: periodic_image_layers = 1_i32
character(len=16), public :: periodic_far_correction = 'auto'
real(kind=dp), public :: periodic_ewald_alpha = 0.0d0
integer(kind=i32), public :: periodic_ewald_layers = 4_i32
real(kind=dp), public :: target_box_min(3) = 0.0d0
real(kind=dp), public :: target_box_max(3) = 0.0d0
logical, public :: tree_ready = .false.
integer(kind=i32), public :: nelem = 0_i32
integer(kind=i32), public :: max_node = 0_i32
integer(kind=i32), public :: nnode = 0_i32
integer(kind=i32), public, allocatable :: elem_order(:)
integer(kind=i32), public, allocatable :: node_start(:)
integer(kind=i32), public, allocatable :: node_count(:)
integer(kind=i32), public, allocatable :: child_count(:)
integer(kind=i32), public, allocatable :: child_idx(:,:)
integer(kind=i32), public, allocatable :: child_octant(:,:)
integer(kind=i32), public, allocatable :: node_depth(:)
integer(kind=i32), public :: node_max_depth = 0_i32
integer(kind=i32), public, allocatable :: node_level_start(:)
integer(kind=i32), public, allocatable :: node_level_nodes(:)
real(kind=dp), public, allocatable :: node_center(:,:)
real(kind=dp), public, allocatable :: node_half_size(:,:)
real(kind=dp), public, allocatable :: node_radius(:)
real(kind=dp), public, allocatable :: node_q(:)
real(kind=dp), public, allocatable :: node_abs_q(:)
real(kind=dp), public, allocatable :: node_qx(:)
real(kind=dp), public, allocatable :: node_qy(:)
real(kind=dp), public, allocatable :: node_qz(:)
real(kind=dp), public, allocatable :: node_charge_center(:,:)
logical, public :: fmm_ready = .false.
integer(kind=i32), public :: nleaf = 0_i32
integer(kind=i32), public, allocatable :: leaf_nodes(:)
integer(kind=i32), public, allocatable :: leaf_slot_of_node(:)
logical, public :: target_tree_ready = .false.
integer(kind=i32), public :: target_max_node = 0_i32
integer(kind=i32), public :: target_nnode = 0_i32
integer(kind=i32), public, allocatable :: target_child_count(:)
integer(kind=i32), public, allocatable :: target_child_idx(:,:)
integer(kind=i32), public, allocatable :: target_child_octant(:,:)
integer(kind=i32), public, allocatable :: target_node_depth(:)
integer(kind=i32), public :: target_node_max_depth = 0_i32
integer(kind=i32), public, allocatable :: target_level_start(:)
integer(kind=i32), public, allocatable :: target_level_nodes(:)
real(kind=dp), public, allocatable :: target_node_center(:,:)
real(kind=dp), public, allocatable :: target_node_half_size(:,:)
real(kind=dp), public, allocatable :: target_node_radius(:)
integer(kind=i32), public, allocatable :: near_start(:)
integer(kind=i32), public, allocatable :: near_nodes(:)
integer(kind=i32), public, allocatable :: far_start(:)
integer(kind=i32), public, allocatable :: far_nodes(:)
integer(kind=i32), public, allocatable :: fmm_m2l_target_nodes(:)
integer(kind=i32), public, allocatable :: fmm_m2l_source_nodes(:)
integer(kind=i32), public, allocatable :: fmm_m2l_target_start(:)
integer(kind=i32), public, allocatable :: fmm_m2l_pair_order(:)
integer(kind=i32), public, allocatable :: fmm_parent_of(:)
real(kind=dp), public, allocatable :: fmm_node_local_e0(:,:)
real(kind=dp), public, allocatable :: fmm_node_local_jac(:,:,:)
real(kind=dp), public, allocatable :: fmm_node_local_hess(:,:,:,:)
real(kind=dp), public, allocatable :: fmm_shift_axis1(:)
real(kind=dp), public, allocatable :: fmm_shift_axis2(:)
real(kind=dp), public, allocatable :: leaf_far_e0(:,:)
real(kind=dp), public, allocatable :: leaf_far_jac(:,:,:)
real(kind=dp), public, allocatable :: leaf_far_hess(:,:,:,:)
logical, public :: fmm_use_core = .false.
logical, public :: fmm_core_ready = .false.
type(fmm_options_type), public :: fmm_core_options = fmm_options_type()
type(fmm_plan_type), public :: fmm_core_plan = fmm_plan_type()
type(fmm_state_type), public :: fmm_core_state = fmm_state_type()

Type-Bound Procedures

procedure, public :: init => init_field_solver

  • interface

    private module subroutine init_field_solver(self, mesh, sim)

    設定とメッシュから電場ソルバを初期化する。

    Arguments

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

procedure, public :: refresh => refresh_field_solver

  • interface

    private module subroutine refresh_field_solver(self, mesh)

    現在の要素電荷から treecode/FMM モーメントを再計算する。

    Arguments

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

procedure, public :: eval_e => eval_e_field_solver

  • interface

    private module subroutine eval_e_field_solver(self, mesh, r, e)

    観測点 r の電場を設定されたソルバで評価する。

    Arguments

    Type IntentOptional Attributes Name
    class(field_solver_type), intent(inout) :: self
    type(mesh_type), intent(in) :: mesh
    real(kind=dp), intent(in) :: r(3)
    real(kind=dp), intent(out) :: e(3)

procedure, public :: compute_mesh_potential => compute_mesh_potential_field_solver

  • interface

    private module subroutine compute_mesh_potential_field_solver(self, mesh, sim, potential_v)

    メッシュ重心での電位を計算する(FMM/direct 自動切替)。

    Arguments

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

Source Code

  type :: field_solver_type
    character(len=16) :: mode = 'direct'
    character(len=16) :: field_bc_mode = 'free'
    real(dp) :: softening = 1.0d-6
    real(dp) :: theta = 0.5d0
    integer(i32) :: leaf_max = 16_i32
    integer(i32) :: min_nelem = 256_i32
    logical :: use_periodic2 = .false.
    integer(i32) :: periodic_axes(2) = 0_i32
    real(dp) :: periodic_len(2) = 0.0d0
    integer(i32) :: periodic_image_layers = 1_i32
    character(len=16) :: periodic_far_correction = 'auto'
    real(dp) :: periodic_ewald_alpha = 0.0d0
    integer(i32) :: periodic_ewald_layers = 4_i32
    real(dp) :: target_box_min(3) = 0.0d0
    real(dp) :: target_box_max(3) = 0.0d0
    logical :: tree_ready = .false.
    integer(i32) :: nelem = 0_i32
    integer(i32) :: max_node = 0_i32
    integer(i32) :: nnode = 0_i32
    integer(i32), allocatable :: elem_order(:)
    integer(i32), allocatable :: node_start(:), node_count(:)
    integer(i32), allocatable :: child_count(:), child_idx(:, :), child_octant(:, :)
    integer(i32), allocatable :: node_depth(:)
    integer(i32) :: node_max_depth = 0_i32
    integer(i32), allocatable :: node_level_start(:), node_level_nodes(:)
    real(dp), allocatable :: node_center(:, :)
    real(dp), allocatable :: node_half_size(:, :)
    real(dp), allocatable :: node_radius(:)
    real(dp), allocatable :: node_q(:), node_abs_q(:)
    real(dp), allocatable :: node_qx(:), node_qy(:), node_qz(:)
    real(dp), allocatable :: node_charge_center(:, :)
    logical :: fmm_ready = .false.
    integer(i32) :: nleaf = 0_i32
    integer(i32), allocatable :: leaf_nodes(:)
    integer(i32), allocatable :: leaf_slot_of_node(:)
    logical :: target_tree_ready = .false.
    integer(i32) :: target_max_node = 0_i32
    integer(i32) :: target_nnode = 0_i32
    integer(i32), allocatable :: target_child_count(:), target_child_idx(:, :), target_child_octant(:, :)
    integer(i32), allocatable :: target_node_depth(:)
    integer(i32) :: target_node_max_depth = 0_i32
    integer(i32), allocatable :: target_level_start(:), target_level_nodes(:)
    real(dp), allocatable :: target_node_center(:, :)
    real(dp), allocatable :: target_node_half_size(:, :)
    real(dp), allocatable :: target_node_radius(:)
    integer(i32), allocatable :: near_start(:), near_nodes(:)
    integer(i32), allocatable :: far_start(:), far_nodes(:)
    integer(i32), allocatable :: fmm_m2l_target_nodes(:), fmm_m2l_source_nodes(:)
    integer(i32), allocatable :: fmm_m2l_target_start(:), fmm_m2l_pair_order(:)
    integer(i32), allocatable :: fmm_parent_of(:)
    real(dp), allocatable :: fmm_node_local_e0(:, :)
    real(dp), allocatable :: fmm_node_local_jac(:, :, :)
    real(dp), allocatable :: fmm_node_local_hess(:, :, :, :)
    real(dp), allocatable :: fmm_shift_axis1(:), fmm_shift_axis2(:)
    real(dp), allocatable :: leaf_far_e0(:, :)
    real(dp), allocatable :: leaf_far_jac(:, :, :)
    real(dp), allocatable :: leaf_far_hess(:, :, :, :)
    logical :: fmm_use_core = .false.
    logical :: fmm_core_ready = .false.
    type(fmm_options_type) :: fmm_core_options = fmm_options_type()
    type(fmm_plan_type) :: fmm_core_plan = fmm_plan_type()
    type(fmm_state_type) :: fmm_core_state = fmm_state_type()
  contains
    procedure :: init => init_field_solver
    procedure :: refresh => refresh_field_solver
    procedure :: eval_e => eval_e_field_solver
    procedure :: compute_mesh_potential => compute_mesh_potential_field_solver
  end type field_solver_type