From 0aec1dc65a952dbf4b0bd0d801552712a43247f1 Mon Sep 17 00:00:00 2001 From: MartinKarp Date: Thu, 10 Oct 2024 19:59:17 +0200 Subject: [PATCH 1/2] add aabb option and fix sort bug --- src/mesh/aabb_tree.f90 | 6 ++++-- src/mesh/search_tree/aabb.f90 | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesh/aabb_tree.f90 b/src/mesh/aabb_tree.f90 index 83cd2e7e5dca..87b506d07584 100644 --- a/src/mesh/aabb_tree.f90 +++ b/src/mesh/aabb_tree.f90 @@ -439,8 +439,9 @@ function sort(array) result(indices) minidx = -1 do imin = 1, size(array) if (.not. visited(imin) .and. minidx .eq. -1) minidx = imin - - if (visited(imin) .and. array(imin) .lt. array(minidx)) minidx = imin + if (minidx .gt. -1) then + if (visited(imin) .and. array(imin) .lt. array(minidx)) minidx = imin + end if end do indices(i) = minidx @@ -641,6 +642,7 @@ subroutine aabb_tree_query_overlaps(this, object, object_index, overlaps) end if end if end do + call simple_stack%free() end subroutine aabb_tree_query_overlaps ! -------------------------------------------------------------------------- ! diff --git a/src/mesh/search_tree/aabb.f90 b/src/mesh/search_tree/aabb.f90 index 854c1c555dcd..2641d665aeaa 100644 --- a/src/mesh/search_tree/aabb.f90 +++ b/src/mesh/search_tree/aabb.f90 @@ -187,6 +187,8 @@ function get_aabb(object, padding) result(box) select type(object) + type is (aabb_t) + box%init(object%get_min(), object%get_max()) type is (tri_t) box = get_aabb_element(object) type is (hex_t) From 22ef1470cf9466f55addf975313f14f07b4f94ac Mon Sep 17 00:00:00 2001 From: MartinKarp Date: Thu, 10 Oct 2024 20:06:51 +0200 Subject: [PATCH 2/2] add call --- src/mesh/search_tree/aabb.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/search_tree/aabb.f90 b/src/mesh/search_tree/aabb.f90 index 2641d665aeaa..0b326621a4d1 100644 --- a/src/mesh/search_tree/aabb.f90 +++ b/src/mesh/search_tree/aabb.f90 @@ -188,7 +188,7 @@ function get_aabb(object, padding) result(box) select type(object) type is (aabb_t) - box%init(object%get_min(), object%get_max()) + call box%init(object%get_min(), object%get_max()) type is (tri_t) box = get_aabb_element(object) type is (hex_t)