resolve_face_geometry Subroutine

public subroutine resolve_face_geometry(box_min, box_max, inject_face, axis_n, boundary_value, inward_normal)

注入面名から法線方向の幾何情報を返す。

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: box_min(3)
real(kind=dp), intent(in) :: box_max(3)
character(len=*), intent(in) :: inject_face

注入面識別子(x_low/x_high/y_low/y_high/z_low/z_high)。

integer, intent(out), optional :: axis_n

法線方向軸インデックス(省略可)。

real(kind=dp), intent(out), optional :: boundary_value

注入面の境界座標値 [m](省略可)。

real(kind=dp), intent(out), optional :: inward_normal(3)

Called by

proc~~resolve_face_geometry~~CalledByGraph proc~resolve_face_geometry resolve_face_geometry proc~compute_macro_particles_for_batch compute_macro_particles_for_batch proc~compute_macro_particles_for_batch->proc~resolve_face_geometry proc~sample_photo_raycast_particles sample_photo_raycast_particles proc~sample_photo_raycast_particles->proc~resolve_face_geometry proc~sample_reservoir_face_particles sample_reservoir_face_particles proc~sample_reservoir_face_particles->proc~resolve_face_geometry proc~sample_reservoir_velocity_grid_particles sample_reservoir_velocity_grid_particles proc~sample_reservoir_velocity_grid_particles->proc~resolve_face_geometry proc~compute_macro_particles_for_species compute_macro_particles_for_species proc~compute_macro_particles_for_species->proc~compute_macro_particles_for_batch

Source Code

  subroutine resolve_face_geometry(box_min, box_max, inject_face, axis_n, boundary_value, inward_normal)
    real(dp), intent(in) :: box_min(3), box_max(3)
    character(len=*), intent(in) :: inject_face
    integer, intent(out), optional :: axis_n
    real(dp), intent(out), optional :: boundary_value
    real(dp), intent(out), optional :: inward_normal(3)

    integer :: axis_local
    real(dp) :: boundary_local, normal_local(3)

    normal_local = 0.0_dp
    select case (trim(adjustl(inject_face)))
    case ('x_low')
      axis_local = 1
      boundary_local = box_min(1)
      normal_local(1) = 1.0_dp
    case ('x_high')
      axis_local = 1
      boundary_local = box_max(1)
      normal_local(1) = -1.0_dp
    case ('y_low')
      axis_local = 2
      boundary_local = box_min(2)
      normal_local(2) = 1.0_dp
    case ('y_high')
      axis_local = 2
      boundary_local = box_max(2)
      normal_local(2) = -1.0_dp
    case ('z_low')
      axis_local = 3
      boundary_local = box_min(3)
      normal_local(3) = 1.0_dp
    case ('z_high')
      axis_local = 3
      boundary_local = box_max(3)
      normal_local(3) = -1.0_dp
    case default
      error stop "unknown inject_face"
    end select

    if (present(axis_n)) axis_n = axis_local
    if (present(boundary_value)) boundary_value = boundary_local
    if (present(inward_normal)) inward_normal = normal_local
  end subroutine resolve_face_geometry