peclet-dem
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
Loading...
Searching...
No Matches
broadphase_arborx.hpp File Reference

dem — portable (ArborX) broad-phase, the Kokkos-native replacement for the CUDA-only cuBQL broad-phase in broadphase.cu. More...

#include <ArborX.hpp>
#include <Kokkos_Core.hpp>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  peclet
 
namespace  peclet::dem
 

Macros

#define PECLET_DEM_SANE_BOX(i, px, py, pz, b)
 

Typedefs

using peclet::dem::BpExec = Kokkos::DefaultExecutionSpace
 
using peclet::dem::BpMem = BpExec::memory_space
 

Functions

template<class PosV , class RadV , class PairsV , class CountV >
int peclet::dem::findCollisionsArborX (PosV pos, RadV rad, int numParticles, int numReal, float margin, PairsV outPairs, CountV outCount, float boxCap=0.0f)
 Emit candidate collision pairs (i<j) for real particles into outPairs/outCount.
 

Detailed Description

dem — portable (ArborX) broad-phase, the Kokkos-native replacement for the CUDA-only cuBQL broad-phase in broadphase.cu.

Same semantics as find_collisions(): build axis-aligned bounding boxes (half-width radius+margin) over ALL particles, then for each REAL particle query the BVH for overlapping boxes and emit the candidate pairs (i,j) with i<j into a preallocated buffer guarded by an atomic counter. An AABB-overlap broad-phase, identical in criterion to cuBQL's fixedBoxQuery, so it yields the same candidate set. Decoupled from ParticleSystemData (plain Kokkos Views) so it builds and is tested standalone before being wired into the solver; runs on whatever backend Kokkos was built for.

Definition in file broadphase_arborx.hpp.

Macro Definition Documentation

◆ PECLET_DEM_SANE_BOX

#define PECLET_DEM_SANE_BOX (   i,
  px,
  py,
  pz,
 
)
Value:
float px = pos(i, 0), py = pos(i, 1), pz = pos(i, 2), b = rad(i) + margin; \
if (!(b == b) || !(px == px) || !(py == py) || !(pz == pz) || \
(boxCap > 0.0f && b > boxCap)) { \
px = py = pz = -1.0e30f; \
b = 0.0f; \
}