Skip to content

Commit

Permalink
Merge pull request #1278 from LLNL/feature/han12/BVH_silo_example
Browse files Browse the repository at this point in the history
Blueprint(Overlink) Candidates Example
  • Loading branch information
bmhan12 committed Mar 4, 2024
2 parents 60a3add + 7d488bf commit ba3cd10
Show file tree
Hide file tree
Showing 5 changed files with 923 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
- Adds `FlatMap`, a generic key-value store which aims for drop-in compatibility
with `std::unordered_map`, but utilizes an open-addressing design.
- Adds support for device-side use of `Array::push_back()` and `Array::emplace_back()`.
- Adds initial support for using Slic streams with tags
- Adds an example that finds intersection candidate pairs between two Silo
hexahedral meshes using either a BVH or Implicit Grid spatial index

### Changed
- `DistributedClosestPoint` outputs are now controlled by the `setOutput` method.
Expand Down
3 changes: 2 additions & 1 deletion src/axom/primal/operators/intersect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ bool intersect(const Segment<T, DIM>& S, const BoundingBox<T, DIM>& bb)
* \return true iff bb1 intersects with bb2, otherwise, false.
*/
template <typename T, int DIM>
bool intersect(const BoundingBox<T, DIM>& bb1, const BoundingBox<T, DIM>& bb2)
AXOM_HOST_DEVICE bool intersect(const BoundingBox<T, DIM>& bb1,
const BoundingBox<T, DIM>& bb2)
{
return bb1.intersectsWith(bb2);
}
Expand Down
50 changes: 50 additions & 0 deletions src/axom/quest/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,56 @@ if (RAJA_FOUND AND UMPIRE_FOUND)
)
endif()

# BVH silo example ------------------------------------------------------------
if (CONDUIT_FOUND AND RAJA_FOUND AND UMPIRE_FOUND)
axom_add_executable(
NAME quest_candidates_example_ex
SOURCES quest_candidates_example.cpp
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON ${quest_example_depends} conduit::conduit
FOLDER axom/quest/examples
)

# Add unit tests
if(AXOM_ENABLE_TESTS AND AXOM_DATA_DIR)

# Run the candidates example with the different spatial indices
# and raja policies

# Use same file for input and query
set(input_file "${AXOM_DATA_DIR}/quest/ucart10.cycle_000000.root")
set(query_file "${AXOM_DATA_DIR}/quest/ucart10_shifted.cycle_000000.root")

set(_methods "bvh" "implicit")

set (_policies "seq")
blt_list_append(TO _policies ELEMENTS "omp" IF AXOM_ENABLE_OPENMP)
blt_list_append(TO _policies ELEMENTS "cuda" IF AXOM_ENABLE_CUDA)
blt_list_append(TO _policies ELEMENTS "hip" IF AXOM_ENABLE_HIP)


foreach(_method ${_methods})
foreach(_policy ${_policies})

set(_testname "quest_candidates_example_${_method}_${_policy}")
axom_add_test(
NAME ${_testname}
COMMAND quest_candidates_example_ex
--infile ${input_file}
--queryfile ${query_file}
--method ${_method}
--policy ${_policy}
)

# Match either one comma or none for portability
set_tests_properties(${_testname} PROPERTIES
PASS_REGULAR_EXPRESSION "Mesh had 6[,]?859 candidates pairs")
endforeach()
endforeach()
endif()

endif()

# Shaping example -------------------------------------------------------------
if(AXOM_ENABLE_MPI AND MFEM_FOUND AND MFEM_USE_MPI
AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION
Expand Down

0 comments on commit ba3cd10

Please sign in to comment.