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

Commit

Permalink
Fixed index ordering in single list. test case with new sort & sweep …
Browse files Browse the repository at this point in the history
…now matches triangular
  • Loading branch information
daminton committed Nov 23, 2021
1 parent e93ffe7 commit a599b9f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/encounter/encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ module pure subroutine encounter_check_sort_aabb_1D(self, n, extent_arr)

call util_sort(extent_arr, self%ind)

do concurrent(k = 1_I8B:2_I8B*n)
do concurrent(k = 1_I8B:2_I8B * n)
i = self%ind(k)
if (i <= n) then
self%ibeg(i) = k
Expand Down Expand Up @@ -1072,7 +1072,7 @@ module subroutine encounter_check_sweep_aabb_single_list(self, n, x, v, renc, dt
logical, dimension(:), allocatable, intent(out) :: lvdotr !! Logical array indicating which pairs are approaching
! Internals
integer(I4B) :: ii, i
integer(I8B) :: k
integer(I8B) :: k, itmp
logical, dimension(n) :: loverlap
logical, dimension(n) :: lencounteri
integer(I4B), dimension(:), allocatable :: ext_ind_true
Expand Down Expand Up @@ -1129,6 +1129,13 @@ module subroutine encounter_check_sweep_aabb_single_list(self, n, x, v, renc, dt

call encounter_check_collapse_ragged_list(lenc, n, nenc, index1, index2, lvdotr)

! By convention, we always assume that index1 < index2, and so we must swap any that are out of order
do concurrent(k = 1_I8B:nenc, index1(k) > index2(k))
itmp = index1(k)
index1(k) = index2(k)
index2(k) = itmp
end do

call encounter_check_remove_duplicates(n, nenc, index1, index2, lvdotr)

return
Expand Down

0 comments on commit a599b9f

Please sign in to comment.