chombo-discharge
Loading...
Searching...
No Matches
Namespaces | Functions
CD_ParticleManagementImplem.H File Reference

Implementation of CD_ParticleManagement.H. More...

#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <limits>
#include <utility>
#include <type_traits>
#include <CH_Timer.H>
#include <CD_Random.H>
#include <CD_ParticleLoops.H>
#include <CD_ParticleManagement.H>
#include <CD_NamespaceHeader.H>
#include <CD_NamespaceFooter.H>
Include dependency graph for CD_ParticleManagementImplem.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Functions

ParticleMergeMethod ParticleManagement::mergeMethodFromString (const std::string &a_str) noexcept
 Map a merge-method selector string to a ParticleMergeMethod.
 
KDPartition ParticleManagement::kdPartitionFromString (const std::string &a_str) noexcept
 Turn an input string into a kd partition rule.
 
KDPlacement ParticleManagement::kdPlacementFromString (const std::string &a_str) noexcept
 Turn an input string into a kd placement rule.
 
KDSplitPlacement ParticleManagement::kdSplitPlacementFromString (const std::string &a_str) noexcept
 Turn an input string into a split placement rule.
 
KDAmrBoundary ParticleManagement::kdAmrBoundaryFromString (const std::string &a_str) noexcept
 Turn an input string into a kd AMR boundary rule.
 
NNSearch ParticleManagement::nnSearchFromString (const std::string &a_str) noexcept
 Turn an input string into a nearest-neighbour search backend.
 
RealVect ParticleManagement::detail::kdSplitDisplace (const KDSplitPlacement a_placement, const RealVect &a_parent, const RealVect &a_cellLo, const RealVect &a_dx, const Real a_spacing) noexcept
 Place one piece of a split particle.
 
template<class P , Real P::* weight, RealVect P::* position>
void ParticleManagement::detail::buildKDCellLeaves (const std::vector< P > &a_particles, const int a_maxLeaves, const Real a_weightMedianLength, const bool a_capWeights, const std::function< RealVect(const RealVect &)> &a_splitPosition, const BinaryParticleReconcile< P > &a_particleReconcile, std::vector< std::pair< const P *, const P * > > &a_leaves) noexcept
 Build a KD partition of a list of particles and return the leaf particle ranges.
 
template<class Packed , Real Packed::* packWeight, RealVect Packed::* packPosition, class P , class Traits = ParticleTraits<P>>
ParticleMerger< P, Traits > ParticleManagement::makeKDCellMerger (const Real a_weightMedianCellWidths, const bool a_capWeights, const KDSplitPlacement a_splitPlacement, std::function< RealVect()> a_probLo, std::function< Packed(const ParticleSoA< P, Traits > &, std::size_t)> a_gather, BinaryParticleReconcile< Packed > a_reconcile, std::function< void(ParticleSoA< P, Traits > &, const Packed *, const Packed *, const CellInfo &)> a_scatterLeaf) noexcept
 Create a per-cell KD-tree super-particle merger as a reusable ParticleMerger.
 
template<class Context , class P , class Traits = ParticleTraits<P>>
ParticleMerger< P, Traits > ParticleManagement::makeReinitializeMerger (std::function< std::pair< long long, Context >(const ParticleSoA< P, Traits > &)> a_aggregate, std::function< void(ParticleSoA< P, Traits > &, const RealVect &, long long, const Context &)> a_emit, std::function< RealVect()> a_probLo) noexcept
 Create a reinitialize super-particle merger as a reusable ParticleMerger.
 
template<typename P , typename Traits , typename T , typename >
void ParticleManagement::removePhysicalParticles (ParticleSoA< P, Traits > &a_particles, const T a_numPhysPartToRemove) noexcept
 Remove physical particles from an SoA container (operates on the container-owned weight column).
 
template<typename P , typename Traits >
void ParticleManagement::deleteParticles (ParticleSoA< P, Traits > &a_particles, const Real a_weightThresh) noexcept
 Remove particles from an SoA container if their weight is below the threshold (swap-and-pop).
 
template<typename T , typename >
void ParticleManagement::partitionParticleWeights (std::vector< T > &a_weights, const T a_numPhysicalParticles, const T a_maxCompParticles) noexcept
 Partition particle weights among a number of computational particles, into a caller-owned buffer.
 
template<typename T , typename >
std::vector< T > ParticleManagement::partitionParticleWeights (const T a_numPhysicalParticles, const T a_maxCompParticles) noexcept
 Partition particle weights among a number of computational particles.
 
template<typename T , typename >
T ParticleManagement::detail::partitionParticles (const T a_numParticles)
 Partition particles so that all MPI rank draw a cumulative number of particles equal to a_numParticles.
 
template<typename P , typename Traits , typename T , typename >
void ParticleManagement::drawRandomParticles (ParticleSoA< P, Traits > &a_particles, const T a_numParticles, const std::function< RealVect()> &a_distribution)
 Draw random SoA particles into a free buffer, distributed according to a predefined distribution.
 
template<typename P , typename Traits , typename T , typename >
void ParticleManagement::drawGaussianParticles (ParticleSoA< P, Traits > &a_particles, const T a_numParticles, const RealVect &a_center, const Real a_radius) noexcept
 Draw Gaussian-distributed particles into an SoA container (unit weight; positions only).
 
template<typename P , typename Traits , typename T , typename >
void ParticleManagement::drawBoxParticles (ParticleSoA< P, Traits > &a_particles, const T a_numParticles, const RealVect &a_loCorner, const RealVect &a_hiCorner) noexcept
 Draw box-distributed particles into an SoA container (unit weight; positions only).
 
template<typename P , typename Traits , typename T , typename >
void ParticleManagement::drawSphereParticles (ParticleSoA< P, Traits > &a_particles, const T a_numParticles, const RealVect &a_center, const Real a_radius) noexcept
 Draw sphere-distributed particles into an SoA container (unit weight; positions only).
 

Detailed Description

Implementation of CD_ParticleManagement.H.

Author
Robert Marskar