From 9453874491c36489203d5d816d7070fe286362f1 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 17 Aug 2023 07:36:23 -0500 Subject: [PATCH] Update approach to getting all volumes --- src/RTI.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/RTI.cpp b/src/RTI.cpp index f534ca8..043bbe2 100644 --- a/src/RTI.cpp +++ b/src/RTI.cpp @@ -701,9 +701,12 @@ RayTracingInterface::find_volume(const double xyz[3], moab::EntityHandle& volume, double* uvw) { int result = 0; - for (int i = 0; i < GTT->num_entities(3); i++) { - moab::EntityHandle vol = GTT->entity_by_index(3, i); - point_in_volume(vol, xyz, result, uvw); + moab::Range vols; + moab::ErrorCode rval = GTT->get_gsets_by_dimension(3, vols); + if (rval != moab::MB_SUCCESS) return rval; + for (auto vol : vols) { + rval = point_in_volume(vol, xyz, result, uvw); + if (rval != moab::MB_SUCCESS) return rval; if (result == 1) { volume = vol; break;