validate_phase1_panel_config Subroutine

public subroutine validate_phase1_panel_config(sim, panel, status, message)

triangle P0 direct/treecode/FMM kernel の solver/boundary 契約を検証する。

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim
type(panel_kernel_config), intent(in) :: panel
integer(kind=i32), intent(out) :: status
character(len=*), intent(out) :: message

Calls

proc~~validate_phase1_panel_config~~CallsGraph proc~validate_phase1_panel_config validate_phase1_panel_config proc~lower_ascii lower_ascii proc~validate_phase1_panel_config->proc~lower_ascii

Called by

proc~~validate_phase1_panel_config~~CalledByGraph proc~validate_phase1_panel_config validate_phase1_panel_config proc~validate_active_physics_config validate_active_physics_config proc~validate_active_physics_config->proc~validate_phase1_panel_config

Source Code

  subroutine validate_phase1_panel_config(sim, panel, status, message)
    type(sim_config), intent(in) :: sim
    type(panel_kernel_config), intent(in) :: panel
    integer(i32), intent(out) :: status
    character(len=*), intent(out) :: message
    character(len=32) :: kernel_id, solver, boundary

    status = physics_config_ok
    message = ''
    kernel_id = lower_ascii(trim(panel%kernel_id))
    solver = lower_ascii(trim(sim%field_solver))
    boundary = lower_ascii(trim(sim%field_bc_mode))
    select case (trim(solver))
    case ('direct')
      if (trim(kernel_id) /= 'triangle_p0_exact_direct' .or. trim(boundary) /= 'free') then
        call reject(physics_config_unavailable, 'triangle_p0 direct requires its exact free-space kernel.', status, message)
      end if
    case ('treecode')
      if (trim(kernel_id) /= 'triangle_p0_exact_tree_near' .or. trim(boundary) /= 'free') then
        call reject( &
          physics_config_invalid_combination, &
          'triangle_p0 treecode requires exact panel-near/monopole-far free-space kernel.', status, message &
          )
      end if
    case ('fmm')
      if (trim(kernel_id) /= 'triangle_p0_exact_p2m_near') then
        call reject( &
          physics_config_invalid_combination, &
          'triangle_p0 FMM requires exact P2M/panel-near kernel.', status, message &
          )
      else if (trim(boundary) /= 'free' .and. trim(boundary) /= 'periodic2') then
        call reject( &
          physics_config_invalid_combination, &
          'triangle_p0 FMM supports free or periodic2 boundaries.', status, message &
          )
      end if
    case ('auto')
      if (trim(kernel_id) /= 'triangle_p0_exact_auto' .or. trim(boundary) /= 'free') then
        call reject( &
          physics_config_invalid_combination, &
          'triangle_p0 auto requires its free-space auto kernel.', status, message &
          )
      end if
    case default
      call reject(physics_config_unavailable, 'triangle_p0 supports direct, treecode, FMM, or auto solving.', status, message)
    end select
  end subroutine validate_phase1_panel_config