|
| template<class P , Real &(P::*)() weight, const RealVect &(P::*)() const position> |
| std::vector< std::shared_ptr< KDNode< P > > > | recursivePartitionAndSplitEqualWeightKD (typename KDNode< P >::ParticleList &a_inputParticles, const int a_maxLeaves, const BinaryParticleReconcile< P > a_particleReconcile) noexcept |
| | Recursively build a KD-tree following the "equal weight" principle when partitioning nodes.
|
| |
| template<typename P , typename T , typename > |
| void | removePhysicalParticles (List< P > &a_particles, const T a_numPhysPartToRemove) noexcept |
| | Remove physical particles from the input particles.
|
| |
| template<typename P > |
| void | deleteParticles (List< P > &a_particles, const Real a_weightThresh) noexcept |
| | Remove particles if their weight is below the input weight.
|
| |
| template<typename T , typename > |
| std::vector< T > | partitionParticleWeights (const T a_numPhysicalParticles, const T a_maxCompParticles) noexcept |
| | Partition particle weights among a number of computational particles.
|
| |
| template<typename T , typename > |
| T | 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 T , typename > |
| void | drawRandomParticles (List< P > &a_particles, const T a_numParticles, const std::function< RealVect()> &a_distribution) |
| | Draw a specified number of random particles distributed according to a predefined distribution.
|
| |
| template<typename P , typename T , typename > |
| void | drawSphereParticles (List< P > &a_particles, const T a_numParticles, const RealVect a_center, const Real a_radius) noexcept |
| | Draw particles in a sphere.
|
| |
| template<typename P , typename T , typename > |
| void | drawBoxParticles (List< P > &a_particles, const T a_numParticles, const RealVect a_loCorner, const RealVect a_hiCorner) noexcept |
| | Draw particles in a box.
|
| |
| template<typename P , typename T , typename > |
| void | drawGaussianParticles (List< P > &a_particles, const T a_numParticles, const RealVect a_center, const Real a_radius) noexcept |
| | Draw particles from a Gaussian distribution.
|
| |
Namespace for various particle management tools.
Recursively build a KD-tree following the "equal weight" principle when partitioning nodes.
- Parameters
-
| [in,out] | a_inputParticles | Input particles. These are destroyed on output. |
| [in] | a_maxLeaves | Maximum number of leaves in the tree. |
- Returns
- Returns leaf nodes containing the particles
If the number of leaves is a factor of two, leaves exist on the same level and the weight in each node will differ by at most one physical particle. The template parameters are
P -> Particle type P::*weight -> Function pointer to particle weight P::*position -> Function pointer to particle position.
A possible call signature is e.g. recursivePartitionAndSplitEqualWeightKD<P, &P::weight, &P::position>.
The user can input a particle reconciliation function that manipulates the particle properties of the split particles. By default, the split particles will use the copy constructor and thus inherit class members from p0, with the exception of the particle weights. The reconcile function lets the user manipulate other particle properties, e.g. ones that are not properly captured by the particle copy constructor, or that need some other form of reconciliation.