chombo-discharge
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
CD_KDParticleMerge.H File Reference

Declaration of distributed, MPI-safe whole-patch kd-tree super-particle merge algorithms. More...

#include <cstdint>
#include <functional>
#include <vector>
#include <Box.H>
#include <FArrayBox.H>
#include <RealVect.H>
#include <CD_ParticleSoA.H>
#include <CD_ParticleContainer.H>
#include <CD_ParticleManagement.H>
#include <CD_AmrMesh.H>
#include <CD_NamespaceHeader.H>
#include <CD_NamespaceFooter.H>
#include <CD_KDParticleMergeImplem.H>
Include dependency graph for CD_KDParticleMerge.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ParticleManagement::detail::KDLeaf
 One leaf of a kd tree: a contiguous index range into the (in-place reordered) particle buffer, plus its axis-aligned bounding box. More...
 

Namespaces

namespace  ParticleManagement
 Namespace for various particle management tools.
 
namespace  ParticleManagement::detail
 Internal-only implementation details of the ParticleManagement API.
 

Typedefs

template<typename Packed >
using ParticleManagement::KDPayloadCombine = std::function< Packed(const Packed *a_payloads, const Real *a_weights, const std::size_t a_count)>
 Illustrative signature of the N-ary combine callback: produce a merged particle's opaque payload from an arbitrary-size group of parents' payloads and weights.
 

Functions

template<typename Packed >
void ParticleManagement::detail::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 exactly one super-particle, subject to a live per-cell leaf quota of a_ppc.
 
template<typename T >
std::vector< T > ParticleManagement::detail::kdExchangeByRank (const std::vector< std::vector< T > > &a_sendByRank)
 Generic Alltoallv-style exchange for a trivially-copyable record type: send a per-destination-rank bucket, return the flat concatenation of everything received.
 
template<typename P , typename Packed , typename Traits = ParticleTraits<P>, typename Gather , typename Combine , typename Scatter , typename Allocator , typename PosValid >
void ParticleManagement::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.
 
template<typename P , typename Packed , typename Traits = ParticleTraits<P>, typename Gather , typename Combine , typename Scatter , typename Allocator , typename PosValid >
void ParticleManagement::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.
 
template<typename P , typename Packed , typename Traits = ParticleTraits<P>, typename Gather , typename Combine , typename Scatter , typename Allocator , typename PosValid >
void ParticleManagement::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.
 

Detailed Description

Declaration of distributed, MPI-safe whole-patch kd-tree super-particle merge algorithms.

Author
Robert Marskar