include/pops/amr/tagging/cluster.hpp Source FileΒΆ
|
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
|
cluster.hpp
Go to the documentation of this file.
Box2D: the integer index space of a 2D cell-centered Cartesian grid.
BoxArray: the set of boxes tiling a level (disjoint, covering).
static BoxArray from_domain(const Box2D &domain, int max_grid_size)
Tile the domain into tiles of at most max_grid_size per direction, distributed evenly.
Definition box_array.hpp:30
void cluster_rec(const TagBox &tb, Box2D region, const ClusterParams &p, std::vector< Box2D > &out)
Berger-Rigoutsos recursive core: trim, accept if efficient/not splittable, otherwise cut and recurse.
Definition cluster.hpp:115
Box2D tag_bbox(const TagBox &tb, const Box2D ®ion)
Bounding box of the tagged cells in region; empty box (hi < lo) if none is tagged.
Definition cluster.hpp:40
int best_inflection(const std::vector< long > &s, int mb, long &score)
Inflection: index of the max |D[k] - D[k-1]| with D the discrete Laplacian of the signature,...
Definition cluster.hpp:92
int best_hole(const std::vector< long > &s, int mb)
Interior hole (zero signature) closest to the center, in [mb, len-mb]; -1 if none.
Definition cluster.hpp:76
long count_in(const TagBox &tb, const Box2D &r)
Number of tagged cells in box r.
Definition cluster.hpp:56
std::vector< long > signature(const TagBox &tb, const Box2D &r, int axis)
Signature of r along axis: number of tagged cells per column (axis 0) or per row (axis 1).
Definition cluster.hpp:65
Definition amr_hierarchy.hpp:29
std::vector< Box2D > berger_rigoutsos(const TagBox &tags, const ClusterParams &p={})
Cluster a TagBox into boxes covering the tagged cells (Berger-Rigoutsos), then final chop.
Definition cluster.hpp:185
bool empty() const
true if the box contains no cell (hi < lo in one direction).
Definition box2d.hpp:58
POPS_HD int nx() const
Width (direction 0). POPS_HD (called from Geometry::dx() in a device kernel).
Definition box2d.hpp:50
POPS_HD int ny() const
Height (direction 1). POPS_HD (called from Geometry::dy() in a device kernel).
Definition box2d.hpp:52
std::int64_t num_cells() const
Total number of cells (nx*ny, floored at 0 per direction): 0 if the box is empty.
Definition box2d.hpp:54
Berger-Rigoutsos clustering parameters (configuration object).
Definition cluster.hpp:31
double min_efficiency
efficiency threshold (tagged fraction) to accept a box.
Definition cluster.hpp:32
int max_box_size
max size of a box; accepted boxes are chopped to this size.
Definition cluster.hpp:34
int min_box_size
minimal size of a box; bounds the admissible cuts.
Definition cluster.hpp:33
Dense grid of 0/1 markers over a box, input to Berger-Rigoutsos clustering.
Definition tag_box.hpp:35
TagBox: dense grid of markers (0/1) over a region, input to Berger-Rigoutsos clustering.
Generated by