13#ifndef CD_KDPARTICLEMERGE_H
14#define CD_KDPARTICLEMERGE_H
31#include <CD_NamespaceHeader.H>
52template <
typename Packed>
54 Packed(
const Packed* a_payloads,
const Real* a_weights,
const std::size_t a_count)>;
134template <
typename Packed>
138 std::vector<KDLeaf>& a_leaves,
140 const Real a_splitWeightLeafDx,
141 const RealVect& a_dx,
142 const RealVect& a_probLo,
143 const FArrayBox& a_cellCounts)
noexcept;
214 EBAMRFAB& a_cellHistogram,
215 EBAMRFAB& a_leafQuota,
218 const Real a_splitWeightLeafDx,
219 const Gather& a_gather,
220 const Combine& a_combine,
221 const Scatter& a_scatter,
222 const Allocator& a_allocateID,
223 const PosValid& a_isPositionValid);
273 EBAMRFAB& a_cellHistogram,
274 EBAMRFAB& a_leafQuota,
277 const Real a_splitWeightLeafDx,
278 const Gather& a_gather,
279 const Combine& a_combine,
280 const Scatter& a_scatter,
281 const Allocator& a_allocateID,
282 const PosValid& a_isPositionValid);
341 EBAMRFAB& a_cellHistogram,
342 EBAMRFAB& a_leafQuota,
345 const Real a_splitWeightLeafDx,
346 const Gather& a_gather,
347 const Combine& a_combine,
348 const Scatter& a_scatter,
349 const Allocator& a_allocateID,
350 const PosValid& a_isPositionValid);
354#include <CD_NamespaceFooter.H>
Declaration of core class for handling AMR-related operations (with embedded boundaries)
Implementation of CD_KDParticleMerge.H.
Declaration of an AMR-hierarchy container that owns per-patch ParticleSoA leaves.
Namespace containing various particle management utilities.
Declaration of ParticleSoA, an arena-backed Struct-of-Arrays particle container.
Class for handling spatial operations.
Definition CD_AmrMesh.H:45
AMR-hierarchy container of computational particles, stored per patch in Struct-of-Arrays form.
Definition CD_ParticleContainer.H:123
std::vector< T > kdExchangeByRank(const std::vector< std::vector< T > > &a_sendByRank)
Generic Alltoallv-style exchange for a trivially-copyable record type: send a per-destination-rank bu...
Definition CD_KDParticleMergeImplem.H:42
void buildKDQuotaLeaves(std::vector< MergeParticle< Packed > > &a_particles, FArrayBox &a_used, std::vector< KDLeaf > &a_leaves, const int a_ppc, const Real a_splitWeightLeafDx, const RealVect &a_dx, const RealVect &a_probLo, const FArrayBox &a_cellCounts) noexcept
Build one whole-patch kd tree: partition a_particles by position into leaves, each of which becomes e...
Definition CD_KDParticleMergeImplem.H:368
Namespace for various particle management tools.
Definition CD_KDParticleMerge.H:33
std::function< Packed(const Packed *a_payloads, const Real *a_weights, const std::size_t a_count)> KDPayloadCombine
Illustrative signature of the N-ary combine callback: produce a merged particle's opaque payload from...
Definition CD_KDParticleMerge.H:54
void mergeKDInterior(ParticleContainer< P, Traits > &a_particles, ParticleContainer< P, Traits > &a_interior, EBAMRFAB &a_cellHistogram, EBAMRFAB &a_leafQuota, const AmrMesh &a_amr, const int a_ppc, const Real a_splitWeightLeafDx, const Gather &a_gather, const Combine &a_combine, const Scatter &a_scatter, const Allocator &a_allocateID, const PosValid &a_isPositionValid)
Run the uncontested tier of the kd merge, splitting the input into merged and leftover.
Definition CD_KDParticleMergeImplem.H:1606
void mergeKDPatch(ParticleContainer< P, Traits > &a_particles, EBAMRFAB &a_cellHistogram, EBAMRFAB &a_leafQuota, const AmrMesh &a_amr, const int a_ppc, const Real a_splitWeightLeafDx, const Gather &a_gather, const Combine &a_combine, const Scatter &a_scatter, const Allocator &a_allocateID, const PosValid &a_isPositionValid)
Run one patch-local kd-tree merge over every patch this rank owns.
Definition CD_KDParticleMergeImplem.H:1563
void mergeKDCarve(ParticleContainer< P, Traits > &a_particles, EBAMRFAB &a_cellHistogram, EBAMRFAB &a_leafQuota, const AmrMesh &a_amr, const int a_ppc, const Real a_splitWeightLeafDx, const Gather &a_gather, const Combine &a_combine, const Scatter &a_scatter, const Allocator &a_allocateID, const PosValid &a_isPositionValid)
Run one non-iterative pass of the kd-tree carve merge over every patch this rank owns.
Definition CD_KDParticleMergeImplem.H:651
Minimal, payload-agnostic description of one particle as input to a distributed merge.
Definition CD_ParticleManagement.H:430
One leaf of a kd tree: a contiguous index range into the (in-place reordered) particle buffer,...
Definition CD_KDParticleMerge.H:68
RealVect boxHi
High corner of this leaf's axis-aligned bounding box.
Definition CD_KDParticleMerge.H:87
std::size_t hi
End of this leaf's member range (exclusive) in the reordered particle buffer.
Definition CD_KDParticleMerge.H:77
RealVect boxLo
Low corner of this leaf's axis-aligned bounding box.
Definition CD_KDParticleMerge.H:82
std::size_t lo
Start of this leaf's member range (inclusive) in the reordered particle buffer.
Definition CD_KDParticleMerge.H:72
Traits class that a user specializes to describe the PAYLOAD columns of a particle type....
Definition CD_ParticleSoA.H:192