.. _program_listing_file_src_pcms_utility_bounding_box.h: Program Listing for File bounding_box.h ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/pcms/utility/bounding_box.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef PCMS_COUPLING_BOUNDING_BOX_H #define PCMS_COUPLING_BOUNDING_BOX_H #include "pcms/utility/types.h" #include #include namespace pcms { template struct AABBox { static constexpr int dim = DIM; Kokkos::Array center; // half length of bounding box Kokkos::Array half_width; }; template KOKKOS_INLINE_FUNCTION bool intersects(const AABBox& a, const AABBox& b) { for (int i = 0; i < dim; ++i) { if (std::abs(a.center[i] - b.center[i]) > (a.half_width[i] + b.half_width[i])) return false; } return true; } } // namespace pcms #endif // PCMS_COUPLING_BOUNDING_BOX_H