BoxHash Class ReferenceΒΆ

adc_cpp: pops::BoxHash Class Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
pops::BoxHash Class Reference

Spatial index of a BoxArray's boxes via a bin grid. More...

#include <box_hash.hpp>

+ Collaboration diagram for pops::BoxHash:

Public Member Functions

 BoxHash (const BoxArray &ba, int bin)
 Builds the index: bin = side of a bin (cells); bin <= 0 forces bin = 1.
 
std::vector< int > query (const Box2D &q) const
 Indices (SORTED, without duplicates) of the boxes that may intersect q: guaranteed SUPERSET (no intersecting box is omitted).
 

Detailed Description

Spatial index of a BoxArray's boxes via a bin grid.

References the BoxArray by INDEX (the indices returned by query() are global indices into the original BoxArray); valid as long as that BoxArray does not change.

Constructor & Destructor Documentation

◆ BoxHash()

pops::BoxHash::BoxHash ( const BoxArray ba,
int  bin 
)
inline

Builds the index: bin = side of a bin (cells); bin <= 0 forces bin = 1.

Each box is inserted into all the bins it covers. Cost proportional to the total area in bins.

+ Here is the call graph for this function:

Member Function Documentation

◆ query()

std::vector< int > pops::BoxHash::query ( const Box2D q) const
inline

Indices (SORTED, without duplicates) of the boxes that may intersect q: guaranteed SUPERSET (no intersecting box is omitted).

The caller tests the exact intersection. Empty if q is empty.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: