nodes_well_separated Function

public function nodes_well_separated(plan, target_node, source_node)

target/source ノードが十分離れているかを判定する。

Arguments

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

FMM 計画。

integer(kind=i32), intent(in) :: target_node

target ノード番号。

integer(kind=i32), intent(in) :: source_node

target ノード番号。 source ノード番号。

Return Value logical


Calls

proc~~nodes_well_separated~~CallsGraph proc~nodes_well_separated nodes_well_separated proc~active_tree_node_center active_tree_node_center proc~nodes_well_separated->proc~active_tree_node_center proc~active_tree_node_radius active_tree_node_radius proc~nodes_well_separated->proc~active_tree_node_radius proc~apply_periodic2_minimum_image apply_periodic2_minimum_image proc~nodes_well_separated->proc~apply_periodic2_minimum_image

Called by

proc~~nodes_well_separated~~CalledByGraph proc~nodes_well_separated nodes_well_separated proc~core_build_plan_impl core_build_plan_impl proc~core_build_plan_impl->proc~nodes_well_separated

Source Code

  logical function nodes_well_separated(plan, target_node, source_node)
    type(fmm_plan_type), intent(in) :: plan
    integer(i32), intent(in) :: target_node, source_node
    real(dp) :: d(3), dist2, rs, rt, theta_eff, lhs, rhs, target_center(3)
    logical :: use_target_tree

    use_target_tree = plan%target_tree_ready
    target_center = active_tree_node_center(plan, use_target_tree, target_node)
    rt = active_tree_node_radius(plan, use_target_tree, target_node)

    d = target_center - plan%node_center(:, source_node)
    call apply_periodic2_minimum_image(plan, d)
    dist2 = sum(d*d)
    if (dist2 <= 0.0d0) then
      nodes_well_separated = .false.
      return
    end if

    rs = plan%node_radius(source_node)
    theta_eff = plan%options%theta
    lhs = (rs + rt)*(rs + rt)
    rhs = (theta_eff*theta_eff)*dist2
    nodes_well_separated = (lhs < rhs)
  end function nodes_well_separated