point_inside_box_periodic2 Function

public pure function point_inside_box_periodic2(p, box_min, box_max, tol, periodic_axes, require_half_open)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: p(3)
real(kind=dp), intent(in) :: box_min(3)
real(kind=dp), intent(in) :: box_max(3)
real(kind=dp), intent(in) :: tol
integer(kind=i32), intent(in) :: periodic_axes(2)
logical, intent(in) :: require_half_open

Return Value logical


Called by

proc~~point_inside_box_periodic2~~CalledByGraph proc~point_inside_box_periodic2 point_inside_box_periodic2 proc~find_first_hit_periodic2 find_first_hit_periodic2 proc~find_first_hit_periodic2->proc~point_inside_box_periodic2 proc~find_first_hit find_first_hit proc~find_first_hit->proc~find_first_hit_periodic2 proc~sample_photo_raycast_particles sample_photo_raycast_particles proc~sample_photo_raycast_particles->proc~find_first_hit proc~sample_photo_species_state sample_photo_species_state proc~sample_photo_species_state->proc~sample_photo_raycast_particles proc~init_particle_batch_from_config init_particle_batch_from_config proc~init_particle_batch_from_config->proc~sample_photo_species_state

Source Code

  pure logical function point_inside_box_periodic2(p, box_min, box_max, tol, periodic_axes, require_half_open)
    real(dp), intent(in) :: p(3), box_min(3), box_max(3), tol
    integer(i32), intent(in) :: periodic_axes(2)
    logical, intent(in) :: require_half_open
    integer(i32) :: axis
    logical :: is_periodic

    point_inside_box_periodic2 = .true.
    do axis = 1_i32, 3_i32
      is_periodic = any(periodic_axes == axis)
      if (require_half_open .and. is_periodic) then
        if (p(axis) < box_min(axis) - tol .or. p(axis) >= box_max(axis) + tol) then
          point_inside_box_periodic2 = .false.
          return
        end if
      else
        if (p(axis) < box_min(axis) - tol .or. p(axis) > box_max(axis) + tol) then
          point_inside_box_periodic2 = .false.
          return
        end if
      end if
    end do
  end function point_inside_box_periodic2