resolve_particle_boundaries Subroutine

public pure subroutine resolve_particle_boundaries(sim, global_low, global_high, spec, boundary_low, boundary_high)

domain topology、global既定、粒子種overrideから有効な粒子境界を解決する。

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim
integer(kind=i32), intent(in) :: global_low(3)
integer(kind=i32), intent(in) :: global_high(3)
type(particle_species_spec), intent(in) :: spec
integer(kind=i32), intent(out) :: boundary_low(3)
integer(kind=i32), intent(out) :: boundary_high(3)

Source Code

  pure subroutine resolve_particle_boundaries(sim, global_low, global_high, spec, boundary_low, boundary_high)
    type(sim_config), intent(in) :: sim
    integer(i32), intent(in) :: global_low(3), global_high(3)
    type(particle_species_spec), intent(in) :: spec
    integer(i32), intent(out) :: boundary_low(3), boundary_high(3)
    integer :: axis

    boundary_low = sim%bc_low
    boundary_high = sim%bc_high
    do axis = 1, 3
      if (boundary_low(axis) /= bc_periodic .and. global_low(axis) /= particle_bc_inherit) then
        boundary_low(axis) = global_low(axis)
      end if
      if (boundary_high(axis) /= bc_periodic .and. global_high(axis) /= particle_bc_inherit) then
        boundary_high(axis) = global_high(axis)
      end if
      if (boundary_low(axis) /= bc_periodic .and. spec%boundary_low(axis) /= particle_bc_inherit) then
        boundary_low(axis) = spec%boundary_low(axis)
      end if
      if (boundary_high(axis) /= bc_periodic .and. spec%boundary_high(axis) /= particle_bc_inherit) then
        boundary_high(axis) = spec%boundary_high(axis)
      end if
    end do
  end subroutine resolve_particle_boundaries