add_periodic2_exact_ewald_correction_all_sources Subroutine

public subroutine add_periodic2_exact_ewald_correction_all_sources(plan, state, target, e)

全ソース分の periodic2 Ewald 補正を加算する。

Arguments

Type IntentOptional Attributes Name
type(fmm_plan_type), intent(in) :: plan

FMM 計画。

type(fmm_state_type), intent(in) :: state

ソース電荷を含む state。

real(kind=dp), intent(in) :: target(3)
real(kind=dp), intent(inout) :: e(3)

Calls

proc~~add_periodic2_exact_ewald_correction_all_sources~~CallsGraph proc~add_periodic2_exact_ewald_correction_all_sources add_periodic2_exact_ewald_correction_all_sources proc~add_periodic2_exact_ewald_correction_single_source add_periodic2_exact_ewald_correction_single_source proc~add_periodic2_exact_ewald_correction_all_sources->proc~add_periodic2_exact_ewald_correction_single_source

Called by

proc~~add_periodic2_exact_ewald_correction_all_sources~~CalledByGraph proc~add_periodic2_exact_ewald_correction_all_sources add_periodic2_exact_ewald_correction_all_sources proc~core_eval_point_impl core_eval_point_impl proc~core_eval_point_impl->proc~add_periodic2_exact_ewald_correction_all_sources proc~core_eval_points_impl core_eval_points_impl proc~core_eval_points_impl->proc~add_periodic2_exact_ewald_correction_all_sources

Source Code

  subroutine add_periodic2_exact_ewald_correction_all_sources(plan, state, target, e)
    type(fmm_plan_type), intent(in) :: plan
    type(fmm_state_type), intent(in) :: state
    real(dp), intent(in) :: target(3)
    real(dp), intent(inout) :: e(3)
    integer(i32) :: idx
    real(dp) :: total_charge

    if (.not. plan%periodic_ewald%ready) return
    total_charge = 0.0d0
    do idx = 1_i32, plan%nsrc
      total_charge = total_charge + state%src_q(idx)
      call add_periodic2_exact_ewald_correction_single_source(plan, state%src_q(idx), plan%src_pos(:, idx), target, e)
    end do
    call add_exact_periodic2_charged_wall_total_charge_correction(plan, total_charge, target, e)
  end subroutine add_periodic2_exact_ewald_correction_all_sources