Updates neighbor lists in preparation for collisions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(collision_obj), | intent(inout) | :: | this |
Collision utility |
impure subroutine collision_obj_UpdateNeighborList(this) !> Updates neighbor lists in preparation for collisions. implicit none class(collision_obj), intent(inout) :: this !! Collision utility ! Work variables integer :: coor(3) integer :: n integer :: count ! Resolved Particles if (associated(this%RP)) then if (.not.allocated(this%RPobjincell) & .or. (.not.allocated(this%RPneighbors))) then call this%parallel%Stop("Using collisions utility without proper initialization") end if this%RPobjincell = 0 do n=1,this%RP%count_ ! Get coordinate on collision block coor = this%cblock%GetOwningCellWGC(this%RP%p(n)%p) ! Increment counter count = this%RPobjincell(coor(1),coor(2),coor(3)) + 1 this%RPobjincell(coor(1),coor(2),coor(3)) = count ! Add to neighbor list call this%RPneighbors(coor(1),coor(2),coor(3))%put(key=count,val=n) end do end if ! Point Particles if (associated(this%PP)) then if (.not.allocated(this%PPobjincell) & .or. (.not.allocated(this%PPneighbors))) then call this%parallel%Stop("Using collisions utility without proper initialization") end if this%PPobjincell = 0 do n=1,this%PP%count_ ! Get coordinate on collision block coor = this%cblock%GetOwningCellWGC(this%PP%p(n)%p) ! Increment counter count = this%PPobjincell(coor(1),coor(2),coor(3)) + 1 this%PPobjincell(coor(1),coor(2),coor(3)) = count ! Add to neighbor list call this%PPneighbors(coor(1),coor(2),coor(3))%put(key=count,val=n) end do end if ! Immersed Boundary Points if (associated(this%IB)) then if (.not.allocated(this%IBobjincell) & .or. (.not.allocated(this%IBneighbors))) then call this%parallel%Stop("Using collisions utility without proper initialization") end if this%IBobjincell = 0 do n=1,this%IB%count_ ! Get coordinate on collision block coor = this%cblock%GetOwningCellWGC(this%IB%p(n)%p) ! Increment counter count = this%IBobjincell(coor(1),coor(2),coor(3)) + 1 this%IBobjincell(coor(1),coor(2),coor(3)) = count ! Add to neighbor list call this%IBneighbors(coor(1),coor(2),coor(3))%put(key=count,val=n) end do end if return end subroutine collision_obj_UpdateNeighborList