panel_on_surface_integrals Subroutine

public subroutine panel_on_surface_integrals(geometry, target, potential_integral, field_pv_integral)

Arguments

Type IntentOptional Attributes Name
type(panel_geometry_type), intent(in) :: geometry
real(kind=dp), intent(in) :: target(3)
real(kind=dp), intent(out) :: potential_integral
real(kind=dp), intent(out) :: field_pv_integral(3)

Called by

proc~~panel_on_surface_integrals~~CalledByGraph proc~panel_on_surface_integrals panel_on_surface_integrals proc~panel_potential_field panel_potential_field proc~panel_potential_field->proc~panel_on_surface_integrals proc~core_eval_direct_points_impl core_eval_direct_points_impl proc~core_eval_direct_points_impl->proc~panel_potential_field proc~core_eval_direct_potential_points_impl core_eval_direct_potential_points_impl proc~core_eval_direct_potential_points_impl->proc~panel_potential_field proc~core_eval_point_impl core_eval_point_impl proc~core_eval_point_impl->proc~panel_potential_field proc~core_eval_points_impl core_eval_points_impl proc~core_eval_points_impl->proc~panel_potential_field proc~core_eval_potential_point_impl core_eval_potential_point_impl proc~core_eval_potential_point_impl->proc~panel_potential_field proc~core_eval_potential_points_impl core_eval_potential_points_impl proc~core_eval_potential_points_impl->proc~panel_potential_field

Source Code

  subroutine panel_on_surface_integrals(geometry, target, potential_integral, field_pv_integral)
    type(panel_geometry_type), intent(in) :: geometry
    real(dp), intent(in) :: target(3)
    real(dp), intent(out) :: potential_integral, field_pv_integral(3)
    real(dp) :: endpoint(3), radius_a, radius_b, ratio, line_integral, distance
    integer :: edge, next_edge

    potential_integral = 0.0_dp
    field_pv_integral = 0.0_dp
    do edge = 1, 3
      next_edge = merge(edge + 1, 1, edge < 3)
      endpoint = geometry%vertex(:, edge)
      radius_a = norm2(target - endpoint)
      radius_b = norm2(target - geometry%vertex(:, next_edge))
      ratio = geometry%edge_length(edge)/(radius_a + radius_b)
      if (ratio >= 1.0_dp) error stop 'panel on-surface target lies on an edge or vertex.'
      line_integral = log((1.0_dp + ratio)/(1.0_dp - ratio))
      distance = dot_product(endpoint - target, geometry%edge_outward(:, edge))
      potential_integral = potential_integral + distance*line_integral
      field_pv_integral = field_pv_integral + geometry%edge_outward(:, edge)*line_integral
    end do
  end subroutine panel_on_surface_integrals