Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Added fix for condition when the narrow phase returns no true encounters
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Oct 25, 2021
1 parent 862357f commit 7f95561
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/encounter/encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ subroutine encounter_check_reduce_broadphase(n, nenc, index1, index2, lencounter
logical, dimension(:), allocatable :: ltmp

nenc = count(lencounter(:)) ! Count the true number of encounters
if (nenc == 0) then
if (allocated(index1)) deallocate(index1)
if (allocated(index2)) deallocate(index2)
if (allocated(lvdotr)) deallocate(lvdotr)
return
end if

allocate(itmp(nenc))
itmp(:) = pack(index1(:), lencounter(:))
Expand Down

0 comments on commit 7f95561

Please sign in to comment.